Tiny MultiUser.nsh uninstaller bug
Hello!
I dug around here for a while but didn't see any reference to this (tiny) problem, so I'll report it here.
If a user attempts to uninstall an app that was originally installed by an administrator, e.g. for all users, a messagebox is popped up with the text defined in MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE.
However, unlike all other situations where a user does not have sufficient privilege to perform an operation, the macro MULTIUSER_INIT_QUIT is not inserted, and the installer goes on to try and uninstall (in my case requesting a reboot at the end because I had also used /REBOOTOK in the uninstaller section) but without success. The installer should simply quit when it detects the user lacks privilege.
Fixing the problem is as simple as adding the line !insertmacro MULTIUSER_INIT_QUIT "${UNINSTALLER_FUNCPREFIX}" after line 306 in MultiUser.nsh.
In other words:
301 ${if} $MultiUser.Result != ""
302 ${if} $MultiUser.Privileges == "Admin"
303 ${orif} $MultiUser.Privileges == "Power"
304 Call ${UNINSTALLER_FUNCPREFIX}MultiUser.InstallMode.AllUsers
305 ${else}
306 MessageBox MB_OK|MB_ICONSTOP "${MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE}"
307 !insertmacro MULTIUSER_INIT_QUIT "${UNINSTALLER_FUNCPREFIX}"
308 ${endif}
309 ${endif}
Regards!
John