On Sunday, August 20, 2023, 17:40:40, 'Paul Gardiner' via innosetup wrote:
I have an installer for an app that can install either for the current user or for all users. I wish to make an installer for an add on to the app. The add on installer needs raised privileges only if the main app was installed for all users. I can't see how to automate that choice in the add on installer. I can set PrivilegesRequiredOverridesAllowed to dialog so that the end user can decide, but that's expecting knowledge they may not have. Is there a nice way to do this?
Have a look at what I did with the GIMP Help installer: https://gitlab.gnome.org/GNOME/gimp-help/-/blob/master/build/windows/installer/gimp-help.iss
What I did is to have the installer run in multiple phases – when run without parameters, it looks in Registry for per-user and all users GIMP installs, and shows a page where you can select where to install the Help add-on to, then depending on your choice it restarts the installer with /SILENT and /CURRENTUSER or /ALLUSERS parameters.
On Wednesday, August 23, 2023, 14:48:59, 'Paul Gardiner' via innosetup wrote:
Jernej, for the phased method to work, the actuall install part of Phase 1 has to be aborted. I see your script sometime returns 'Abort' from PrepareToInstall and sometimes calls Abort() in CurStepChanged. When I do either of those an error message is shown. What am I missing?
IIRC, PrepareToInstall returns 'Abort' when running in interactive mode, then CurPageChanged modifies the wpPreparing page to replace the error message with a pseudo-finished page; in silent mode, Abort is called from CurStepChanged(ssInstall), where it should silently exit the setup.