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

Cannot export registry


3 replies to this topic

baloup

baloup
  • Full Members
  • 4 posts

Posted 30 November 2007 - 10:23

Hi!

I noticed that during an Upgrade (meaning: product already installed, I call a newer version of Setup.exe, installer performs an update - I'm not talking about a patch), all registry that has been changed by the user is being reset to the default-values. Not good.

Knowing that the default registry-keys have not changed (and will not change in the future), I decided to first export the registry hive in OnResumeUIBefore(), let the installer do its work and import the registry in OnResumeUIAfter().

That sounded easy, but I'm stuck now. I can't get InstallScript to export the registry. Here is the part from my code:

CODE

szRegFile = TempFolder ^ "ACWin20Temp.reg";
LongPathToQuote(szRegFile,TRUE);
szProgram = "cmd /c regedit /E:A " + szRegFile + "\"HKEY_LOCAL_MACHINE\\Software\\Siemens\\Babsi\"";
if (LaunchAppAndWait(szProgram,szParam,TRUE) < 0) then
nvExitCode = LAAW_PARAMETERS.nLaunchResult;
SprintfBox(WARNING,"WriteRegistry",
     "Error %d during LaunchAppAndWait(%s,%s)",
     nvExitCode,szProgram,szParam);  
endif;


LaunchAppAndWait reports error 2.

I have tried several variations which also didn't work; with e.g. the next line I get error 123:

CODE

szProgram = WindowsFolder ^ "regedit.exe /E:A " + szRegFile + " \"HKEY_LOCAL_MACHINE\\Software\\Siemens\\Babsi\"";



I have tried with and without enclosing "". It doesn't seem to make any difference.

When I enter the following command directly in a command-shell (or call it in a batch-file), it works:

CODE

c:\winnt\regedit.exe /E:A d:\tmp\ACWin20Temp.reg "HKEY_LOCAL_MACHINE\Software\Siemens\Babsi


To be precise, right now I am calling these lines from OnFirstUIBefore() because that is easier for testing; I will move it to the correct location lateron.

Anyone any idea why this does not work? Any help welcome! Thank you!



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 30 November 2007 - 15:29

Is this a Major Upgrade (which uninstalls the old version first) or a Minor Update (which installs on top of the existing version)?
You can use the System Search view to read registry entries, and use the result in your registry settings.

baloup

baloup
  • Full Members
  • 4 posts

Posted 03 December 2007 - 08:21

It's a Minor Upgrade (installed on top of the old installation).

I just had a look at the SystemSearch (I haven't used it so far). I'm not sure how it could help me. I entered a new SystemSearch, I entered the registry-key in question, but I'm stuck at the last window: it asks me what I would like to do with the value and then comes a listbox with lots of entries starting with "ARPPRODUCTICON". Which entry would help me here? How do I get SystemSearch to keep the registry from before Update?

Thanks again!
Barbara

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 December 2007 - 18:25

This is a list of proeprties that exist in Property Manager. You would add your own custom property to store the information. Then you use this property in the registry view, with the proeprty name in square brackets.