About UPGRADINGPRODUCTCODE property.
Posted 25 November 2003 - 07:33
Have anybody used this propert?
Posted 25 November 2003 - 07:39
There is a special Installshield specific property you can use to detect a major update. It is called: IS_MAJOR_UPGRADE. This property should do the trick for you.
The problem you are having with UPGRADINGPRODUCTCODE is probably either that you misspelled it (properties are case sensitive), or that you are using the property before it is set by the RemoveExistingProducts action.
Posted 25 November 2003 - 08:12
But I have never used this property when I develop a major upgrade.
I only want to know how to set the property to prevent the old folders,registry being deleted during major upgade.
And where can I get some example?
Posted 25 November 2003 - 10:20
|QUOTE (BrightIdeal @ 2003-11-25 08:12)|
|I only want to know how to set the property to prevent the old folders,registry being deleted during major upgade.|
You don't set this property. Windows Installer automatically sets it for you.
Posted 25 November 2003 - 15:21
Posted 25 November 2003 - 21:35
You can also preserve registry settings by exporting a reg file during installation, just insert this code in a custom action:
// Function: ExportHKCUSettings
// Purpose: Export all HKCU settings to the "My Documents"
function ExportHKCUSettings( )
STRING szRegeditPath, szRegeditExportPath, szRegeditExportFile;
NUMBER nResult, nBuffer, lOccurrences;
STRING szTimeString, szDateString, szTimeAndDateString;
szRegeditPath = WindowsFolder ^ "regedit.exe";
szRegeditExportPath = "HKEY_CURRENT_USER\\Software\\Company\\Application\\Version";
// Construct time / date dependent string
szTimeAndDateString = szDateString + "_" + szTimeString;
_StrReplace ( szTimeAndDateString, ":" , ".", lOccurrences, MAX_STRING );
szRegeditExportFile = "\"" + PersonalFolder + "RegistryBackup_" + szTimeAndDateString + ".reg" + "\"";
nResult = LaunchAppAndWait (szRegeditPath,"/e " + szRegeditExportFile + " " + szRegeditExportPath, WAIT);