Registry update during Uninstall

Got a problem you cannot solve? Try here.
Post Reply
reddragonsa
Posts: 3
Joined: Wed May 25, 2011 5:18 am

Registry update during Uninstall

Post 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
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Registry update during Uninstall

Post 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)
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
reddragonsa
Posts: 3
Joined: Wed May 25, 2011 5:18 am

Re: Registry update during Uninstall

Post 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
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Registry update during Uninstall

Post 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!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
reddragonsa
Posts: 3
Joined: Wed May 25, 2011 5:18 am

Re: Registry update during Uninstall

Post 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]
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Registry update during Uninstall

Post 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.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
kerr
Posts: 1
Joined: Thu Dec 29, 2011 4:27 am

Re: Registry update during Uninstall

Post 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).
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Registry update during Uninstall

Post by giaviv »

Why do you have 2 Apply Uninstalls?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply