diff options
Diffstat (limited to 'setup_native/source/win32/customactions/patch/swappatchfiles.cxx')
-rw-r--r-- | setup_native/source/win32/customactions/patch/swappatchfiles.cxx | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx index 2ef10553e239..db7fbeb3e5fc 100644 --- a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx +++ b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx @@ -285,18 +285,6 @@ static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFi if (hdl == INVALID_HANDLE_VALUE) { fSuccess = MoveFileExImpl( sFileName2.c_str(), sFileName1.c_str(), MOVEFILE_REPLACE_EXISTING ); - - // if ( fSuccess ) - // { - // mystr = "Success"; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); - // } - // else - // { - // char buff[256]; - // wsprintf(buff, "Failure %d", GetLastError()); - // MessageBox( NULL, buff, "Titel", MB_OK ); - // } } else { @@ -554,17 +542,11 @@ extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle ) OutputDebugStringA( "Starting Custom Action" ); - // std::_tstring mystr; - // mystr = "Patchfile: " + sPatchFile; - // MessageBox( NULL, mystr.c_str(), "Patchfile", MB_OK ); - aSectionNames = getProfileSections( sPatchFile ); while ( !aSectionNames.empty() ) { std::_tstring sSectionName = aSectionNames.front(); if ( std::_tstring(TEXT("_root")) == sSectionName ) { sSectionName = TEXT(""); } - // mystr = "Section: " + sSectionName; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); aKeyNames = getProfileKeys( sPatchFile, sSectionName ); while ( !aKeyNames.empty() ) @@ -584,9 +566,6 @@ extern "C" UINT __stdcall InstallPatchedFiles( MSIHANDLE handle ) sFileName1 = sInstDir + sSectionName + sFileName1; sFileName2 = sFileName1 + sExtension; - // mystr = "Convert: " + sFileName1 + " to " + sFileName2; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); - SwapFiles( sFileName1, sFileName2 ); } @@ -634,17 +613,11 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle ) std::queue< std::_tstring > aSectionNames; std::queue< std::_tstring > aKeyNames; - // std::_tstring mystr; - // mystr = "Patchfile: " + sPatchFile; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); - aSectionNames = getProfileSections( sPatchFile ); while ( !aSectionNames.empty() ) { std::_tstring sSectionName = aSectionNames.front(); if ( std::_tstring(TEXT("_root")) == sSectionName ) { sSectionName = TEXT(""); } - // mystr = "Section: " + sSectionName; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); aKeyNames = getProfileKeys( sPatchFile, sSectionName ); while( !aKeyNames.empty() ) @@ -664,9 +637,6 @@ extern "C" UINT __stdcall UninstallPatchedFiles( MSIHANDLE handle ) sFileName1 = sInstDir + sSectionName + sFileName1; sFileName2 = sFileName1 + sExtension; - // mystr = "Convert: " + sFileName1 + " to " + sFileName2; - // MessageBox( NULL, mystr.c_str(), "Titel", MB_OK ); - SwapFiles( sFileName2, sFileName1 ); } @@ -726,7 +696,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) // 1. Reading Product Code from setup.ini of installed Office 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]; @@ -743,7 +712,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) if ( !_tcsicmp( szProductCode, TEXT("NOTFOUND") ) ) { // No setup.ini or no "ProductCode" in setup.ini. This is an invalid directory. - // MessageBox(NULL, "NOTFOUND set", "DEBUG", MB_OK); return ERROR_SUCCESS; } @@ -752,7 +720,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) std::_tstring productCode = TEXT(szProductCode); productCode = ConvertGuid(std::_tstring(productCode.c_str() + 1, productCode.length() - 2)); mystr = TEXT("Changed product code: ") + productCode; - // MessageBox(NULL, mystr.c_str(), "ProductCode", MB_OK); // 3. Setting path in the Windows registry to find installed features @@ -764,14 +731,12 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) registryRoot = HKEY_LOCAL_MACHINE; registryKey = TEXT("Software\\Classes\\Installer\\Features\\") + productCode; mystr = registryKey; - // MessageBox( NULL, mystr.c_str(), "ALLUSERS", MB_OK ); } else { registryRoot = HKEY_CURRENT_USER; registryKey = TEXT("Software\\Microsoft\\Installer\\Features\\") + productCode; mystr = registryKey; - // MessageBox( NULL, mystr.c_str(), "ALLUSERS", MB_OK ); } // 4. Collecting all installed features from Windows registry @@ -780,7 +745,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) if (RegOpenKey(registryRoot, registryKey.c_str(), &hKey) == ERROR_SUCCESS) { int counter = 0; - // DWORD counter = 0; LONG lEnumResult; do @@ -798,11 +762,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) std::_tstring sValueName = szValueName; std::_tstring sValueData = szValueData; - // mystr = sValueName; - // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK ); - // mystr = sValueData; - // MessageBox( NULL, mystr.c_str(), "ValueData", MB_OK ); - // Does this feature exist in this patch? if ( IsSetMsiProperty(handle, sValueName) ) { @@ -810,14 +769,10 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) if ( 6 == szValueData[0] ) { MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_ABSENT); // do not install this feature - // mystr = TEXT("Do NOT install: ") + sValueName; - // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK ); } else { MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_LOCAL); // do install this feature - // mystr = TEXT("Do install: ") + sValueName; - // MessageBox( NULL, mystr.c_str(), "ValueName", MB_OK ); } } } @@ -842,14 +797,10 @@ extern "C" UINT __stdcall SetNewFeatureState( MSIHANDLE handle ) if (IsSetMsiProperty(handle, TEXT("SELECT_OU_FEATURE"))) { MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_LOCAL); // do install this feature - // mystr = TEXT("OnlineUpdate wird installiert!"); - // MessageBox(NULL, mystr.c_str(), "INSTALLSTATE_LOCAL", MB_OK); } else { MsiSetFeatureState(handle,sValueName.c_str(),INSTALLSTATE_ABSENT); // do not install this feature - // mystr = TEXT("OnlineUpdate wird NICHT installiert!"); - // MessageBox(NULL, mystr.c_str(), "INSTALLSTATE_ABSENT", MB_OK); } return ERROR_SUCCESS; @@ -869,10 +820,6 @@ extern "C" UINT __stdcall ShowOnlineUpdateDialog( MSIHANDLE handle ) HANDLE hdl = FindFirstFile(sSearchFile.c_str(), &data); if (hdl != INVALID_HANDLE_VALUE) // the file exists { - // std::_tstring mystr; - // mystr = "Found file: " + sSearchFile; - // MessageBox( NULL, mystr.c_str(), "Found file", MB_OK ); - // And finally setting property SHOW_ONLINEUPDATE_DIALOG // to hide this dialog UnsetMsiProperty(handle, TEXT("SHOW_ONLINEUPDATE_DIALOG")); @@ -886,10 +833,6 @@ extern "C" UINT __stdcall ShowOnlineUpdateDialog( MSIHANDLE handle ) } else { - // std::_tstring mystr; - // mystr = "Did not find file: " + sSearchFile; - // MessageBox( NULL, mystr.c_str(), "File not found", MB_OK ); - // If the file does not exist, the Online Update dialog // has to be shown. SetMsiProperty(handle, TEXT("SHOW_ONLINEUPDATE_DIALOG")); |