0
votes

The situation is thus: We create an installer with Inno Setup. The software will be installed by an admin (e.g. when the computer is set up before it is given to the user), but we want normal users to be able to uninstall / update the installation (without admin rights). Adjusting permissions on installed files and running icacls.exe after the installation to grant rights for all users to access the uninstaller executable have gotten me almost to the goal.

The only thing missing is that if the administrator installs the program, it is not visible in Control Panel -> Uninstall a Program - list of other users. The (nonadmin) user has to know where to find the uninst000.exe and run it.

How can I make an Inno Setup install script so that any user (with or without admin rights) can uninstall the program via the Control Panel?

1
The documentation for PrivilegesRequired (jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequired) states that "When set to lowest ... the uninstall info root key will always be HKEY_CURRENT_USER" I'm not certain, but I interpret this meaning that if PrivilegesRequired=lowest, then the uninstall via Control Panel -> Programs is only visible for the user who installed the application?Antti Karanta
That's correct. So what do you set the PrivilegesRequired to?Martin Prikryl
PrivilegesRequired=lowest and with installed files permissions: everyone-full admins-full Likely expliicitly giving admins full rights is not necessary after everyone-fullAntti Karanta

1 Answers

0
votes

You can use PrivilegesRequired=none.

It's similar to PrivilegesRequired=lowest, except that it will try to write the non-user areas. This among other means that it will write the uninstall key to HKLM.

Note that none value is not officially documented anymore:


Another option is that you create the uninstall key in HKLM yourself. Use {uninstallexe} constant to resolve a path to the installer.


Though this will only add the uninstaller key to HKLM. But the uninstaller will still require administrator privileges, as long as the installer was run with administrator privileges. This is built-into the uninstaller and is not configurable in anyway.

This makes sense, as otherwise the uninstaller cannot remove its uninstaller key from HKLM.

Anyway, if you really need to hack it, you can remove a flag from uninsxxx.dat that indicates the installer was run with administrator privileges.