cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
befish
Level 4

Creating a registry entry that persists after uninstall

I have a basic MSI project. I'd like to create a registry key that my installed program will use later, and set permissions to the key so my program can use it without elevation. I want to do it during install so I can avoid elevation issues (as the installer runs elevated). I also do not want the key uninstalled if the user unistalls my program.

1- can I use a scripted method to turn off logging of the key creation in a Basic MSI project?

2- Can I turn off logging of the key creation in the UI?

3- Is there another way I can accomplish this?

Thanks
Labels (1)
0 Kudos
(3) Replies
james_davison
Level 3

I can help with a portion of this. Since Basic MSI follows MSI conventions, you can leave the registry file behind on the installation machine.

Simply click on the component that the registry is installed with and right click on it, go to properties and check the box labeled "Permanent."

As for anything else, custom actions in a MSI are (by my understanding) not logged for uninstall. If you want to ensure that though, you can use the scripting command:

Disable(LOGGING);

and then enabling it after you're finished.
0 Kudos
soorajganga
Level 4

Try making the component which contains the registry as permanent as James mentioned, so that it will not get removed during uninstall.

To set the permissions for the reg keys, try using the lockpermission table. Alternatively you may try setting the permission using a 'cacls' command in a custom action. Set the custom action as deferred.
0 Kudos
Stefan_Krueger
Level 9

You can also right-click the key and select "permissions".
Stefan Krueger
InstallSite.org
0 Kudos