diff options
Diffstat (limited to 'setup_native/source/win32/customactions')
52 files changed, 579 insertions, 35 deletions
diff --git a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx index a01e3e1f9a4d..0b030b956570 100644 --- a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx +++ b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -206,3 +207,4 @@ extern "C" UINT __stdcall RestartIndexingService(MSIHANDLE) return ERROR_SUCCESS; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/javafilter/jfregca.cxx b/setup_native/source/win32/customactions/javafilter/jfregca.cxx index 80a8937cbe3a..638ff1c9f8ae 100644 --- a/setup_native/source/win32/customactions/javafilter/jfregca.cxx +++ b/setup_native/source/win32/customactions/javafilter/jfregca.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -24,7 +25,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -//#include <stdio.h> #ifdef _MSC_VER #pragma warning(push, 1) /* disable warnings within system headers */ @@ -328,3 +328,5 @@ void deleteKeys(HKEY hKey, TCHAR **data) { RegDeleteKey(hKey, soPath); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx b/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx index 9a933eea0334..1bebed752e18 100755..100644 --- a/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx +++ b/setup_native/source/win32/customactions/languagepacks/checkrunningofficelanguagepack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,6 +51,7 @@ #include <string> #include <queue> #include <stdio.h> +#include <sal/macros.h> #include <systools/win32/uwinapi.h> #include <../tools/seterror.hxx> @@ -64,7 +66,7 @@ inline void OutputDebugStringFormat( LPCTSTR pFormat, ... ) va_list args; va_start( args, pFormat ); - _vsntprintf( buffer, elementsof(buffer), pFormat, args ); + _vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args ); OutputDebugString( buffer ); } #else @@ -126,7 +128,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO ) { CHAR szBuffer[32767]; // The buffer size must not exceed 32K - DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, elementsof(szBuffer), WININIT_FILENAME ); + DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME ); CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters strcpy( szRename, szNewFileNameA ); @@ -134,7 +136,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO strcat( szRename, szExistingFileNameA ); size_t lnRename = strlen(szRename); - if ( dwBufLen + lnRename + 2 <= elementsof(szBuffer) ) + if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) ) { CopyMemory( &szBuffer[dwBufLen], szRename, lnRename ); szBuffer[dwBufLen + lnRename ] = 0; @@ -216,3 +218,4 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx index d3a6c81b59ed..f6f6a4c0c3b9 100644 --- a/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx +++ b/setup_native/source/win32/customactions/languagepacks/lngpckinsthelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -202,3 +203,4 @@ extern "C" UINT __stdcall RegisterLanguagePack(MSIHANDLE handle) return ERROR_SUCCESS; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/languagepacks/respintest.cxx b/setup_native/source/win32/customactions/languagepacks/respintest.cxx index 6a98af8a3f30..5f979a81fa68 100644 --- a/setup_native/source/win32/customactions/languagepacks/respintest.cxx +++ b/setup_native/source/win32/customactions/languagepacks/respintest.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,8 +46,9 @@ #include <tchar.h> #include <string> -#include <systools/win32/uwinapi.h> +#include <sal/macros.h> +#include <systools/win32/uwinapi.h> #include <../tools/seterror.hxx> using namespace std; @@ -110,7 +112,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) TEXT("ProductCode"), TEXT("INVALIDDIRECTORY"), szValue, - elementsof(szValue), + SAL_N_ELEMENTS(szValue), sSetupiniPath.c_str() ); @@ -132,7 +134,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) TEXT("buildid"), TEXT("ISWRONGPRODUCT"), szValue, - elementsof(szValue), + SAL_N_ELEMENTS(szValue), sSetupiniPath.c_str() ); @@ -173,7 +175,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) TEXT("ProductBuildid"), TEXT("8918"), szValue, - elementsof(szValue), + SAL_N_ELEMENTS(szValue), sSetupiniPath.c_str() ); @@ -197,7 +199,7 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) TEXT("ALLUSERS"), TEXT(""), szValue, - elementsof(szValue), + SAL_N_ELEMENTS(szValue), sSetupiniPath.c_str() ); @@ -209,3 +211,5 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx index 6285d64ebe3f..2ef10553e239 100755..100644 --- a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx +++ b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,6 +51,7 @@ #include <string> #include <queue> #include <stdio.h> +#include <sal/macros.h> #include <systools/win32/uwinapi.h> #include <../tools/seterror.hxx> @@ -64,7 +66,7 @@ inline void OutputDebugStringFormat( LPCTSTR pFormat, ... ) va_list args; va_start( args, pFormat ); - _vsntprintf( buffer, elementsof(buffer), pFormat, args ); + _vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args ); OutputDebugString( buffer ); } #else @@ -195,7 +197,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO ) { CHAR szBuffer[32767]; // The buffer size must not exceed 32K - DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, elementsof(szBuffer), WININIT_FILENAME ); + DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME ); CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters strcpy( szRename, szNewFileNameA ); @@ -203,7 +205,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO strcat( szRename, szExistingFileNameA ); size_t lnRename = strlen(szRename); - if ( dwBufLen + lnRename + 2 <= elementsof(szBuffer) ) + if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) ) { CopyMemory( &szBuffer[dwBufLen], szRename, lnRename ); szBuffer[dwBufLen + lnRename ] = 0; @@ -734,7 +736,7 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) TEXT("ProductCode"), TEXT("NOTFOUND"), szProductCode, - elementsof(szProductCode), + SAL_N_ELEMENTS(szProductCode), sSetupiniPath.c_str() ); @@ -896,3 +898,5 @@ extern "C" UINT __stdcall ShowOnlineUpdateDialog( MSIHANDLE handle ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx index 25659a0b4109..fbb4982a96f4 100644 --- a/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx +++ b/setup_native/source/win32/customactions/quickstarter/quickstarter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "quickstarter.hxx" #ifdef _MSC_VER #pragma warning(push, 1) /* disable warnings within system headers */ @@ -219,3 +220,4 @@ std::string GetProcessImagePath( DWORD dwProcessId ) return (LONG)GetVersion() < 0 ? GetProcessImagePath_9x( dwProcessId ) : GetProcessImagePath_NT( dwProcessId ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx b/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx index ef52ecfe2941..1d1b3c61d67a 100644 --- a/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx +++ b/setup_native/source/win32/customactions/quickstarter/remove_quickstart_link.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,5 @@ extern "C" UINT __stdcall RemoveQuickstarterLink( MSIHANDLE hMSI ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx b/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx index 6f931d2b0175..86e9585044ae 100644 --- a/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx +++ b/setup_native/source/win32/customactions/quickstarter/shutdown_quickstart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ extern "C" UINT __stdcall ShutDownQuickstarter( MSIHANDLE hMSI ) return ERROR_SUCCESS; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/rebase/rebase.cxx b/setup_native/source/win32/customactions/rebase/rebase.cxx index dfe1e82e1e9b..1eb3fedbf2f0 100644 --- a/setup_native/source/win32/customactions/rebase/rebase.cxx +++ b/setup_native/source/win32/customactions/rebase/rebase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #undef UNICODE #undef _UNICODE @@ -68,8 +69,8 @@ static BOOL rebaseImage( const std::string& filePath, LPVOID address ) ULONG_PTR lpNewImageBase = reinterpret_cast<ULONG_PTR>(address); BOOL bResult = ReBaseImage( - filePath.c_str(), - "", + (PSTR)filePath.c_str(), + (PSTR)"", TRUE, FALSE, FALSE, @@ -164,3 +165,5 @@ extern "C" BOOL __stdcall RebaseLibrariesOnProperties( MSIHANDLE handle ) return TRUE; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx index 3aba597098fb..54a471acf095 100644 --- a/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx +++ b/setup_native/source/win32/customactions/reg4allmsdoc/reg4allmsi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -499,3 +500,5 @@ extern "C" UINT __stdcall DeleteRegisteredExtensions( MSIHANDLE /*handle*/ ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx index 2941ba5a8e27..648d4f33fdd3 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/msihelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "msihelper.hxx" #include <malloc.h> @@ -100,3 +101,5 @@ bool IsCompleteDeinstallation(MSIHANDLE handle) GetMsiProp(handle, TEXT("REMOVE"), rm); return (rm == TEXT("ALL")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx index 19623e77ebc3..e3f930ccfcbd 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,8 +43,6 @@ #include <memory> #include <string> -#define ELEMENTS_OF_ARRAY(a) (sizeof(a)/sizeof(a[0])) - void DetermineWordPreselectionState(MSIHANDLE handle) { if (query_preselect_registration_for_ms_application(handle, MSWORD)) @@ -187,3 +186,5 @@ extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.cxx b/setup_native/source/win32/customactions/reg4msdoc/register.cxx index 77d091806acd..a23d0ea67934 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/register.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/register.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -338,3 +339,4 @@ int FixReturnRegistrationState(MSIHANDLE handle) return registration_state; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/register.hxx b/setup_native/source/win32/customactions/reg4msdoc/register.hxx index 29b9e8bdae00..c98787231655 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/register.hxx +++ b/setup_native/source/win32/customactions/reg4msdoc/register.hxx @@ -28,9 +28,7 @@ #ifndef _REGISTER_HXX_ #define _REGISTER_HXX_ -#ifndef _CONSTANTS_HXX_ #include "constants.hxx" -#endif #ifdef _MSC_VER #pragma warning(push, 1) /* disable warnings within system headers */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx index 7919d0fe833d..45fbed4819d2 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.cxx @@ -1,12 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // Registrar.cpp: Implementierung der Klasse Registrar. // ////////////////////////////////////////////////////////////////////// #include "registrar.hxx" -#ifndef _REGISTRYVALUEIMPL_HXX_ #include "RegistryValueImpl.hxx" -#endif #include "windowsregistry.hxx" #include "registryexception.hxx" @@ -757,3 +756,5 @@ bool Registrar::IsOpenOfficeRegisteredForMsApplication(const std::wstring& Docum { return (std::wstring::npos != DocumentExtensionDefValue.find(FORWARD_KEY_PREFIX)); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx index 529a39d5c9c8..b675c3da4e29 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registrar.hxx @@ -8,9 +8,7 @@ #include "registry.hxx" #include "registrationcontextinformation.hxx" -#ifndef _CONSTANTS_HXX_ #include "constants.hxx" -#endif class Registrar { diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx index ebe836926337..189b7e3074ae 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registrationcontextinformation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ //Implementierung der Klasse RegistrationContextInformation. #include <assert.h> @@ -349,3 +350,4 @@ void RegistrationContextInformation::ExtractOpenOfficeExecNameFromPath() m_OOExecName = m_OOExecPath.substr(idx + 1); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx index 2572a3a2d287..bc277997b92b 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registry.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -240,3 +241,5 @@ void RegistryKeyImpl::CopyValue(const RegistryKey& RegistryKey, const std::wstri assert(HasValue(NewName)); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx index 9eaa05df38f7..cebbe67c6798 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registryexception.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // RegistryException.cpp: Implementierung der Klasse RegistryException. // ////////////////////////////////////////////////////////////////////// @@ -109,3 +110,5 @@ RegistryInvalidOperationException::RegistryInvalidOperationException(long ErrorC RegistryException(ErrorCode) { }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx index eabc32f19cff..d9012fcd087d 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registryvalueimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // RegistryValueImpl.cpp: Implementierung der Klasse RegistryValueImpl. // ////////////////////////////////////////////////////////////////////// @@ -187,3 +188,5 @@ void RegistryValueImpl::SetValue(int NewValue) m_Type = REG_DWORD; m_IntData = NewValue; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx index 620a32f028bb..47cc8ce70ec5 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registryw9x.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -548,3 +549,4 @@ void RegistryKeyImplWin9x::SetValue(const RegistryValue& Value) throw RegistryException(rc); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx index 361672790630..4f60d0cae32a 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/registrywnt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -617,3 +618,4 @@ void RegistryKeyImplWinNT::SetValue(const RegistryValue& Value) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx index 68d0872ad81a..db38d568e877 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/stringconverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,4 @@ std::wstring AnsiToUnicodeString(const std::string& AnsiString) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx index 68d3a1e2205d..986bf0d28cb6 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // UserRegistrar.cpp: Implementierung der Klasse UserRegistrar. // ////////////////////////////////////////////////////////////////////// @@ -134,3 +135,5 @@ void UserRegistrar::DeleteHtmFileAssociationKeys() const // deleting a key and so destroying existing associations // See MSDN: "Merged View of HKEY_CLASSES_ROOT" } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx index 1ed544f06806..1e97f779bc39 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/windowsregistry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // WindowsRegistry.cpp: Implementierung der Klasse WindowsRegistry. // ////////////////////////////////////////////////////////////////////// @@ -77,3 +78,5 @@ RegistryKey WindowsRegistry::GetRegistryKey(HKEY RootKey, bool Writeable) const return regkey; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/reg64/reg64.cxx b/setup_native/source/win32/customactions/reg64/reg64.cxx index 53eb16a99583..fe22ed86b829 100755..100644 --- a/setup_native/source/win32/customactions/reg64/reg64.cxx +++ b/setup_native/source/win32/customactions/reg64/reg64.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -25,11 +26,6 @@ * ************************************************************************/ -/* - -*/ - - #define UNICODE #ifdef _MSC_VER @@ -43,8 +39,6 @@ #endif #include <malloc.h> -//#include <string> -//#include <map> #include <strsafe.h> // 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExW if WINVER < 0x0502. @@ -474,4 +468,6 @@ extern "C" UINT __stdcall DeinstallReg64(MSIHANDLE hMSI) OutputDebugStringFormat(L"DeinstallReg64\n" ); Reg64(hMSI, REMOVE); return ERROR_SUCCESS; -}
\ No newline at end of file +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/regactivex/regactivex.cxx b/setup_native/source/win32/customactions/regactivex/regactivex.cxx index 037824689a47..0cf89eca1ebc 100644 --- a/setup_native/source/win32/customactions/regactivex/regactivex.cxx +++ b/setup_native/source/win32/customactions/regactivex/regactivex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -436,3 +437,5 @@ extern "C" UINT __stdcall DeinstallActiveXControl( MSIHANDLE hMSI ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx b/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx index 99efedbb696b..800fde54eab5 100644 --- a/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx +++ b/setup_native/source/win32/customactions/regpatchactivex/regpatchactivex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,3 +121,4 @@ extern "C" UINT __stdcall PatchActiveXControl( MSIHANDLE hMSI ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/relnotes/relnotes.cxx b/setup_native/source/win32/customactions/relnotes/relnotes.cxx index d4dc7d6ecfa6..48aaf9b417bd 100644 --- a/setup_native/source/win32/customactions/relnotes/relnotes.cxx +++ b/setup_native/source/win32/customactions/relnotes/relnotes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -174,7 +175,7 @@ extern "C" UINT __stdcall ShowSurveyAfter( MSIHANDLE handle ) aExecInf.cbSize = sizeof( aExecInf ); aExecInf.fMask = SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI; aExecInf.lpVerb = TEXT("open"); - aExecInf.lpFile = TEXT("http://surveys.services.openoffice.org/deinstall"); + aExecInf.lpFile = TEXT("http://surveys.libreoffice.org/deinstall"); aExecInf.lpDirectory = NULL; aExecInf.nShow = SW_SHOWNORMAL; @@ -184,3 +185,4 @@ extern "C" UINT __stdcall ShowSurveyAfter( MSIHANDLE handle ) return ERROR_SUCCESS; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/sellang/exports.dxp b/setup_native/source/win32/customactions/sellang/exports.dxp new file mode 100644 index 000000000000..cc6dd8d32e47 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/exports.dxp @@ -0,0 +1 @@ +SelectLanguage diff --git a/setup_native/source/win32/customactions/sellang/makefile.mk b/setup_native/source/win32/customactions/sellang/makefile.mk new file mode 100644 index 000000000000..e2110ce708c9 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/makefile.mk @@ -0,0 +1,79 @@ +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 3. +# +# +# GNU Lesser General Public License Version 3 +# ============================================= +# Copyright 2005 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +#************************************************************************* + +PRJ=..$/..$/..$/.. +PRJNAME=setup_native +TARGET=sellangmsi + +.IF "$(GUI)"=="WNT" + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE +NO_DEFAULT_STL=TRUE +DYNAMIC_CRT= +USE_DEFFILE=TRUE + +.INCLUDE : settings.mk + +CFLAGS+=-D_STLP_USE_STATIC_LIB + +# --- Files -------------------------------------------------------- + +UWINAPILIB= + +SLOFILES = \ + $(SLO)$/sellang.obj + +SHL1STDLIBS= kernel32.lib\ + user32.lib\ + advapi32.lib\ + shell32.lib\ + msi.lib\ + $(LIBSTLPORTST) + +SHL1LIBS = $(SLB)$/$(TARGET).lib + +SHL1TARGET = $(TARGET) +SHL1IMPLIB = i$(TARGET) + +SHL1DEF = $(MISC)$/$(SHL1TARGET).def +SHL1DEPN = $(SLB)$/$(TARGET).lib +SHL1BASE = 0x1c000000 +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk + +# ------------------------------------------------------------------------- + + +.ENDIF diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx new file mode 100644 index 000000000000..a031606d1823 --- /dev/null +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -0,0 +1,351 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 3. + * + * + * GNU Lesser General Public License Version 3 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0500 +#undef WINVER +#define WINVER 0x0500 + +#pragma warning(push, 1) /* disable warnings within system headers as + * warnings are now treated as errors... + */ +#include <windows.h> +#include <msiquery.h> +#include <malloc.h> + +#ifdef UNICODE +#define _UNICODE +#define _tstring wstring +#else +#define _tstring string +#endif +#include <tchar.h> +#include <string> +#include <stdio.h> +#pragma warning(pop) + +#include <sal/macros.h> +#include <systools/win32/uwinapi.h> + +/* #define VERBOSE_DEBUG_OUTPUT 1 */ + +static const char * +langid_to_string( LANGID langid, int *have_default_lang ) +{ + /* Map from LANGID to string. The languages below are in the same + * seemingly random order as in + * setup_native/source/win32/msi-encodinglist.txt. + * Only the language part is returned in the string. + */ + switch (PRIMARYLANGID (langid)) { + case LANG_ENGLISH: + if (have_default_lang != NULL && + langid == MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)) + *have_default_lang = 1; + return "en"; +#define CASE(primary, name) \ + case LANG_##primary: return #name + CASE(PORTUGUESE, pt); + CASE(RUSSIAN, ru); + CASE(GREEK, el); + CASE(DUTCH, nl); + CASE(FRENCH, fr); + CASE(SPANISH, es); + CASE(FINNISH, fi); + CASE(HUNGARIAN, hu); + CASE(CATALAN, ca); + CASE(ITALIAN, it); + CASE(CZECH, cs); + CASE(SLOVAK, sk); + CASE(DANISH, da); + CASE(SWEDISH, sv); + CASE(POLISH, pl); + CASE(GERMAN, de); + CASE(THAI, th); + CASE(ESTONIAN, et); + CASE(JAPANESE, ja); + CASE(KOREAN, ko); + // CASE(KHMER, km); + // CASE(WELSH, cy); + CASE(CHINESE, zh); + CASE(TURKISH, tr); + CASE(HINDI, hi); + CASE(PUNJABI, pa); + CASE(TAMIL, ta); + CASE(ARABIC, ar); + CASE(HEBREW, he); + CASE(AFRIKAANS, af); + CASE(ALBANIAN, sq); + CASE(ARMENIAN, hy); + CASE(BASQUE, eu); + CASE(BELARUSIAN, be); + CASE(BENGALI, bn); + CASE(BULGARIAN, bg); + CASE(ICELANDIC, is); + CASE(INDONESIAN, id); + // CASE(LAO, lo); + CASE(LATVIAN, lv); + CASE(LITHUANIAN, lt); + // CASE(MALTESE, mt); + // CASE(ROMANSH, rm); + CASE(ROMANIAN, ro); + // CASE(KINYARWANDA, rw); + CASE(SANSKRIT, sa); + // CASE(SETSWANA, tn); + CASE(FARSI, fa); + CASE(FAEROESE, fo); + CASE(SLOVENIAN, sl); + // CASE(SORBIAN, sb); + // CASE(SUTU, st); + CASE(SWAHILI, sw); + CASE(TATAR, tt); + // CASE(TSONGA, ts); + CASE(UKRAINIAN, uk); + CASE(URDU, ur); + CASE(VIETNAMESE, vi); + // CASE(XHOSA, xh); + // CASE(YIDDISH, yi); + // CASE(ZULU, zu); + CASE(GUJARATI, gu); + // CASE(BRETON, br); + CASE(NEPALI, ne); + // CASE(NDEBELE, nr); + // CASE(SWAZI, ss); + // CASE(VENDA, ve); + // CASE(IRISH, ga); + CASE(MACEDONIAN, mk); + CASE(TELUGU, te); + CASE(MALAYALAM, ml); + CASE(MARATHI, mr); + CASE(ORIYA, or); + // CASE(KURDISH, ku); + // CASE(TAGALOG, tg); + // CASE(TIGRINYA, ti); + CASE(GALICIAN, gl); + CASE(KANNADA, kn); + CASE(MALAY, ms); + // CASE(TAJIK, tg); + CASE(GEORGIAN, ka); + // CASE(ESPERANTO, eo); +#undef CASE + /* Special cases */ + default: + switch (langid) { + case MAKELANGID(LANG_SERBIAN, 0x05): return "bs"; +#define CASE(primary, sub, name) \ + case MAKELANGID(LANG_##primary, SUBLANG_##sub): return #name + + CASE(NORWEGIAN, NORWEGIAN_BOKMAL, nb); + CASE(NORWEGIAN, NORWEGIAN_NYNORSK, nn); + CASE(SERBIAN, DEFAULT, hr); + CASE(SERBIAN, SERBIAN_LATIN, sh); + CASE(SERBIAN, SERBIAN_CYRILLIC, sr); + // CASE(SOTHO, DEFAULT, ns); + // CASE(SOTHO, SOTHO_SOUTHERN, st); +#undef CASE + default: return ""; + } + } +} + +static const char *ui_langs[100]; +static int num_ui_langs = 0; + +BOOL CALLBACK +enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) +{ + long langid = strtol(language, NULL, 16); + if (langid > 0xFFFF) + return TRUE; + ui_langs[num_ui_langs] = langid_to_string((LANGID) langid, NULL); + num_ui_langs++; + if (num_ui_langs == SAL_N_ELEMENTS(ui_langs) ) + return FALSE; + return TRUE; +} + +static BOOL +present_in_ui_langs(const char *lang) +{ + for (int i = 0; i < num_ui_langs; i++) + if (memcmp (ui_langs[i], lang, 2) == 0) + return TRUE; + return FALSE; +} + +extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) +{ +#ifdef VERBOSE_DEBUG_OUTPUT + char tem[2000]; +#endif + char feature[100]; + MSIHANDLE database, view, record; + DWORD length; + int nlangs = 0; + /* Keeping this code simple and stupid... won't bother with any + * dynamic arrays or whatnot. 100 is more than enough for this purpose. + */ + char langs[100][6]; + + database = MsiGetActiveDatabase(handle); + + if (MsiDatabaseOpenViewA(database, "SELECT Feature from Feature WHERE Feature_Parent = 'gm_Langpack_Languageroot'", &view) != ERROR_SUCCESS) { + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + +#ifdef VERBOSE_DEBUG_OUTPUT + MessageBoxA(NULL, "MsiDatabaseOpenViewA success!", "SelectLanguage", MB_OK); +#endif + + if (MsiViewExecute(view, NULL) != ERROR_SUCCESS) { + MsiCloseHandle(view); + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + +#ifdef VERBOSE_DEBUG_OUTPUT + MessageBoxA(NULL, "MsiViewExecute success!", "SelectLanguage", MB_OK); +#endif + + while (MsiViewFetch(view, &record) == ERROR_SUCCESS) { + length = sizeof(feature); + if (MsiRecordGetStringA(record, 1, feature, &length) != ERROR_SUCCESS) { + MsiCloseHandle(record); + MsiCloseHandle(view); + MsiCloseHandle(database); + return ERROR_SUCCESS; + } + + /* Keep track of what languages are included in this installer, if + * it is a multilanguage one. + */ + if (strcmp(feature, "gm_Langpack_r_en_US") != 0) + strcpy(langs[nlangs++], feature + strlen("gm_Langpack_r_")); + + MsiCloseHandle(record); + } + + MsiCloseHandle(view); + + if (nlangs > 0) { + /* Deselect those languages that don't match any of the UI languages + * available on the system. + */ + + int i; + int have_system_default_lang = 0; + const char *system_default_lang = langid_to_string(GetSystemDefaultUILanguage(), &have_system_default_lang); + const char *user_locale_lang = langid_to_string(LANGIDFROMLCID(GetThreadLocale()), NULL); + +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "GetSystemDefaultUILanguage(): %#x = %s", GetSystemDefaultUILanguage(), system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + + EnumUILanguagesA(enum_ui_lang_proc, 0, 0); + +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "Have %d UI languages: ", num_ui_langs); + for (i = 0; i < num_ui_langs; i++) { + char *p = tem + strlen(tem); + sprintf(p, "%s%s", + ui_langs[i], + (i + 1 < num_ui_langs) ? ", " : ""); + } + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + + /* If one of the alternative languages in a multi-language installer + * is the system default UI language, deselect those languages that + * aren't among the UI languages available on the system. + * (On most Windows installations, just one UI language is present, + * which obviously is the same as the default UI language. But + * we want to be generic.) + * If none of the languages in a multi-language installer is the + * system default UI language (this happens now in 2.4.0 where we + * cannot put as many UI languages into the installer as we would + * like, but only half a dozen: en-US,de,es,fr,it,pt-BR), pretend + * that English is the system default UI language, + * so that we will by default deselect everything except + * English. We don't want to by default install all half dozen + * languages for an unsuspecting user of a Finnish Windows, for + * instance. Sigh. + */ + if (system_default_lang[0]) { + for (i = 0; i < nlangs; i++) { + if (memcmp (system_default_lang, langs[i], 2) == 0) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "We have the system default language %s in the installer", system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + have_system_default_lang = 1; + } + } + } + + if (!have_system_default_lang) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "We don't have the system default language %s in the installer, so pretend that English is the system default, sigh.", system_default_lang); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + system_default_lang = "en"; + have_system_default_lang = 1; + } + if (have_system_default_lang) { + for (i = 0; i < nlangs; i++) { + if (memcmp(system_default_lang, langs[i], 2) != 0 && + memcmp(user_locale_lang, langs[i], 2) != 0 && + !present_in_ui_langs(langs[i])) { + UINT rc; + sprintf(feature, "gm_Langpack_r_%s", langs[i]); + rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + if (rc != ERROR_SUCCESS) { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "MsiSetFeatureStateA %s failed: %d", feature, rc); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + } else { +#ifdef VERBOSE_DEBUG_OUTPUT + sprintf(tem, "MsiSetFeatureStateA %s OK!", feature); + MessageBoxA(NULL, tem, "SelectLanguage", MB_OK); +#endif + } + } + } + } + } + + MsiCloseHandle(database); + + return ERROR_SUCCESS; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx index ebd9de5e7fbe..58159cabd56f 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx +++ b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,3 +116,5 @@ extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx index 07c84d890316..01ba1ab13b16 100644 --- a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx +++ b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -111,3 +112,5 @@ extern "C" UINT __stdcall CheckPatchList( MSIHANDLE handle ) } return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx index 9a028953fef1..f50c795c5c8a 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx +++ b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,6 +51,7 @@ #include <string> #include <queue> #include <stdio.h> +#include <sal/macros.h> #include <systools/win32/uwinapi.h> #include <../tools/seterror.hxx> @@ -64,7 +66,7 @@ inline void OutputDebugStringFormat( LPCTSTR pFormat, ... ) va_list args; va_start( args, pFormat ); - _vsntprintf( buffer, elementsof(buffer), pFormat, args ); + _vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args ); OutputDebugString( buffer ); } #else @@ -126,7 +128,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO ) { CHAR szBuffer[32767]; // The buffer size must not exceed 32K - DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, elementsof(szBuffer), WININIT_FILENAME ); + DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME ); CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters strcpy( szRename, szNewFileNameA ); @@ -134,7 +136,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO strcat( szRename, szExistingFileNameA ); size_t lnRename = strlen(szRename); - if ( dwBufLen + lnRename + 2 <= elementsof(szBuffer) ) + if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) ) { CopyMemory( &szBuffer[dwBufLen], szRename, lnRename ); szBuffer[dwBufLen + lnRename ] = 0; @@ -288,3 +290,4 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx index 7d09e79b9ec7..7b7453a1f70e 100644 --- a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx +++ b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,3 +179,5 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx index 7dc5194a18cb..c816a71a3de1 100644 --- a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx +++ b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -128,3 +129,5 @@ extern "C" UINT __stdcall copyEditionData(MSIHANDLE install) { } return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx index 517915cb831f..d94b65459d8a 100644 --- a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx +++ b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,3 +123,5 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) { return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx index f7cf0247c631..ffd6ef1a87dd 100644 --- a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx +++ b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -179,3 +180,5 @@ extern "C" UINT __stdcall ShowProperties(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/iconcache.cxx b/setup_native/source/win32/customactions/shellextensions/iconcache.cxx index 75b5914bafbc..daba7fb8c7d7 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/iconcache.cxx +++ b/setup_native/source/win32/customactions/shellextensions/iconcache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,5 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx index fb0897e728fe..11c9757ff921 100644 --- a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx +++ b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -255,3 +256,5 @@ extern "C" UINT __stdcall RemoveLayerLinks(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx index c8035799a539..a487309c53f2 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx +++ b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,3 +116,5 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx index ea9bfae3864b..d4ac16aec8a3 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx +++ b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -153,3 +154,4 @@ extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle ) return ERROR_SUCCESS; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 9eaad6959a63..9075436e0412 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -425,3 +426,5 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx index 6bd57447f092..f9dfc5cb99bc 100755..100644 --- a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx +++ b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ extern "C" UINT __stdcall SetAdminInstallProperty(MSIHANDLE handle) SetMsiProperty(handle, TEXT("ADMININSTALL")); return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx index c779e1e5994e..c26b0ca0d0c2 100644 --- a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -211,3 +212,5 @@ extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE) } return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx index 5adab408139d..9c5e6d4eb416 100644 --- a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx +++ b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,5 @@ extern "C" UINT __stdcall DeinstallStartmenuFolderIcon(MSIHANDLE handle) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx index 1fb2972d433a..6280bfb5b2e5 100644 --- a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx +++ b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -202,3 +203,5 @@ extern "C" UINT __stdcall SetProductInstallMode(MSIHANDLE handle) } return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx index 70064b58807c..badd20ae241e 100644 --- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx +++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -240,3 +241,5 @@ extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle ) return ERROR_SUCCESS; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/tools/checkversion.cxx b/setup_native/source/win32/customactions/tools/checkversion.cxx index ef30b2f9365f..b978301fb57a 100644 --- a/setup_native/source/win32/customactions/tools/checkversion.cxx +++ b/setup_native/source/win32/customactions/tools/checkversion.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -147,3 +148,4 @@ extern "C" UINT __stdcall CheckVersions( MSIHANDLE hMSI ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/setup_native/source/win32/customactions/tools/seterror.cxx b/setup_native/source/win32/customactions/tools/seterror.cxx index 6d50120ccc18..c9c74ec43d18 100644 --- a/setup_native/source/win32/customactions/tools/seterror.cxx +++ b/setup_native/source/win32/customactions/tools/seterror.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,4 @@ void SetMsiErrorCode( int nErrorCode ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |