diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-07-08 10:45:40 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-07-08 10:45:40 +0000 |
commit | 3f01a5e9e4ec757eb26cc056a161fb7832ccd5d6 (patch) | |
tree | 63eb975b2c4a0c2f9914c8b19bf222e7a8c34a7c /setup_native | |
parent | 8f33af7faf3191e8ce972af4c1ee37a292a62f61 (diff) |
INTEGRATION: CWS nativefixer12 (1.2.2); FILE MERGED
2005/07/06 08:59:57 is 1.2.2.1: #123800# new custom action for patch and language pack (from nativefixer11)
Diffstat (limited to 'setup_native')
-rw-r--r-- | setup_native/source/win32/customactions/languagepacks/respintest.cxx | 94 |
1 files changed, 84 insertions, 10 deletions
diff --git a/setup_native/source/win32/customactions/languagepacks/respintest.cxx b/setup_native/source/win32/customactions/languagepacks/respintest.cxx index 05d636ffd904..209f0c140c14 100644 --- a/setup_native/source/win32/customactions/languagepacks/respintest.cxx +++ b/setup_native/source/win32/customactions/languagepacks/respintest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: respintest.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2005-07-01 12:19:12 $ + * last change: $Author: obo $ $Date: 2005-07-08 11:45:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -118,31 +118,105 @@ extern "C" UINT __stdcall GetUserInstallMode(MSIHANDLE handle) { string sInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION")); - string sBootstrapPath = sInstallPath + TEXT("program\\setup.ini"); + // MessageBox(NULL, sInstallPath.c_str(), "DEBUG", MB_OK); - // MessageBox(NULL, sBootstrapPath.c_str(), "DEBUG", MB_OK); + UnsetMsiProperty( handle, TEXT("INVALIDDIRECTORY") ); + UnsetMsiProperty( handle, TEXT("ISWRONGPRODUCT") ); + UnsetMsiProperty( handle, TEXT("PATCHISOLDER") ); + UnsetMsiProperty( handle, TEXT("ALLUSERS") ); + + string sSetupiniPath = sInstallPath + TEXT("program\\setup.ini"); TCHAR szValue[32767]; GetPrivateProfileString( TEXT("Bootstrap"), - TEXT("ALLUSERS"), + TEXT("ProductCode"), TEXT("INVALIDDIRECTORY"), szValue, elementsof(szValue), - sBootstrapPath.c_str() + sSetupiniPath.c_str() ); - UnsetMsiProperty( handle, TEXT("INVALIDDIRECTORY") ); - UnsetMsiProperty( handle, TEXT("ALLUSERS") ); - if ( !_tcsicmp( szValue, TEXT("INVALIDDIRECTORY") ) ) { SetMsiProperty( handle, TEXT("INVALIDDIRECTORY"), TEXT("YES") ); // MessageBox(NULL, "INVALIDDIRECTORY set", "DEBUG", MB_OK); + return ERROR_SUCCESS; + } + + string sBootstrapPath = sInstallPath + TEXT("program\\bootstrap.ini"); + + szValue[0] = '\0'; + GetPrivateProfileString( + TEXT("Bootstrap"), + TEXT("buildid"), + TEXT("ISWRONGPRODUCT"), + szValue, + elementsof(szValue), + sBootstrapPath.c_str() + ); + + if ( !_tcsicmp( szValue, TEXT("ISWRONGPRODUCT") ) ) + { + SetMsiProperty( handle, TEXT("ISWRONGPRODUCT"), TEXT("YES") ); + // MessageBox(NULL, "ISWRONGPRODUCT 1 set", "DEBUG", MB_OK); + return ERROR_SUCCESS; } - else if ( szValue[0] ) + + string ProductMajor = GetMsiProperty(handle, TEXT("PRODUCTMAJOR")); + + // Comparing the first three characters, for example "680" + // If not equal, this version is not suited for patch or language pack + + if (_tcsnicmp(ProductMajor.c_str(), szValue, 3)) + { + SetMsiProperty( handle, TEXT("ISWRONGPRODUCT"), TEXT("YES") ); + // MessageBox(NULL, "ISWRONGPRODUCT 2 set", "DEBUG", MB_OK); + return ERROR_SUCCESS; + } + + string isPatch = GetMsiProperty(handle, TEXT("ISPATCH")); + + if (isPatch=="1") + { + string ProductMinor = GetMsiProperty(handle, TEXT("PRODUCTMINOR")); + int PatchProductMinor = atoi(ProductMinor.c_str()); + + szValue[0] = '\0'; + + GetPrivateProfileString( + TEXT("Bootstrap"), + TEXT("ProductMinor"), + TEXT("106"), + szValue, + elementsof(szValue), + sBootstrapPath.c_str() + ); + + int InstalledProductMinor = atoi(szValue); + + if ( InstalledProductMinor >= PatchProductMinor ) + { + SetMsiProperty( handle, TEXT("PATCHISOLDER"), TEXT("YES") ); + // MessageBox(NULL, "PATCHISOLDER set", "DEBUG", MB_OK); + return ERROR_SUCCESS; + } + } + + szValue[0] = '\0'; + + GetPrivateProfileString( + TEXT("Bootstrap"), + TEXT("ALLUSERS"), + TEXT(""), + szValue, + elementsof(szValue), + sSetupiniPath.c_str() + ); + + if ( szValue[0] ) { SetMsiProperty( handle, TEXT("ALLUSERS"), szValue ); // MessageBox(NULL, "ALLUSERS set", "DEBUG", MB_OK); |