Delete Registry and Apply Install

Got a problem you cannot solve? Try here.
Post Reply
GregS
Posts: 15
Joined: Thu May 07, 2009 4:21 pm

Delete Registry and Apply Install

Post by GregS »

As I understand it, the WRITE REGISTRY command is applied only when you call APPLY INSTALL, but DELETE REGISTRY is applied immediately. Is there any way to tell DELETE REGISTRY to not run until APPLY INSTALL is called?

I'm asking because we have to rename a registry key in our product upgrade, which I am doing by writing the new key and then deleting the old one. (If there's a better way please let me know). So DELETE REGISTRY should run and succeed under the same conditions that WRITE REGISTRY runs and succeeds. I can probably achieve this by using various "success" variables but obviously it would be simpler if I could make DELETE REGISTRY dependent upon APPLY INSTALL.

Thanks.
GregS
DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Post by DanStutzman »

Call the Delete Registry after Apply Install in the MSICode.
GregS
Posts: 15
Joined: Thu May 07, 2009 4:21 pm

Post by GregS »

The problem with calling Delete Registry after calling Apply Install is that Delete Registry will run even if the installation fails. I don't want it to run unless installation succeeds because I can't delete the old registry key if the new replacement one didn't get created.

Anyway, I solved it by using a variable to track if installation succeeded or not, and I'm calling Delete Registry only if the installation was a success. So the issue is closed for me.
Post Reply