installationinno-setupuac

Setup run as administrator requires administrator to uninstall


I have an installer that installs to the local user. It does not need administrator. Now let's say that I have to run the installer as administrator for some reason (right click, Run As Administrator) – This is a very custom case, the software is getting converted from being installed in Program Files (by an MSI file) to being installed in the local user. To remove user disruption, the installer must uninstall the old software during the first update. That requires admin.

The program installs normally, but now in the control panel it needs administrator to uninstall.

The files that it made I can delete normally. Even subsequent updates to the program run without administrator work but I still can't uninstall it without admin privileges.

Is there a workaround for this? Can I prevent it from needing admin to uninstall?

I tried the solution posted to Create an installer with Inno Setup that allows any user to uninstall the application but instead it just says Uninstall or Change an Application needs admin rather than unins000.exe.


Solution

  • Your installer does not need Administrative privileges for itself. It needs it for an external command only (previous version uninstaller).

    Based on that, I'd suggest you run your installer unelevated. And elevate only the command (previous version uninstaller).

    For that, see: