Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

About UPGRADINGPRODUCTCODE property.


6 replies to this topic

BrightIdeal

BrightIdeal
  • Members
  • 20 posts

Posted 25 November 2003 - 07:33

My question is how to set the property UPGRADINGPRODUCTCODE to prevent some registry or folders being deleted during major upgrade.
Have anybody used this propert?

Thanks.



Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 November 2003 - 07:39

This property should be set anytime the RemoveExistingProducts action is run and the setup will perform a major upgrade of the existing installation.

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.
Regards
-Stein Åsmul

BrightIdeal

BrightIdeal
  • Members
  • 20 posts

Posted 25 November 2003 - 08:12

Thanks a lot.
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?

Thanks again.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

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.

BrightIdeal

BrightIdeal
  • Members
  • 20 posts

Posted 25 November 2003 - 15:21

If the property can not be set,what else can I do to prevent the registry and folders being deleted?

Thanks.


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 November 2003 - 21:35

I am afraid it is impossible to answer this without some more information. How are these registry entries installed in the first place? Are they inserted through scripting or part of components in your setup?

You can also preserve registry settings by exporting a reg file during installation, just insert this code in a custom action:

CODE
///////////////////////////////////////////////////////////////////////////////
//                                                                          
//  Function:   ExportHKCUSettings
//                                                                          
//  Purpose:    Export all HKCU settings to the "My Documents"
//              folder.
//
///////////////////////////////////////////////////////////////////////////////

function ExportHKCUSettings( )  
STRING szRegeditPath, szRegeditExportPath, szRegeditExportFile;
NUMBER nResult, nBuffer, lOccurrences;
STRING szTimeString, szDateString, szTimeAndDateString;
begin
   
   szRegeditPath = WindowsFolder ^ "regedit.exe";
   szRegeditExportPath = "HKEY_CURRENT_USER\\Software\\Company\\Application\\Version";
       
GetSystemInfo(DATE, nResult,szDateString);
GetSystemInfo(TIME, nResult,szTimeString);

// Construct time / date dependent string
szTimeAndDateString = szDateString + "_" + szTimeString;
       _StrReplace ( szTimeAndDateString, ":" , ".", lOccurrences, MAX_STRING );
   
   szRegeditExportFile = "\"" + PersonalFolder + "RegistryBackup_" + szTimeAndDateString + ".reg" + "\"";
   
   try
      nResult = LaunchAppAndWait (szRegeditPath,"/e " + szRegeditExportFile + " " + szRegeditExportPath, WAIT);
    catch
      Err.Clear();
   endcatch;

end;

Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 November 2003 - 21:38

I forgot to mention that this code has not been tested on Win9x systems. It also uses the _StrReplace function available for download here (Replace a String in a String): http://www.installsi.../en/isp_str.htm
Regards
-Stein Åsmul