Page 1 of 1

Delete Registry and Apply Install

Posted: Tue Aug 25, 2009 11:56 am
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

Posted: Wed Aug 26, 2009 8:06 am
by DanStutzman
Call the Delete Registry after Apply Install in the MSICode.

Posted: Wed Aug 26, 2009 9:31 am
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.