1
votes

We are having the following requirement that needs to be done in Inno Setup. We need to support installation of files based on the password and also automatic update of the next versions either via internet update or DVD

Requirement is:

  1. We have several common files for one application
  2. on top of that, we need to install FeatureA or FeatureB or FeatureC depending upon a password per feature. Like this we are having 20 different features.
  3. The user will install only one feature at a time. But they are allowed to add additional features based on a password.

Above scenario is for running setup from the DVD image. In case of int updates, all the features installed by the customer should automatically be updated without password prompt from the user. It should be done silently.


Example:

PC where our software was not installed earlier. Customer using SWVER001 DVD. Install with Feature1PWD => Basic SW + common files + Feature1 files will be installed

Again install using SWVER001 DVD. This time user gives Feature2PWD ==> Feature2 files will be installed. Basic SW + Commonfiles + Feature1 files will be retained and untouched. Main Sw will see both the Feature 1 and Feature 2

User installs SWVER002 using internet update. Here Setup should see both the Basic SW + Common files + Feature1 files + Feature2 files. It should update all the 4 together at once without any input from the user. Silent update would be very good


I am thinking of the following approach 1. Create one main installer with basic/common installation files 2. Then create sub installer per feature 3. Main setup will then call the sub installer based on the passowrd. 4. Main setup will then store the previous features selected in registry/ini file

In case of int update, get the previous feature selected from registry/ini and then do the silent installation automatically without any user input

Any other better suggestions available for configuring above things in the Inno Setup?

1

1 Answers

1
votes

It's way easier to create a component per feature and automatically select the component according to entered password.

Something like:

[Components]
Name: "FeatureA"; Description: "Feature A"
Name: "FeatureB"; Description: "Feature B"
Name: "FeatureC"; Description: "Feature C"

[Code]

function TestComponentPassword(
  Password: string; Component: string; ComponentPassword: string): Boolean;
var
  I: Integer;
begin
  Result := (Password = ComponentPassword);

  if Result then
  begin
    for I := 0 to WizardForm.ComponentsList.Items.Count - 1 do
    begin
      WizardForm.ComponentsList.Checked[I] :=
        (WizardForm.ComponentsList.Items[I] = Component);
    end;
  end;
end;

function CheckPassword(Password: String): Boolean;
begin
  Result :=
    TestComponentPassword(Password, 'Feature A', 'aaa') or
    TestComponentPassword(Password, 'Feature B', 'bbb') or
    TestComponentPassword(Password, 'Feature C', 'ccc');
end;

In Inno Setup 6, you can use WizardSelectComponents instead of looking up the component by its name.


For update, create a separate installer for each component/feature. Use the same AppId for all installers, so that they share the uninstall log.