Page 1 of 1

Registry update during Uninstall

Posted: Wed May 25, 2011 5:29 am
by reddragonsa
Hi Guys

I need to change a reg enrty during uninstall. So the entry should not be deleted.

The entry is changed during installation, but when I run the uninstall... it deletes the entry. Even if I make the entry permenent and write the change to the value of the entry during uninstall... the entry does not chagne.

Any help will be welcome.

Thanx
Red

Re: Registry update during Uninstall

Posted: Wed May 25, 2011 9:35 am
by giaviv
Dear Red,

A workaround I can think of is create/modify that entry AFTER the Apply Uninstall command.
Make sure you set the NATIVE_ENGINE to TRUE before doing so, otherwise nothing will happen.

So you are looking at:

Apply Uninstall
Set Variable NATIVE_ENGINE to TRUE
Write Registry Key .....
Set Variable NATIVE_ENGINE to FALSE (optional)

Re: Registry update during Uninstall

Posted: Wed May 25, 2011 12:55 pm
by reddragonsa
Hi gaiviv

Thank you so much... funny thing is... I did do that, but I did not know about the native_engine.

Cheers
Red

Re: Registry update during Uninstall

Posted: Wed May 25, 2011 1:36 pm
by giaviv
No problem :)

Keep in mind that when not using the Native Engine, commands are cached and only executed when an Apply Changes command (like Apply Install or Apply Uninstall) is called.
Refer to the Apply Changes help file for more info on that. Good luck!

Re: Registry update during Uninstall

Posted: Thu May 26, 2011 12:59 am
by reddragonsa
Hi

OK.. I tried it but the regsistry entry is still deleted. :|

here is the uninstall code:


[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
if Variable WHATPROGRAM Equals BOTH
Apply Uninstall (get result into variable SUCCESS)
Set Variable NATIVE_ENGINE to TRUE
Write Registry Key HKLM\SOFTWARE\ROBERTS7\ROBERTS7\CFG\WHATPROGRAM, PC
Set Variable NATIVE_ENGINE to FALSE
Set Variable PROGRESS to 100
else
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
end
else
<<Code Folding Region>>
[DEFINE REGION: Perform First Time or Maintenance Installation]

Re: Registry update during Uninstall

Posted: Thu May 26, 2011 6:40 am
by giaviv
Hi,

You want to write to the registry AFTER the Apply Uninstall. Try that and let me know if it worked for you.

Re: Registry update during Uninstall

Posted: Thu Dec 29, 2011 4:36 am
by kerr
What if NATIVE_ENGINE is set to TRUE at the very beginning of the project? Where should I put the Write Registry command then?
Because I tried it before Apply Uninstall, after Apply Uninstall, in between of 2 "Apply Uninstall"s, surrounded by "Set Variable NATIVE_ENGINE to TRUE/FALSE" commands, not surrounded by them, with "Permanent" checked, without "Permanent" checked... And I've run out of ideas. I just don't understand something important here.

(I'm sure that the key name is valid, because I succeeded in writing it on install, but that's the uninstall I'm interested in, so it doesn't matter and just means I've got the key name right).

Re: Registry update during Uninstall

Posted: Mon Jan 02, 2012 4:31 pm
by giaviv
Why do you have 2 Apply Uninstalls?