summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/shellextensions
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source/win32/customactions/shellextensions')
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx10
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkpatches.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx80
-rw-r--r--setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx72
-rw-r--r--setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx2
-rw-r--r--setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx26
-rw-r--r--setup_native/source/win32/customactions/shellextensions/iconcache.cxx26
-rw-r--r--setup_native/source/win32/customactions/shellextensions/layerlinks.cxx18
-rw-r--r--setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx42
-rw-r--r--setup_native/source/win32/customactions/shellextensions/postuninstall.cxx42
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx52
-rw-r--r--setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx6
-rw-r--r--setup_native/source/win32/customactions/shellextensions/shellextensions.cxx104
-rw-r--r--setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx54
-rw-r--r--setup_native/source/win32/customactions/shellextensions/upgrade.cxx92
-rw-r--r--setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx12
17 files changed, 325 insertions, 325 deletions
diff --git a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
index 58159cabd56f..8e4abcca52f1 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkdirectory.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -95,7 +95,7 @@ extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
UnsetMsiProperty( handle, TEXT("DIRECTORY_NOT_EMPTY") );
// 1. Searching for file setup.ini
-
+
std::_tstring sSetupIniPath = sInstallPath + sOfficeHostnamePath + TEXT("\\program\\setup.ini");
WIN32_FIND_DATA data;
@@ -113,7 +113,7 @@ extern "C" UINT __stdcall CheckInstallDirectory(MSIHANDLE handle)
// std::_tstring notEmptyTitle = "Directory not empty";
// MessageBox(NULL, notEmptyStr.c_str(), notEmptyTitle.c_str(), MB_OK);
}
-
+
return ERROR_SUCCESS;
}
diff --git a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
index 01ba1ab13b16..2cfdcfa54f1a 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
index f50c795c5c8a..0cf8458221aa 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -56,14 +56,14 @@
#include <systools/win32/uwinapi.h>
#include <../tools/seterror.hxx>
-#define WININIT_FILENAME "wininit.ini"
-#define RENAME_SECTION "rename"
+#define WININIT_FILENAME "wininit.ini"
+#define RENAME_SECTION "rename"
#ifdef DEBUG
inline void OutputDebugStringFormat( LPCTSTR pFormat, ... )
{
- _TCHAR buffer[1024];
- va_list args;
+ _TCHAR buffer[1024];
+ va_list args;
va_start( args, pFormat );
_vsntprintf( buffer, SAL_N_ELEMENTS(buffer), pFormat, args );
@@ -77,9 +77,9 @@ static inline void OutputDebugStringFormat( LPCTSTR, ... )
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -87,14 +87,14 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
-
+
static inline bool IsSetMsiProperty(MSIHANDLE handle, const std::_tstring& sProperty)
-{
+{
std::_tstring value = GetMsiProperty(handle, sProperty);
return (value.length() > 0);
}
@@ -111,30 +111,30 @@ static inline void SetMsiProperty(MSIHANDLE handle, const std::_tstring& sProper
static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWORD dwFlags )
{
- BOOL fSuccess = FALSE; // assume failure
+ BOOL fSuccess = FALSE; // assume failure
// Windows 9x has a special mechanism to move files after reboot
if ( dwFlags & MOVEFILE_DELAY_UNTIL_REBOOT )
{
- CHAR szExistingFileNameA[MAX_PATH];
- CHAR szNewFileNameA[MAX_PATH] = "NUL";
+ CHAR szExistingFileNameA[MAX_PATH];
+ CHAR szNewFileNameA[MAX_PATH] = "NUL";
// Path names in WININIT.INI must be in short path name form
- if (
+ if (
GetShortPathNameA( lpExistingFileNameA, szExistingFileNameA, MAX_PATH ) &&
(!lpNewFileNameA || GetShortPathNameA( lpNewFileNameA, szNewFileNameA, MAX_PATH ))
)
{
- CHAR szBuffer[32767]; // The buffer size must not exceed 32K
- DWORD dwBufLen = GetPrivateProfileSectionA( RENAME_SECTION, szBuffer, SAL_N_ELEMENTS(szBuffer), WININIT_FILENAME );
+ CHAR szBuffer[32767]; // The buffer size must not exceed 32K
+ 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
+ CHAR szRename[MAX_PATH]; // This is enough for at most to times 67 chracters
strcpy( szRename, szNewFileNameA );
strcat( szRename, "=" );
strcat( szRename, szExistingFileNameA );
- size_t lnRename = strlen(szRename);
+ size_t lnRename = strlen(szRename);
if ( dwBufLen + lnRename + 2 <= SAL_N_ELEMENTS(szBuffer) )
{
@@ -156,7 +156,7 @@ static BOOL MoveFileEx9x( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, DWO
if ( !fSuccess && GetLastError() != ERROR_ACCESS_DENIED &&
0 != (dwFlags & (MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING)) )
{
- BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
+ BOOL bFailIfExist = 0 == (dwFlags & MOVEFILE_REPLACE_EXISTING);
fSuccess = CopyFileA( lpExistingFileNameA, lpNewFileNameA, bFailIfExist );
@@ -179,10 +179,10 @@ static BOOL MoveFileExImpl( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, D
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
{
- OSVERSIONINFO osverinfo;
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx( &osverinfo );
-
+
// renaming the vcl resource doesn't work reliable with OS >= Windows Vista
if (osverinfo.dwMajorVersion < 6 )
{
@@ -198,18 +198,18 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
// mystr = "IsOfficeRunning start. Checking file in dir: " + sResourceDir;
// MessageBox( NULL, mystr.c_str(), "IsOfficeRunning", MB_OK );
- WIN32_FIND_DATA aFindFileData;
- HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
+ WIN32_FIND_DATA aFindFileData;
+ HANDLE hFind = FindFirstFile( sPattern.c_str(), &aFindFileData );
if ( IsValidHandle(hFind) )
{
- BOOL fSuccess = false;
- bool fRenameSucceeded;
+ BOOL fSuccess = false;
+ bool fRenameSucceeded;
do
{
- std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
- std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
+ std::_tstring sResourceFile = sResourceDir + aFindFileData.cFileName;
+ std::_tstring sIntermediate = sResourceFile + TEXT(".tmp");
fRenameSucceeded = MoveFileExImpl( sResourceFile.c_str(), sIntermediate.c_str(), MOVEFILE_REPLACE_EXISTING );
if ( fRenameSucceeded )
@@ -239,12 +239,12 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
// Property empty -> no office installed
if ( sOfficeInstallPath.length() == 0 )
return ERROR_SUCCESS;
-
+
std::_tstring sRenameSrc = sOfficeInstallPath + TEXT("program");
std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_test");
-
+
bool bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
-
+
if ( bSuccess )
{
MoveFile( sRenameDst.c_str(), sRenameSrc.c_str() );
@@ -258,14 +258,14 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
return ERROR_SUCCESS;
if ( dwError == ERROR_PATH_NOT_FOUND )
return ERROR_SUCCESS;
-
+
// The destination folder should never exist, don't know what to do here
if ( dwError == ERROR_ALREADY_EXISTS )
return ERROR_SUCCESS;
-
- if ( FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
+
+ if ( FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
@@ -279,7 +279,7 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
}
else
OutputDebugStringFormat( TEXT("Error Code %d: Unknown"), dwError );
-
+
MsiSetProperty( handle, TEXT("OFFICERUNS"), TEXT("1") );
SetMsiErrorCode( MSI_ERROR_OFFICE_IS_RUNNING );
}
diff --git a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
index 7b7453a1f70e..aca931c9c22f 100644
--- a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,22 +41,22 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
using namespace std;
-namespace
+namespace
{
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -67,7 +67,7 @@ namespace
result = buffer;
}
- return result;
+ return result;
}
} // namespace
@@ -79,49 +79,49 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
// this causes in an update installation, that INSTALLLOCATION is set to "c:\program files",
// so that in an OOo 3.3 or later, the directory "program" or "share" are directly created
// below "c:\program files".
-
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
- std::_tstring mystr;
-
- // Reading property OFFICEDIRHOSTNAME_, that contains the part of the path behind
+
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
+ std::_tstring mystr;
+
+ // Reading property OFFICEDIRHOSTNAME_, that contains the part of the path behind
// the program files folder.
-
- std::_tstring sInstallLocation = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
- std::_tstring sOfficeDirHostname = GetMsiProperty( handle, TEXT("OFFICEDIRHOSTNAME_") );
-
+
+ std::_tstring sInstallLocation = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
+ std::_tstring sOfficeDirHostname = GetMsiProperty( handle, TEXT("OFFICEDIRHOSTNAME_") );
+
// If sInstallLocation ends with (contains) the string sOfficeDirHostname,
// INSTALLLOCATION is good and nothing has to be done here.
-
+
bool pathCompletionRequired = true;
if ( _tcsstr( sInstallLocation.c_str(), sOfficeDirHostname.c_str() ) )
{
- pathCompletionRequired = false; // nothing to do
+ pathCompletionRequired = false; // nothing to do
// mystr = "Nothing to do, officedir is included into installlocation";
// MessageBox( NULL, mystr.c_str(), "It is part of installlocation", MB_OK );
}
-
+
// If the path INSTALLLOCATION does not end with this string, INSTALLLOCATION is maybe
// transfered from an OOo 3.0, OOo 3.1 and OOo 3.2 and need to be changed therefore.
if ( pathCompletionRequired )
{
- std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
- std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
- std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
+ std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
+ std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
+ std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
// sUpdateVersion can be "3.0", "3.1" or "3.2"
- std::_tstring sProductKey30 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey30 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.0" + "\\" + sUpgradeCode;
- std::_tstring sProductKey31 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey31 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.1" + "\\" + sUpgradeCode;
- std::_tstring sProductKey32 = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey32 = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + "3.2" + "\\" + sUpgradeCode;
// mystr = "ProductKey: " + sProductKey;
@@ -129,7 +129,7 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
// mystr = "Checking registry";
// MessageBox( NULL, mystr.c_str(), "registry search", MB_OK );
-
+
bool oldVersionExists = false;
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey30.c_str(), &hKey ) )
@@ -140,29 +140,29 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle )
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey31.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey32.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey30.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey31.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey32.c_str(), &hKey ) )
{
oldVersionExists = true;
- RegCloseKey( hKey );
+ RegCloseKey( hKey );
}
-
+
if ( oldVersionExists )
{
// Adding the new path content sOfficeDirHostname
diff --git a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
index c816a71a3de1..c78b2efffe06 100644
--- a/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/copyeditiondata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
diff --git a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
index d94b65459d8a..253fa7a2c2ed 100644
--- a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,9 +49,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
index ffd6ef1a87dd..2cea3de247ec 100644
--- a/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/dotnetcheck.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -52,7 +52,7 @@
using namespace std;
-namespace
+namespace
{
string GetMsiProperty(MSIHANDLE handle, const string& sProperty)
{
@@ -121,7 +121,7 @@ Order compareVersions(string const & version1, string const & version2) {
if (e1.size() < e2.size()) {
return ORDER_LESS;
- } else if (e1.size() > e2.size()) {
+ } else if (e1.size() > e2.size()) {
return ORDER_GREATER;
} else if (e1 < e2) {
return ORDER_LESS;
@@ -132,7 +132,7 @@ Order compareVersions(string const & version1, string const & version2) {
return ORDER_EQUAL;
}
-} // namespace
+} // namespace
extern "C" UINT __stdcall DotNetCheck(MSIHANDLE handle) {
string present(GetMsiProperty(handle, TEXT("MsiNetAssemblySupport")));
@@ -151,34 +151,34 @@ extern "C" UINT __stdcall DotNetCheck(MSIHANDLE handle) {
// string result(GetMsiProperty(handle, TEXT("DOTNET_SUFFICIENT")));
// string myText3 = TEXT("DOTNET_SUFFICIENT: ") + result;
// MessageBox(NULL, myText3.c_str(), "DEBUG", MB_OK);
+
-
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
extern "C" UINT __stdcall ShowProperties(MSIHANDLE handle)
{
- string property = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
+ string property = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
string myText = TEXT("INSTALLLOCATION: ") + property;
MessageBox(NULL, myText.c_str(), "INSTALLLOCATION", MB_OK);
- property = GetMsiProperty(handle, TEXT("Installed"));
+ property = GetMsiProperty(handle, TEXT("Installed"));
myText = TEXT("Installed: ") + property;
MessageBox(NULL, myText.c_str(), "Installed", MB_OK);
- property = GetMsiProperty(handle, TEXT("PATCH"));
+ property = GetMsiProperty(handle, TEXT("PATCH"));
myText = TEXT("PATCH: ") + property;
MessageBox(NULL, myText.c_str(), "PATCH", MB_OK);
- property = GetMsiProperty(handle, TEXT("REMOVE"));
+ property = GetMsiProperty(handle, TEXT("REMOVE"));
myText = TEXT("REMOVE: ") + property;
MessageBox(NULL, myText.c_str(), "REMOVE", MB_OK);
- property = GetMsiProperty(handle, TEXT("ALLUSERS"));
+ property = GetMsiProperty(handle, TEXT("ALLUSERS"));
myText = TEXT("ALLUSERS: ") + property;
MessageBox(NULL, myText.c_str(), "ALLUSERS", MB_OK);
-
- return ERROR_SUCCESS;
+
+ 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 daba7fb8c7d7..9ed419b33374 100644
--- a/setup_native/source/win32/customactions/shellextensions/iconcache.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/iconcache.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,12 +42,12 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
{
// Rebuild icon cache on windows OS prior XP
- OSVERSIONINFO osverinfo;
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (
- GetVersionEx( &osverinfo ) &&
+ if (
+ GetVersionEx( &osverinfo ) &&
VER_PLATFORM_WIN32_NT == osverinfo.dwPlatformId &&
(
5 < osverinfo.dwMajorVersion ||
@@ -58,17 +58,17 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
return ERROR_SUCCESS;
}
- HKEY hKey;
- DWORD dwDispostion;
- LONG lError = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop\\WindowMetrics"), 0, NULL, REG_OPTION_VOLATILE, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDispostion );
+ HKEY hKey;
+ DWORD dwDispostion;
+ LONG lError = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Desktop\\WindowMetrics"), 0, NULL, REG_OPTION_VOLATILE, KEY_SET_VALUE | KEY_QUERY_VALUE, NULL, &hKey, &dwDispostion );
if ( ERROR_SUCCESS == lError )
{
- TCHAR szValue[256];
- TCHAR szTempValue[256];
- DWORD cbValue = sizeof(szValue);
- DWORD dwType;
- int iSize = 0;
+ TCHAR szValue[256];
+ TCHAR szTempValue[256];
+ DWORD cbValue = sizeof(szValue);
+ DWORD dwType;
+ int iSize = 0;
lError = RegQueryValueEx( hKey, TEXT("Shell Icon Size"), 0, &dwType, (LPBYTE)szValue, &cbValue );
@@ -86,7 +86,7 @@ extern "C" UINT __stdcall RebuildShellIconCache(MSIHANDLE)
itoa( iSize + 1, szTempValue, 10 );
lError = RegSetValueEx( hKey, TEXT("Shell Icon Size"), 0, dwType, (LPBYTE)szTempValue, strlen( szTempValue ) + 1 );
- LRESULT lResult = SendMessageTimeout(
+ LRESULT lResult = SendMessageTimeout(
HWND_BROADCAST,
WM_SETTINGCHANGE,
SPI_SETNONCLIENTMETRICS,
diff --git a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
index 11c9757ff921..cab23c6483e7 100644
--- a/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/layerlinks.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -136,19 +136,19 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
if (IsValidHandle(h1file))
{
DWORD dummy;
-
+
// Converting string into UTF-8 encoding and writing into file "basis-link"
int nCharsRequired = MultiByteToWideChar( CP_ACP, 0, sBasisInstallPath.c_str(), -1, NULL, 0 );
if ( nCharsRequired )
{
- LPWSTR lpPathW = new WCHAR[nCharsRequired];
+ LPWSTR lpPathW = new WCHAR[nCharsRequired];
if ( MultiByteToWideChar( CP_ACP, 0, sBasisInstallPath.c_str(), -1, lpPathW, nCharsRequired ) )
{
nCharsRequired = WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, NULL, 0, NULL, NULL );
if ( nCharsRequired )
{
- LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
+ LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, lpPathUTF8, nCharsRequired, NULL, NULL );
// WriteFile( h1file, sBasisInstallPath.c_str(), sBasisInstallPath.size() ,&dummy, 0 );
@@ -157,7 +157,7 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
delete lpPathUTF8;
}
}
-
+
delete lpPathW;
}
@@ -184,13 +184,13 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
int nCharsRequired = MultiByteToWideChar( CP_ACP, 0, sUreInstallPath.c_str(), -1, NULL, 0 );
if ( nCharsRequired )
{
- LPWSTR lpPathW = new WCHAR[nCharsRequired];
+ LPWSTR lpPathW = new WCHAR[nCharsRequired];
if ( MultiByteToWideChar( CP_ACP, 0, sUreInstallPath.c_str(), -1, lpPathW, nCharsRequired ) )
{
nCharsRequired = WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, NULL, 0, NULL, NULL );
if ( nCharsRequired )
{
- LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
+ LPSTR lpPathUTF8 = new CHAR[nCharsRequired];
WideCharToMultiByte( CP_UTF8, 0, lpPathW, -1, lpPathUTF8, nCharsRequired, NULL, NULL );
// WriteFile( h2file, sUreInstallPath.c_str(), sUreInstallPath.size() ,&dummy, 0 );
@@ -199,7 +199,7 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
delete lpPathUTF8;
}
}
-
+
delete lpPathW;
}
@@ -216,7 +216,7 @@ extern "C" UINT __stdcall RemoveLayerLinks(MSIHANDLE handle)
string sOfficeInstallPath = sInstallPath;
string sBasisInstallPath = sInstallPath + TEXT("Basis\\");
string sUreInstallPath = sInstallPath + TEXT("URE\\");
-
+
string sBasisLinkPath = sOfficeInstallPath + TEXT("basis-link");
string sUreLinkPath = sBasisInstallPath + TEXT("ure-link");
string sUreDirName = sUreInstallPath + TEXT("bin");
diff --git a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
index a487309c53f2..7ebad71d9abe 100644
--- a/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/migrateinstallpath.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,22 +41,22 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
using namespace std;
-namespace
+namespace
{
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -67,26 +67,26 @@ namespace
result = buffer;
}
- return result;
+ return result;
}
} // namespace
extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
{
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
- std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
- std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
- std::_tstring sUpdateVersion = GetMsiProperty( handle, TEXT("DEFINEDVERSION") );
- std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
+ std::_tstring sManufacturer = GetMsiProperty( handle, TEXT("Manufacturer") );
+ std::_tstring sDefinedName = GetMsiProperty( handle, TEXT("DEFINEDPRODUCT") );
+ std::_tstring sUpdateVersion = GetMsiProperty( handle, TEXT("DEFINEDVERSION") );
+ std::_tstring sUpgradeCode = GetMsiProperty( handle, TEXT("UpgradeCode") );
- std::_tstring sProductKey = "Software\\" + sManufacturer + "\\" + sDefinedName +
+ std::_tstring sProductKey = "Software\\" + sManufacturer + "\\" + sDefinedName +
"\\" + sUpdateVersion + "\\" + sUpgradeCode;
- std::_tstring mystr;
+ std::_tstring mystr;
mystr = "ProductKey: " + sProductKey;
// MessageBox( NULL, mystr.c_str(), "ProductKey", MB_OK );
@@ -95,10 +95,10 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
{
sInstDir = szValue;
- MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
+ MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_CURRENT_USER", MB_OK );
}
-
+
RegCloseKey( hKey );
}
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
@@ -106,7 +106,7 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
{
sInstDir = szValue;
- MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
+ MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstDir.c_str());
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_LOCAL_MACHINE", MB_OK );
}
diff --git a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
index d4ac16aec8a3..4a272a564109 100644
--- a/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/postuninstall.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -41,9 +41,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -52,9 +52,9 @@
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -62,18 +62,18 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
static BOOL ExecuteCommand( LPCTSTR lpCommand, BOOL bSync )
{
- BOOL fSuccess = FALSE;
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
+ BOOL fSuccess = FALSE;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
@@ -105,15 +105,15 @@ static BOOL ExecuteCommand( LPCTSTR lpCommand, BOOL bSync )
extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
{
- TCHAR szValue[8192];
- DWORD nValueSize = sizeof(szValue);
- HKEY hKey;
- std::_tstring sInstDir;
-
- std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
+ TCHAR szValue[8192];
+ DWORD nValueSize = sizeof(szValue);
+ HKEY hKey;
+ std::_tstring sInstDir;
+
+ std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
// MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK );
-
+
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
@@ -133,11 +133,11 @@ extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
else
return ERROR_SUCCESS;
- std::_tstring sInfFile = sInstDir + TEXT("program\\postuninstall.inf");
- std::_tstring sCommand = _T("RUNDLL32.EXE ");
+ std::_tstring sInfFile = sInstDir + TEXT("program\\postuninstall.inf");
+ std::_tstring sCommand = _T("RUNDLL32.EXE ");
// MessageBox( NULL, sInfFile.c_str(), "Titel", MB_OK );
-
+
if ( (LONG)GetVersion() < 0 )
sCommand += _T("setupx.dll");
else
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 9075436e0412..ca43eea65566 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -48,9 +48,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -62,7 +62,7 @@
static std::_tstring createTempFolder()
{
BOOL bExist = FALSE;
- TCHAR szTempName[MAX_PATH];
+ TCHAR szTempName[MAX_PATH];
do
{
bExist = FALSE;
@@ -73,19 +73,19 @@ static std::_tstring createTempFolder()
{
//fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError());
return TEXT("");
- }
+ }
// Create a temporary file.
UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files
- "upg", // temp file name prefix
- 0, // create unique name
- szTempName); // buffer for name
+ "upg", // temp file name prefix
+ 0, // create unique name
+ szTempName); // buffer for name
if (uRetVal == 0)
{
//fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
return TEXT("");
}
//Delete the file
- BOOL bDel = DeleteFile(szTempName);
+ BOOL bDel = DeleteFile(szTempName);
if (FALSE == bDel)
{
//fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
@@ -107,7 +107,7 @@ static std::_tstring createTempFolder()
}
}
} while(bExist);
-
+
std::_tstring cur(szTempName);
//make a file URL from the path
std::_tstring ret(TEXT("file:///"));
@@ -132,7 +132,7 @@ static void deleteTempFolder(const std::_tstring& sTempFolder)
//convert the file URL to a path
const std::_tstring path(sTempFolder.substr(8));
std::_tstring path2;
-// MessageBox(NULL, path.c_str(), "del1", MB_OK);
+// MessageBox(NULL, path.c_str(), "del1", MB_OK);
for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
{
if (*i == '/')
@@ -147,14 +147,14 @@ static void deleteTempFolder(const std::_tstring& sTempFolder)
size_t size = path2.size();
TCHAR * szTemp2 = new TCHAR[size + 2];
ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
- memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
-
+ memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
+
// MessageBox(NULL, szTemp2, "del3", MB_OK);
- SHFILEOPSTRUCT operation =
+ SHFILEOPSTRUCT operation =
{
NULL,
FO_DELETE,
- szTemp2,
+ szTemp2,
NULL,
FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
FALSE,
@@ -189,7 +189,7 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
/* creates a child process which is specified in lpCommand.
out_exitCode is the exit code of the child process
-
+
**/
static BOOL ExecuteCommand( LPCTSTR lpCommand, DWORD * out_exitCode)
@@ -217,10 +217,10 @@ static BOOL ExecuteCommand( LPCTSTR lpCommand, DWORD * out_exitCode)
if ( fSuccess )
{
WaitForSingleObject( pi.hProcess, INFINITE );
-
+
if (!GetExitCodeProcess( pi.hProcess, out_exitCode))
fSuccess = FALSE;
-
+
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
@@ -252,7 +252,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
mystr = "Current short file: " + sFileName;
// MessageBox(NULL, mystr.c_str(), "Current Content", MB_OK);
-
+
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
{
@@ -312,7 +312,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
bDirectoryRemoved = false;
}
}
-
+
return bDirectoryRemoved;
}
@@ -342,12 +342,12 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
+ TEXT(" -env:UserInstallation=") + sTempFolder;
mystr = "Command: " + sCommand;
//MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
-
+
DWORD exitCode = 0;
bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode);
deleteTempFolder(sTempFolder);
-
+
// if ( fSuccess )
// {
// mystr = "Executed successfully!";
@@ -358,7 +358,7 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
// mystr = "An error occured during execution!";
// MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
// }
-
+
FindClose( hFindUnopkg );
}
// else
@@ -382,10 +382,10 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
DWORD nValueSize = sizeof(szValue);
HKEY hKey;
std::_tstring sInstDir;
-
+
std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
//MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK );
-
+
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
@@ -410,7 +410,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
// Removing complete directory "Basis\presets\bundled"
std::_tstring sCacheDir = sInstDir + TEXT("share\\prereg\\bundled");
-
+
bool fSuccess = RemoveCompleteDirectory( sCacheDir );
// if ( fSuccess )
diff --git a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
index f9dfc5cb99bc..616eeff7b7dc 100644
--- a/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/setadmininstall.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
diff --git a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
index c26b0ca0d0c2..502db5e97d49 100644
--- a/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/shellextensions.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -27,51 +27,51 @@
************************************************************************/
/*
- Windows shell extensions need to be approved in order to be used by the
+ Windows shell extensions need to be approved in order to be used by the
Windows shell for clarification read the following section from the
Microsoft Developers Network Library (MSDN) see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_extending/extensionhandlers/shell_ext.asp
-
-
+
+
<MSDN>
- Shell extension handlers run in the Shell process. Because it is a system process,
- the administrator of a Windows NT system can limit Shell extension handlers to
- those on an approved list by setting the EnforceShellExtensionSecurity value of the
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key to 1
+ Shell extension handlers run in the Shell process. Because it is a system process,
+ the administrator of a Windows NT system can limit Shell extension handlers to
+ those on an approved list by setting the EnforceShellExtensionSecurity value of the
+ HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key to 1
(one).
- To place a Shell extension handler on the approved list, create a REG_SZ value whose
- name is the string form of the handler's GUID under
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved.
-
- The Shell does not use the value that is assigned to the GUID, but it should be set to
+ To place a Shell extension handler on the approved list, create a REG_SZ value whose
+ name is the string form of the handler's GUID under
+ HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved.
+
+ The Shell does not use the value that is assigned to the GUID, but it should be set to
make inspecting the registry easier.
- Your setup application can add values to the Approved key only if the person installing
- the application has sufficient privileges. If the attempt to add an extension handler
- fails, you should inform the user that administrative privileges are required to fully
- install the application. If the handler is essential to the application, you should fail
- the setup and notify the user to contact an administrator.
+ Your setup application can add values to the Approved key only if the person installing
+ the application has sufficient privileges. If the attempt to add an extension handler
+ fails, you should inform the user that administrative privileges are required to fully
+ install the application. If the handler is essential to the application, you should fail
+ the setup and notify the user to contact an administrator.
- While there is no need to add values to the Approved key on Windows 95 or Windows 98
- systems, there is no harm in doing so. The system will simply ignore them. However, there
- is no guarantee that the key will exist on these systems. Your setup program must be able
+ While there is no need to add values to the Approved key on Windows 95 or Windows 98
+ systems, there is no harm in doing so. The system will simply ignore them. However, there
+ is no guarantee that the key will exist on these systems. Your setup program must be able
to handle this case.
</MSDN>
-
+
We add the following entries to the respective registry key
"{C52AF81D-F7A0-4AAB-8E87-F80A60CCD396}"="OpenOffice.org Column Handler"
"{087B3AE3-E237-4467-B8DB-5A38AB959AC9}"="OpenOffice.org Infotip Handler"
"{63542C48-9552-494A-84F7-73AA6A7C99C1}"="OpenOffice.org Property Sheet Handler"
"{3B092F0C-7696-40E3-A80F-68D74DA84210}"="OpenOffice.org Thumbnail Viewer"
-
- These shell extensions are implemented in the 'shell' project. We ignore registration
+
+ These shell extensions are implemented in the 'shell' project. We ignore registration
failures because of insufficient privileges. The reason is: On systems which restrict the
use of shell extensions by applying the aforementioned policy probably only people with
sufficient privileges are allowed to install applications anyway. On systems where the
- use of shell extensions is not restricted registration failures because of insufficient
- prviliges have no negative effect because the shell extensions will work anyhow.
+ use of shell extensions is not restricted registration failures because of insufficient
+ prviliges have no negative effect because the shell extensions will work anyhow.
*/
-
+
#ifdef _MSC_VER
#pragma warning(push, 1) /* disable warnings within system headers */
#endif
@@ -116,7 +116,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue )
}
return FALSE;
-}
+}
bool IsVersionNT64( MSIHANDLE hMSI )
{
@@ -149,48 +149,48 @@ extern "C" UINT __stdcall InstallExecSequenceEntry(MSIHANDLE hMSI)
// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and
// extensions\source\activex\main\so_activex.cpp
#ifndef KEY_WOW64_64KEY
- #define KEY_WOW64_64KEY (0x0100)
+ #define KEY_WOW64_64KEY (0x0100)
#endif
if (IsVersionNT64(hMSI))
{
// Open Windows 64 Bit Registry
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE | KEY_WOW64_64KEY, &hKey) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
+ {
+ RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
+ RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
+ RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
+ RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
+
RegCloseKey(hKey);
- }
+ }
// Open Windows 32 Bit Registry on Win64 maschine
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),0, KEY_WRITE, &hKey ) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
+ {
+ RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
+ RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
+ RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
+ RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
+
RegCloseKey(hKey);
- }
+ }
} else
{
if (RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), &hKey) == ERROR_SUCCESS)
- {
- RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
- RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
- RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
- RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
-
+ {
+ RegSetValueEx(hKey, ColumnHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ColumnHandler.Value), _tcslen(ColumnHandler.Value) + 1);
+ RegSetValueEx(hKey, InfotipHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(InfotipHandler.Value), _tcslen(InfotipHandler.Value) + 1);
+ RegSetValueEx(hKey, PropHandler.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(PropHandler.Value), _tcslen(PropHandler.Value) + 1);
+ RegSetValueEx(hKey, ThumbViewer.Key, 0, REG_SZ, reinterpret_cast<const BYTE*>(ThumbViewer.Value), _tcslen(ThumbViewer.Value) + 1);
+
RegCloseKey(hKey);
- }
+ }
}
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
/*
@@ -207,7 +207,7 @@ extern "C" UINT __stdcall DeinstallExecSequenceEntry(MSIHANDLE)
RegDeleteValue(hKey, InfotipHandler.Key);
RegDeleteValue(hKey, PropHandler.Key);
RegDeleteValue(hKey, ThumbViewer.Key);
-
+
RegCloseKey(hKey);
}
return ERROR_SUCCESS;
diff --git a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
index 9c5e6d4eb416..c7bffcdbaf59 100644
--- a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,9 +42,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -52,9 +52,9 @@
std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
- std::_tstring result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ std::_tstring result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if ( MsiGetProperty( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
{
@@ -62,10 +62,10 @@ std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
/*
@@ -74,28 +74,28 @@ std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
*/
extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
{
- std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
+ std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
std::_tstring sDesktopFile = sOfficeMenuFolder + TEXT("Desktop.ini");
-
+
// MessageBox(NULL, sDesktopFile.c_str(), TEXT("OfficeMenuFolder"), MB_OK | MB_ICONINFORMATION);
-
- std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe");
-
- OSVERSIONINFO osverinfo;
+
+ std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe");
+
+ OSVERSIONINFO osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx( &osverinfo );
-
+
if (osverinfo.dwMajorVersion < 6 /* && osverinfo.dwMinorVersion */ )
{
// This icon (18) is a Windows folder until XP Version (number is 0 based)
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("IconFile"),
sIconFile.c_str(),
sDesktopFile.c_str() );
-
+
// FYI: in tool 'ResHack' this icon can be found on position '19' (number is 1 based)
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("IconIndex"),
TEXT("18"),
@@ -106,32 +106,32 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
// // at the moment there exists no Vista Icon, so we use the default folder icon.
// // add the icon into desktop/util/verinfo.rc
// }
-
+
// The value '0' is to avoid a message like "You Are Deleting a System Folder" warning when deleting or moving the folder.
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("ConfirmFileOp"),
TEXT("0"),
sDesktopFile.c_str() );
-
+
/*
- WritePrivateProfileString(
+ WritePrivateProfileString(
TEXT(".ShellClassInfo"),
TEXT("InfoTip"),
TEXT("StarOffice Productivity Suite"),
sDesktopFile.c_str() );
*/
-
+
SetFileAttributes( sDesktopFile.c_str(), FILE_ATTRIBUTE_HIDDEN );
SetFileAttributes( sOfficeMenuFolder.c_str(), FILE_ATTRIBUTE_SYSTEM );
-
-
- return ERROR_SUCCESS;
+
+
+ return ERROR_SUCCESS;
}
extern "C" UINT __stdcall DeinstallStartmenuFolderIcon(MSIHANDLE handle)
{
- std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
+ std::_tstring sOfficeMenuFolder = GetMsiProperty( handle, TEXT("OfficeMenuFolder") );
std::_tstring sDesktopFile = sOfficeMenuFolder + TEXT("Desktop.ini");
SetFileAttributes( sDesktopFile.c_str(), FILE_ATTRIBUTE_NORMAL );
diff --git a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
index 6280bfb5b2e5..2efd60ad868a 100644
--- a/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/upgrade.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -49,82 +49,82 @@
using namespace std;
-namespace
+namespace
{
// The provided GUID must be without surounding '{}'
string GetGuidPart(const string& guid, int index)
{
- assert((guid.length() == 36) && "No GUID or wrong format!");
+ assert((guid.length() == 36) && "No GUID or wrong format!");
assert(((index > -1) && (index < 5)) && "Out of range!");
-
+
if (index == 0) return string(guid.c_str(), 8);
if (index == 1) return string(guid.c_str() + 9, 4);
if (index == 2) return string(guid.c_str() + 14, 4);
if (index == 3) return string(guid.c_str() + 19, 4);
if (index == 4) return string(guid.c_str() + 24, 12);
-
+
return string();
}
-
+
void Swap(char* p1, char* p2)
{
char tmp = *p1;
*p1 = *p2;
*p2 = tmp;
}
-
+
string Invert(const string& str)
{
char* buff = reinterpret_cast<char*>(_alloca(str.length()));
strncpy(buff, str.c_str(), str.length());
-
+
char* front = buff;
char* back = buff + str.length() - 1;
-
- while (front < back)
- Swap(front++, back--);
-
- return string(buff, str.length());
+
+ while (front < back)
+ Swap(front++, back--);
+
+ return string(buff, str.length());
}
-
+
// Convert the upgrade code (which is a GUID) according
// to the way the windows installer does when writing it
// to the registry
- // The first 8 bytes will be inverted, from the the last
+ // The first 8 bytes will be inverted, from the the last
// 8 bytes always the nibbles will be inverted for further
- // details look in the MSDN under compressed registry keys
+ // details look in the MSDN under compressed registry keys
string ConvertGuid(const string& guid)
{
string convertedGuid;
-
+
string part = GetGuidPart(guid, 0);
convertedGuid = Invert(part);
-
+
part = GetGuidPart(guid, 1);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 2);
convertedGuid += Invert(part);
-
+
part = GetGuidPart(guid, 3);
convertedGuid += Invert(string(part.c_str(), 2));
convertedGuid += Invert(string(part.c_str() + 2, 2));
-
- part = GetGuidPart(guid, 4);
+
+ part = GetGuidPart(guid, 4);
int pos = 0;
for (int i = 0; i < 6; i++)
{
convertedGuid += Invert(string(part.c_str() + pos, 2));
- pos += 2;
+ pos += 2;
}
return convertedGuid;
}
-
+
string GetMsiProperty(MSIHANDLE handle, const string& sProperty)
{
- string result;
- TCHAR szDummy[1] = TEXT("");
- DWORD nChars = 0;
+ string result;
+ TCHAR szDummy[1] = TEXT("");
+ DWORD nChars = 0;
if (MsiGetProperty(handle, sProperty.c_str(), szDummy, &nChars) == ERROR_MORE_DATA)
{
@@ -132,13 +132,13 @@ namespace
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(nBytes));
ZeroMemory( buffer, nBytes );
MsiGetProperty(handle, sProperty.c_str(), buffer, &nChars);
- result = buffer;
+ result = buffer;
}
- return result;
+ return result;
}
inline bool IsSetMsiProperty(MSIHANDLE handle, const string& sProperty)
- {
+ {
return (GetMsiProperty(handle, sProperty).length() > 0);
}
@@ -157,51 +157,51 @@ namespace
{
HKEY hKey;
if (RegOpenKey(hRootKey, regKey.c_str(), &hKey) == ERROR_SUCCESS)
- {
+ {
DWORD nSubKeys;
DWORD lLongestSubKey;
-
+
if (RegQueryInfoKey(
hKey, NULL, NULL, NULL, &nSubKeys, &lLongestSubKey, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
LPTSTR buffer = reinterpret_cast<LPTSTR>(_alloca(lLongestSubKey + 1));
-
+
for (DWORD i = 0; i < nSubKeys; i++)
- {
- LONG ret = RegEnumKey(hKey, i, buffer, lLongestSubKey + 1);
- if ((ret == ERROR_SUCCESS) && (buffer == upgradeKey))
+ {
+ LONG ret = RegEnumKey(hKey, i, buffer, lLongestSubKey + 1);
+ if ((ret == ERROR_SUCCESS) && (buffer == upgradeKey))
return true;
}
}
}
return false;
}
-} // namespace
+} // namespace
extern "C" UINT __stdcall SetProductInstallMode(MSIHANDLE handle)
{
- string upgradeCode = GetMsiProperty(handle, TEXT("UpgradeCode"));
+ string upgradeCode = GetMsiProperty(handle, TEXT("UpgradeCode"));
upgradeCode = ConvertGuid(string(upgradeCode.c_str() + 1, upgradeCode.length() - 2));
-
- //MessageBox(NULL, upgradeCode.c_str(), TEXT("Debug"), MB_OK);
-
+
+ //MessageBox(NULL, upgradeCode.c_str(), TEXT("Debug"), MB_OK);
+
if (RegistryKeyHasUpgradeSubKey(
- HKEY_CURRENT_USER,
+ HKEY_CURRENT_USER,
TEXT("Software\\Microsoft\\Installer\\UpgradeCodes"),
upgradeCode) && IsSetMsiProperty(handle, TEXT("ALLUSERS")))
- {
+ {
UnsetMsiProperty(handle, TEXT("ALLUSERS"));
//MessageBox(NULL, "ALLUSERS removed", "DEBUG", MB_OK);
}
else if (RegistryKeyHasUpgradeSubKey(
- HKEY_LOCAL_MACHINE,
+ HKEY_LOCAL_MACHINE,
TEXT("Software\\Classes\\Installer\\UpgradeCodes"),
upgradeCode) && !IsSetMsiProperty(handle, TEXT("ALLUSERS")))
{
SetMsiProperty(handle, TEXT("ALLUSERS"));
//MessageBox(NULL, "ALLUSERS set", "DEBUG", MB_OK);
- }
- return ERROR_SUCCESS;
+ }
+ 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 badd20ae241e..3c8e3483ec30 100644
--- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -43,9 +43,9 @@
#ifdef UNICODE
#define _UNICODE
-#define _tstring wstring
+#define _tstring wstring
#else
-#define _tstring string
+#define _tstring string
#endif
#include <tchar.h>
#include <string>
@@ -116,7 +116,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
mystr = "Current short file: " + sFileName;
// MessageBox(NULL, mystr.c_str(), "Current Content", MB_OK);
-
+
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
{
@@ -176,7 +176,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
bDirectoryRemoved = false;
}
}
-
+
return bDirectoryRemoved;
}
@@ -221,7 +221,7 @@ extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
std::_tstring sRemoveDir = sOfficeInstallPath + TEXT("program_old");
// MessageBox(NULL, sRemoveDir.c_str(), "REMOVING OLD DIR", MB_OK);
-
+
bool bSuccess = RemoveCompleteDirectory( sRemoveDir );
TCHAR sAppend[2] = TEXT("0");