Inno Setup: Install only if not VERYSILENT

2019-07-16 11:17发布

问题:

I would like to install and regsiter a certain file only if the setup is not run as VERYSILENT.

I don't know how I could achieve this.

My current line is

Source: "M:\sqlite36_engine.dll"; DestDir: {sys}; Flags: uninsneveruninstall ignoreversion

Can somebody tell me how this can be done?

Thank you!

回答1:

Since there is still no runtime function or variable to determine if the setup is running in very silent mode, you need to make your own function to check this by iterating command line parameters. For conditional installing of a certain file we're using the Check parameter, which can take such function for getting the condition by its returned value. The following script should do what you want:

[Files]
Source: "M:\sqlite36_engine.dll"; DestDir: {sys}; Flags: uninsneveruninstall ignoreversion; Check: not IsVerySilent

[Code]
function IsVerySilent: Boolean;
var
  I: Integer;
begin
  Result := False;
  for I := 1 to ParamCount do
    if CompareText(ParamStr(I), '/verysilent') = 0 then
    begin
      Result := True;
      Exit;
    end; 
end;


标签: inno-setup