native305 #i92977# new Windows INSTALLLOCATION settings
This commit is contained in:
@@ -177,8 +177,8 @@ static BOOL MoveFileExImpl( LPCSTR lpExistingFileNameA, LPCSTR lpNewFileNameA, D
|
||||
|
||||
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
|
||||
{
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("BASISINSTALLLOCATION") );
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("program\\resource\\");
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
|
||||
std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
|
||||
|
||||
WIN32_FIND_DATA aFindFileData;
|
||||
|
@@ -88,7 +88,7 @@ namespace
|
||||
|
||||
extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle)
|
||||
{
|
||||
string sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
string sOfficeInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
|
||||
// MessageBox(NULL, sOfficeInstallPath.c_str(), "DEBUG", MB_OK);
|
||||
|
||||
|
@@ -544,8 +544,7 @@ static std::queue< std::_tstring > getProfileKeys( const std::_tstring& aFileNam
|
||||
extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle )
|
||||
{
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sBasisInstDir = GetMsiProperty( handle, TEXT("BASISINSTALLLOCATION") );
|
||||
std::_tstring sProgramDir = sBasisInstDir + TEXT("program\\");
|
||||
std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
|
||||
std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
|
||||
|
||||
std::queue< std::_tstring > aSectionNames;
|
||||
@@ -605,16 +604,11 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
|
||||
HKEY hKey;
|
||||
|
||||
std::_tstring sInstDir;
|
||||
std::_tstring sBasisInstDir;
|
||||
|
||||
std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
|
||||
|
||||
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("BASISINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sBasisInstDir = szValue;
|
||||
}
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
@@ -623,10 +617,6 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
|
||||
}
|
||||
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("BASISINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sBasisInstDir = szValue;
|
||||
}
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
@@ -636,7 +626,7 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
|
||||
else
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
std::_tstring sProgramDir = sBasisInstDir + TEXT("program\\");
|
||||
std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
|
||||
std::_tstring sPatchFile = sProgramDir + TEXT("patchlist.txt");
|
||||
|
||||
std::queue< std::_tstring > aSectionNames;
|
||||
@@ -689,8 +679,8 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle )
|
||||
|
||||
extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
|
||||
{
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("BASISINSTALLLOCATION") );
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("program\\resource\\");
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
|
||||
std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
|
||||
|
||||
WIN32_FIND_DATA aFindFileData;
|
||||
@@ -733,8 +723,8 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle )
|
||||
|
||||
// 1. Reading Product Code from setup.ini of installed Office
|
||||
|
||||
std::_tstring sInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
// MessageBox(NULL, sInstallPath.c_str(), "BASISINSTALLLOCATION", MB_OK);
|
||||
std::_tstring sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
// MessageBox(NULL, sInstallPath.c_str(), "INSTALLLOCATION", MB_OK);
|
||||
std::_tstring sSetupiniPath = sInstallPath + TEXT("program\\setup.ini");
|
||||
|
||||
TCHAR szProductCode[32767];
|
||||
@@ -869,8 +859,8 @@ extern "C" UINT __stdcall ShowOnlineUpdateDialog( MSIHANDLE handle )
|
||||
// Online Update functionality is always available. Then the dialog
|
||||
// that offers the Online Update is superfluous.
|
||||
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("BASISINSTALLLOCATION") );
|
||||
std::_tstring sProgramDir = sInstDir + TEXT("program\\");
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sProgramDir = sInstDir + TEXT("Basis\\program\\");
|
||||
std::_tstring sSearchFile = sProgramDir + TEXT("updchk.uno.dll");
|
||||
|
||||
WIN32_FIND_DATA data;
|
||||
|
@@ -15,13 +15,13 @@ std::string GetOfficeInstallationPath(MSIHANDLE handle)
|
||||
DWORD sz = 0;
|
||||
LPTSTR dummy = TEXT("");
|
||||
|
||||
if (MsiGetProperty(handle, TEXT("OFFICEINSTALLLOCATION"), dummy, &sz) == ERROR_MORE_DATA)
|
||||
if (MsiGetProperty(handle, TEXT("INSTALLLOCATION"), dummy, &sz) == ERROR_MORE_DATA)
|
||||
{
|
||||
sz++; // space for the final '\0'
|
||||
DWORD nbytes = sz * sizeof(TCHAR);
|
||||
LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
|
||||
ZeroMemory(buff, nbytes);
|
||||
MsiGetProperty(handle, TEXT("OFFICEINSTALLLOCATION"), buff, &sz);
|
||||
MsiGetProperty(handle, TEXT("INSTALLLOCATION"), buff, &sz);
|
||||
progpath = buff;
|
||||
}
|
||||
return progpath;
|
||||
|
@@ -126,13 +126,11 @@ static BOOL rebaseImagesInFolder( MSIHANDLE handle, const std::string& sPath, LP
|
||||
|
||||
static BOOL rebaseImages( MSIHANDLE handle, LPVOID pAddress )
|
||||
{
|
||||
std::string sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
std::string sBasisInstallPath = GetMsiProperty(handle, TEXT("BASISINSTALLLOCATION"));
|
||||
std::string sUreInstallPath = GetMsiProperty(handle, TEXT("UREINSTALLLOCATION"));
|
||||
std::string sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
|
||||
std::string sBasisDir = sBasisInstallPath + TEXT("program\\");
|
||||
std::string sOfficeDir = sOfficeInstallPath + TEXT("program\\");
|
||||
std::string sUreDir = sUreInstallPath + TEXT("bin\\");
|
||||
std::string sBasisDir = sInstallPath + TEXT("Basis\\program\\");
|
||||
std::string sOfficeDir = sInstallPath + TEXT("program\\");
|
||||
std::string sUreDir = sInstallPath + TEXT("URE\\bin\\");
|
||||
|
||||
BOOL bResult = rebaseImagesInFolder( handle, sBasisDir, pAddress );
|
||||
bResult &= rebaseImagesInFolder( handle, sOfficeDir, pAddress );
|
||||
|
@@ -52,7 +52,7 @@ bool IsAllUserInstallation(MSIHANDLE handle)
|
||||
std::wstring GetOfficeInstallationPath(MSIHANDLE handle)
|
||||
{
|
||||
std::wstring progpath;
|
||||
GetMsiProp(handle, TEXT("OFFICEINSTALLLOCATION"), progpath);
|
||||
GetMsiProp(handle, TEXT("INSTALLLOCATION"), progpath);
|
||||
return progpath;
|
||||
}
|
||||
|
||||
|
@@ -170,7 +170,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const wchar_t* pPropName, wchar_t** ppValue )
|
||||
BOOL GetActiveXControlPath( MSIHANDLE hMSI, char** ppActiveXPath )
|
||||
{
|
||||
wchar_t* pProgPath = NULL;
|
||||
if ( GetMsiProp( hMSI, L"OFFICEINSTALLLOCATION", &pProgPath ) && pProgPath )
|
||||
if ( GetMsiProp( hMSI, L"INSTALLLOCATION", &pProgPath ) && pProgPath )
|
||||
{
|
||||
char* pCharProgPath = UnicodeToAnsiString( pProgPath );
|
||||
#ifdef OWN_DEBUG_PRINT
|
||||
|
@@ -184,12 +184,12 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
|
||||
// renaming the vcl resource doesn't work reliable with OS >= Windows Vista
|
||||
if (osverinfo.dwMajorVersion < 6 )
|
||||
{
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("BASISINSTALLLOCATION") );
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
// Property empty -> no office installed
|
||||
if ( sInstDir.length() == 0 )
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("program\\resource\\");
|
||||
std::_tstring sResourceDir = sInstDir + TEXT("Basis\\program\\resource\\");
|
||||
std::_tstring sPattern = sResourceDir + TEXT("vcl*.res");
|
||||
|
||||
// std::_tstring mystr;
|
||||
@@ -233,7 +233,7 @@ extern "C" UINT __stdcall IsOfficeRunning( MSIHANDLE handle )
|
||||
}
|
||||
else
|
||||
{
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
// Property empty -> no office installed
|
||||
if ( sOfficeInstallPath.length() == 0 )
|
||||
return ERROR_SUCCESS;
|
||||
|
@@ -100,7 +100,7 @@ extern "C" UINT __stdcall copyEditionData(MSIHANDLE install) {
|
||||
wchar_t * end;
|
||||
boost::scoped_array<wchar_t> to(
|
||||
getProperty(
|
||||
install, L"OFFICEINSTALLLOCATION",
|
||||
install, L"INSTALLLOCATION",
|
||||
LCL_STRING0(L"program\\edition\0"), &end));
|
||||
if (!to) {
|
||||
return ERROR_INSTALL_FAILURE;
|
||||
|
@@ -93,7 +93,7 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) {
|
||||
bool fSuccess = true;
|
||||
bool bFailIfExist = true;
|
||||
|
||||
std::_tstring sDestDir = GetMsiProperty( handle, TEXT("OFFICEINSTALLLOCATION") );
|
||||
std::_tstring sDestDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sShareInstallDir = sDestDir + TEXT("share\\extension\\install\\");
|
||||
|
||||
// creating directories
|
||||
|
@@ -161,18 +161,6 @@ extern "C" UINT __stdcall ShowProperties(MSIHANDLE handle)
|
||||
string myText = TEXT("INSTALLLOCATION: ") + property;
|
||||
MessageBox(NULL, myText.c_str(), "INSTALLLOCATION", MB_OK);
|
||||
|
||||
property = GetMsiProperty(handle, TEXT("UREINSTALLLOCATION"));
|
||||
myText = TEXT("UREINSTALLLOCATION: ") + property;
|
||||
MessageBox(NULL, myText.c_str(), "UREINSTALLLOCATION", MB_OK);
|
||||
|
||||
property = GetMsiProperty(handle, TEXT("BASISINSTALLLOCATION"));
|
||||
myText = TEXT("BASISINSTALLLOCATION: ") + property;
|
||||
MessageBox(NULL, myText.c_str(), "BASISINSTALLLOCATION", MB_OK);
|
||||
|
||||
property = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
myText = TEXT("OFFICEINSTALLLOCATION: ") + property;
|
||||
MessageBox(NULL, myText.c_str(), "OFFICEINSTALLLOCATION", MB_OK);
|
||||
|
||||
property = GetMsiProperty(handle, TEXT("Installed"));
|
||||
myText = TEXT("Installed: ") + property;
|
||||
MessageBox(NULL, myText.c_str(), "Installed", MB_OK);
|
||||
|
@@ -98,12 +98,14 @@ namespace
|
||||
|
||||
extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
|
||||
{
|
||||
string sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
string sBasisInstallPath = GetMsiProperty(handle, TEXT("BASISINSTALLLOCATION"));
|
||||
string sUreInstallPath = GetMsiProperty(handle, TEXT("UREINSTALLLOCATION"));
|
||||
string sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
|
||||
string sBasisLinkPath = sOfficeInstallPath + TEXT("basis-link");
|
||||
string sUreLinkPath = sBasisInstallPath + TEXT("ure-link");
|
||||
string sOfficeInstallPath = sInstallPath;
|
||||
string sBasisInstallPath = sInstallPath + TEXT("Basis\\");
|
||||
string sUreInstallPath = sInstallPath + TEXT("URE\\");
|
||||
|
||||
string sBasisLinkPath = sInstallPath + TEXT("basis-link");
|
||||
string sUreLinkPath = sInstallPath + TEXT("Basis\\ure-link");
|
||||
|
||||
if ( IsSetMsiProperty(handle, TEXT("ADMININSTALL")) )
|
||||
{
|
||||
@@ -208,9 +210,11 @@ extern "C" UINT __stdcall CreateLayerLinks(MSIHANDLE handle)
|
||||
|
||||
extern "C" UINT __stdcall RemoveLayerLinks(MSIHANDLE handle)
|
||||
{
|
||||
string sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEUNINSTALLLOCATION"));
|
||||
string sBasisInstallPath = GetMsiProperty(handle, TEXT("BASISUNINSTALLLOCATION"));
|
||||
string sUreInstallPath = GetMsiProperty(handle, TEXT("UREUNINSTALLLOCATION"));
|
||||
string sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
|
||||
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");
|
||||
|
@@ -91,27 +91,6 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
|
||||
|
||||
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("OFFICEINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_CURRENT_USER", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("BASISINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("BASISINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_CURRENT_USER", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("UREINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("UREINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_CURRENT_USER", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
@@ -123,27 +102,6 @@ extern "C" UINT __stdcall MigrateInstallPath( MSIHANDLE handle )
|
||||
}
|
||||
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("OFFICEINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_LOCAL_MACHINE", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("BASISINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("BASISINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_LOCAL_MACHINE", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("UREINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
MsiSetProperty(handle, TEXT("UREINSTALLLOCATION"), sInstDir.c_str());
|
||||
// MessageBox( NULL, sInstDir.c_str(), "Found in HKEY_LOCAL_MACHINE", MB_OK );
|
||||
}
|
||||
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
|
@@ -115,7 +115,7 @@ extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
|
||||
|
||||
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ extern "C" UINT __stdcall ExecutePostUninstallScript( MSIHANDLE handle )
|
||||
}
|
||||
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
|
@@ -317,7 +317,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
|
||||
|
||||
extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
|
||||
{
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("OFFICEINSTALLLOCATION") );
|
||||
std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
|
||||
std::_tstring sUnoPkgFile = sInstDir + TEXT("program\\unopkg.exe");
|
||||
std::_tstring sShareInstallDir = sInstDir + TEXT("share\\extension\\install\\");
|
||||
std::_tstring sPattern = sShareInstallDir + TEXT("*.oxt");
|
||||
@@ -415,7 +415,7 @@ extern "C" UINT __stdcall DeregisterExtensions(MSIHANDLE handle)
|
||||
|
||||
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
@@ -423,7 +423,7 @@ extern "C" UINT __stdcall DeregisterExtensions(MSIHANDLE handle)
|
||||
}
|
||||
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
|
||||
|
||||
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
|
||||
}
|
||||
else if ( ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, sProductKey.c_str(), &hKey ) )
|
||||
{
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("OFFICEINSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
if ( ERROR_SUCCESS == RegQueryValueEx( hKey, TEXT("INSTALLLOCATION"), NULL, NULL, (LPBYTE)szValue, &nValueSize ) )
|
||||
{
|
||||
sInstDir = szValue;
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
|
||||
|
||||
// MessageBox(NULL, sDesktopFile.c_str(), TEXT("OfficeMenuFolder"), MB_OK | MB_ICONINFORMATION);
|
||||
|
||||
std::_tstring sIconFile = GetMsiProperty( handle, TEXT("OFFICEINSTALLLOCATION") ) + TEXT("program\\soffice.exe");
|
||||
std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe");
|
||||
|
||||
OSVERSIONINFO osverinfo;
|
||||
osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
@@ -183,12 +183,12 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
|
||||
|
||||
extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
|
||||
{
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
|
||||
std::_tstring sRenameSrc = sOfficeInstallPath + TEXT("program");
|
||||
std::_tstring sRenameDst = sOfficeInstallPath + TEXT("program_old");
|
||||
|
||||
// MessageBox(NULL, sRenameSrc.c_str(), "OFFICEINSTALLLOCATION", MB_OK);
|
||||
// MessageBox(NULL, sRenameSrc.c_str(), "INSTALLLOCATION", MB_OK);
|
||||
|
||||
bool bSuccess = MoveFile( sRenameSrc.c_str(), sRenameDst.c_str() );
|
||||
if ( !bSuccess )
|
||||
@@ -216,7 +216,7 @@ extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle )
|
||||
|
||||
extern "C" UINT __stdcall RemovePrgFolder( MSIHANDLE handle )
|
||||
{
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("OFFICEINSTALLLOCATION"));
|
||||
std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION"));
|
||||
std::_tstring sRemoveDir = sOfficeInstallPath + TEXT("program_old");
|
||||
|
||||
// MessageBox(NULL, sRemoveDir.c_str(), "REMOVING OLD DIR", MB_OK);
|
||||
|
Reference in New Issue
Block a user