tags:

views:

32

answers:

1

Using InnoSetup I want to prompt a user if they wish to install an additional piece of software - think of it as a plug-in. My issue is that the additional software package I wish to install is broken up into two MSI files. I want to only prompt the user once to install the package but have each file in the [Run] section check the same value. How do I go about doing this?

[Code]
function InstallSomething:Boolean;
begin
   if (MsgBox('Do you want to install something?', mbInformation, mb_YesNo) = idYes) then
      Result:=True
   else
      Result:=False;
end;

[Run]
Filename: {sd}\Software\MyAppA.msi; Check: InstallSomething;
Filename: {sd}\Software\MyAppB.msi; Check: InstallSomething;

So the user should only get the message once but each file should install if true or skip if false.

A: 

Can you not store the result of your function call in a boolean variable and use that boolean value in your [Run] section?

It seems that this is possible after reading the following documentation: http://www.jrsoftware.org/ishelp/index.php?topic=scriptcheck

Bernard