On Tuesday, October 15, 2024, 12:50:14, Franz Leu wrote:
How would I best do this?
There's no built-in way in Inno to do this. I needed something similar when creating an installer for GIMP help files – since GIMP can be installed both per-user, or per-machine, the help installer needed a way to install help files in both locations if necessary. I solved this by having the installer run itself multiple times, making use of PrivilegesRequiredOverridesAllowed=commandline – you can look at what exactly the install script does here.
We have an installer that so far runs in Admin mode. We now have a request that updates can be installed without Admin credentials.If not already present (we detect), we also install "vc redist" and a driver needed.That said, for the first install, we need to have Admin mode due to the drivers. Subsequent updates/installs may run in non-Admin if the correct destination had been selected by the first install.
procedure CurStepChanged(CurStep: TSetupStep);
Changed the setup to PrivilegesRequired=lowest. Now trying to detect if driver/VC needs to be installed or are already there with functions that were already in the script and used with check in the file section.However, nothing kicks in and still asks for language and more just to then crashes when it tries to start copying.Any idea what I am doing wrong?Section where it seems to crashprocedure CurStepChanged(CurStep: TSetupStep);
var
mres : integer;
begin
case CurStep of
ssInstall:
begin
if (VCRedistNeedsInstall or IsSIESingleThreadAPINeedsInstall) then
begin
if MsgBox(ExpandConstant('{cm:ConfirmAdminCredentialsAvailable'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO then
begin
MsgBox(ExpandConstant('{cm:CloseMissingAdmin'), mbError, MB_OK);
Abort;
end;
end;
.....
On Tuesday, October 22, 2024, 15:19:47, 'Bill Stewart' via innosetup wrote:
I would also point out that MsgBox can be problematic if the user requests a silent install. If you really need to use MsgBox, I would recommend using it only when WizardSilent returns false.
Or use SuppressibleMsgBox.