summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-04-01 16:57:00 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-04-01 16:57:00 +0000
commitd3acfc2cd140bb78fe53f09db63e0ff25506345d (patch)
tree9b3f1f5cbd53e188fe521bfc19792678e532674b /setup_native
parent7cc6b791ea3574fd3f0052f129a760af91067a45 (diff)
CWS-TOOLING: integrate CWS vistainstall_DEV300
2009-03-24 11:33:59 +0100 dv r269931 : #i100470# Enhanced running office check to ignore missing program folder, etc. 2009-03-24 11:07:25 +0100 dv r269922 : #i100500# Environment flag WITH_VC_REDIST got lost
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/source/win32/customactions/shellextensions/checkpatches.cxx1
-rwxr-xr-xsetup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx28
-rw-r--r--setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx4
3 files changed, 30 insertions, 3 deletions
diff --git a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
index 4541aca7e9ef..8490b1d5682e 100644
--- a/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkpatches.cxx
@@ -53,6 +53,7 @@
#include <string>
#include <queue>
#include <stdio.h>
+#include <strsafe.h>
#include <systools/win32/uwinapi.h>
diff --git a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
index 63f5e8cc521f..1fe1d2335b88 100755
--- a/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/checkrunningoffice.cxx
@@ -242,7 +242,7 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
return ERROR_SUCCESS;
std::_tstring sRenameSrc = sOfficeInstallPath + TEXT("program");
- std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_1");
+ std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_test");
bool bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
@@ -252,6 +252,32 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
}
else
{
+ DWORD dwError = GetLastError();
+ LPVOID lpMsgBuf;
+ // When there is no program folder, there could be no running office
+ if ( dwError == ERROR_FILE_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 |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL ))
+ {
+ OutputDebugStringFormat( TEXT("Error Code %d: %s"), dwError, lpMsgBuf );
+ LocalFree( lpMsgBuf );
+ }
+ 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/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
index 016103812bec..5b5d649ea334 100644
--- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx
@@ -189,7 +189,7 @@ extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
std::_tstring sRenameSrc = sOfficeInstallPath + TEXT("program");
- std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_1");
+ std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_old");
// MessageBox(NULL, sRenameSrc.c_str(), "OFFICEINSTALLLOCATION", MB_OK);
@@ -208,7 +208,7 @@ extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
{
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
- std::_tstring sRemoveDir = sOfficeInstallPath + TEXT("program_1");
+ std::_tstring sRemoveDir = sOfficeInstallPath + TEXT("program_old");
// MessageBox(NULL, sRemoveDir.c_str(), "REMOVING OLD DIR", MB_OK);