cheran
cheran

Reputation: 483

Run sub-installer (very) silently when the master installer is running (very) silently

I have an Inno Script isntaller runs child setup.exe in it. I have to give silent install parameter to the setup.exe, when silent install parameter was given to the master installer.

Inno Script run command:

[Run]
Filename: "setup.exe"; Parameters:"/Install silent"; Flags: nowait

I gave silent installation parameter in command prompt as follows,

"setup location" /VERYSILENT /Install silent

The master Inno Setup installer is running silently, but the child setup.exe launched with UI.

How to get silent install parameter from command prompt in Inno Setup script file? Please help me to resolve this.

Upvotes: 5

Views: 6951

Answers (3)

Martin Prikryl
Martin Prikryl

Reputation: 202474

There's no /Install silent parameter in Inno Setup.

There's /silent and /verysilent. The /silent still displays the installation progress window, while the /verysilent does not.

See Setup Command Line Parameters in Inno Setup documentation:

/SILENT, /VERYSILENT

Instructs Setup to be silent or very silent. When Setup is silent the wizard and the background window are not displayed but the installation progress window is. When a setup is very silent this installation progress window is not displayed. Everything else is normal so for example error messages during installation are displayed and the startup prompt is (if you haven't disabled it with DisableStartupPrompt or the '/SP-' command line option explained above).

If a restart is necessary and the '/NORESTART' command isn't used (see below) and Setup is silent, it will display a Reboot now? message box. If it's very silent it will reboot without asking.


So you have to run the sub-installer with the /verysilent flag to avoid any GUI.

[Run]
Filename: "setup.exe"; Parameters: "/verysilent"; Flags: nowait

Though, if you want to run the sub-installer silently, only if the parent installer is running silently, you can do it like:

[Run]
Filename: "setup.exe"; Parameters: "{code:SilentParameter}"; Flags: nowait

[Code]

function WizardVerySilent: Boolean;
var
  i: Integer;
begin
  Result := False;
  for i := 1 to ParamCount do
    if CompareText(ParamStr(i), '/verysilent') = 0 then
    begin
      Result := True;
      Break;
    end;
end; 

function SilentParameter(Param: string): string;
begin
  if WizardSilent then
  begin
    if WizardVerySilent then
      Result := '/verysilent'
    else
      Result := '/silent';
  end;
end;

The code for distinguishing silent and very silent installations was inspired by How to detect whether the setup runs in very silent mode? The WizardSilent is a standard function.

Upvotes: 2

Garg Mankush
Garg Mankush

Reputation: 59

We tried the same code for silently installation with inno setup

[Run]
Filename: "{app}\{#MyAppExeName}"; Parameters:/VERYSILENT; Flags: nowait

But still getting options to select destination folder and desktop icons

Upvotes: -1

I_General_I
I_General_I

Reputation: 13

I tried this and it works total silent:

[Run]
Filename: "path\setup.exe"; Parameters:/VERYSILENT; Flags: nowait

without "" in Parameter

Hope this will help

Upvotes: 0

Related Questions