3

I created a installer with custom wizard pages. All works fine so far. Next I wanted to create a settings file using /SAVEINF (to start the installer later on in silent mode) using the following command:

Installer.exe /SAVEINF="Unattended.txt"

After entering all user input and running the installer, I looked at the file created. The only user input I see is the installation location but missing all my input on the custom wizard pages. All I see is:

[Setup]
Lang=en
Dir=C:\temp
Group=MyProgram
NoIcons=0
Tasks=

Why? What do I need to do to have the custom wizard page values also in the settings file?


To be more specific.
I start the installer I've created with option to create a settings file using the /SAVEINF option on the commandline. I expected all items to be added to this file including the one from my custom wizard pages, but that's not the case. I only see the installation location from the standard setup page.

Of course I can add them manually and implement in the installer code to read them from the file, but I expected it to be automated.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Jammer
  • 45
  • 4
  • 2
    Possible duplicate of [Inno Setup Load defaults for custom installation settings from a file (.inf) for silent installation](https://stackoverflow.com/questions/38624032/inno-setup-load-defaults-for-custom-installation-settings-from-a-file-inf-for) – Martin Prikryl Jun 02 '17 at 08:51
  • Do I have to do it all by myself for all custom wizardpages I'vve created? I expected INNOSetup to create the file automatically when using the SAVEINFO option. – Jammer Jun 06 '17 at 06:21
  • No it won't do it for you. I cannot even imagine this to be possible. How could it know, how to serialize your data? – Martin Prikryl Jun 06 '17 at 06:27

1 Answers1

1

Indeed, Inno Setup won't save any custom fields to the .inf file.

It will never save anything to the .inf file beyond the standard Lang, Dir, Group, NoIcons, SetupType, Components and Tasks items.

See SaveInf function in Inno Setup source code:

procedure SaveInf(const FileName: String);
const
  Section = 'Setup';
begin
  SetIniString(Section, 'Lang',
    PSetupLanguageEntry(Entries[seLanguage][ActiveLanguage]).Name, FileName);
  SetIniString(Section, 'Dir', WizardDirValue, FileName);
  SetIniString(Section, 'Group', WizardGroupValue, FileName);
  SetIniBool(Section, 'NoIcons', WizardNoIcons, FileName);
  if WizardSetupType <> nil then begin
    SetIniString(Section, 'SetupType', WizardSetupType.Name, FileName);
    SetIniString(Section, 'Components', StringsToCommaString(WizardComponents), FileName);
  end
  else begin
    DeleteIniEntry(Section, 'SetupType', FileName);
    DeleteIniEntry(Section, 'Components', FileName);
  end;
  SetIniString(Section, 'Tasks', StringsToCommaString(WizardTasks), FileName);
end;

There are more items Inno Setup will load from the .inf file. See the LoadInf function. But again, not custom fields/pages. Just options that can otherwise be specified using command-line switches, like Silent, VerySilent, NoRestart, etc.


If you want custom fields in the .inf file, you have to implement them on your own:
Inno Setup Load defaults for custom installation settings from a file (.inf) for silent installation.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992