Default components for silent installation with Inno Setup
<p>I'm developing an installation file in Inno setup.
It has 3 different optional components to install when user selects 'custom'.</p>

<p>It works fine, but when <code>/SILENT</code> parameter is passed, no component is installed. I suppose because no component is checked.</p>

<p>...here is the code fragment related:</p>

<pre><code>[Types]
Name: custom; Description: {cm:instCustom}; Flags: iscustom
Name: full; Description: {cm:instFull}

[Components]
Name: Programador; Description: {cm:cmpProgramador}; Types: full
Name: Usuario; Description: {cm:cmpUsuario}; Types: full
Name: Reporte; Description: {cm:cmpReporte}; Types: full

[Icons]
Name: {group}\{cm:cmpProgramador}; Filename: {app}\Programador\{#MyAppExeNameA}; Components: Programador
Name: {group}\{cm:cmpUsuario}; Filename: {app}\Usuario\{#MyAppExeNameB}; Components: Usuario
Name: {group}\{cm:cmpReporte}; Filename: {app}\Reporte\{#MyAppExeNameC}; Components: Reporte
Name: {group}\Desinstalar MIVES; Filename: {uninstallexe}

[Registry]
Root: HKCU; Subkey: Software\UPC; Flags: uninsdeletekey
Root: HKCU; Subkey: Software\UPC\MIVES
Root: HKLM; Subkey: Software\UPC; Flags: uninsdeletekey
Root: HKLM; Subkey: Software\UPC\MIVES
Root: HKLM; Subkey: Software\UPC\MIVES\Settings; ValueType: string; ValueName: InstallPath; ValueData: {app}

; file association depens of the components selected
Root: HKCR; Subkey: .mip; ValueType: string; ValueData: mip_auto_file; Flags: uninsdeletekey; Components: Programador
Root: HKCR; Subkey: mip_auto_file; Flags: uninsdeletekey; Components: Programador
Root: HKCR; Subkey: mip_auto_file\shell\open\command; ValueType: expandsz; ValueData: {app}\Programador\{#MyAppExeNameA} %1; Components: Programador

Root: HKCR; Subkey: .miu; ValueType: string; ValueData: miu_auto_file; Flags: uninsdeletekey; Components: Usuario
Root: HKCR; Subkey: miu_auto_file; Flags: uninsdeletekey; Components: Usuario
Root: HKCR; Subkey: miu_auto_file\shell\open\command; ValueType: expandsz; ValueData: {app}\Usuario\{#MyAppExeNameB} %1; Components: Usuario

Root: HKCR; Subkey: .mir; ValueType: string; ValueData: mir_auto_file; Flags: uninsdeletekey; Components: Reporte
Root: HKCR; Subkey: mir_auto_file; Flags: uninsdeletekey; Components: Reporte
Root: HKCR; Subkey: mir_auto_file\shell\open\command; ValueType: expandsz; ValueData: {app}\Reporte\{#MyAppExeNameC} %1; Components: Reporte

[Files]
Source: {#MyAppExeNameA}; DestDir: {app}\Programador; Flags: promptifolder; Components: Programador
Source: {#MyAppExeNameB}; DestDir: {app}\Usuario; Flags: promptifolder; Components: Usuario
Source: {#MyAppExeNameC}; DestDir: {app}\Reporte; Flags: promptifolder; Components: Reporte
</code></pre>

<p>I need that one of the three components (component 'Usuario') was installed by default when the <code>/silent</code> or <code>/verysilent</code> parameter is passed.</p>

<p>I think I have to use <code>Check: WizardSilent</code>, but I don't know where. In fact, I tried adding the <code>WizardSilent</code> in <code>Components</code> section, but nothing happens:</p>

<pre><code>[Components]
Name: Programador; Description: {cm:cmpProgramador}; Types: full
Name: Usuario; Description: {cm:cmpUsuario}; Types: full; Check: WizardSilent
</code></pre>

<p>Neither in the <code>Files</code> section:</p>

<pre><code>[Files]
Source: {#MyAppExeNameB}; DestDir: {app}\Usuario; Flags: promptifolder; Components: Usuario; Check: WizardSilent
</code></pre>

<p>Here is what I need: </p>

<ul>
<li><code>MIVES_211.exe /SP- /verysilent</code>  >>>  installs "Usuario" component by default (silent mode, and no <code>/components</code> parameter)</li>
<li><code>MIVES_211.exe /SP- /silent /components=Reporte</code>  >>>  installs only "Reporte" component (silent mode, and <code>components</code> parameter)</li>
<li><code>MIVES_211.exe /SP- /silent /components=Usuario,Reporte</code>  >>>  installs "Usuario" and "Reporte" components (silent mode, and <code>components</code> parameter)</li>
</ul>

<p><strong><em>EDITED:</em></strong>
I think I've found one solution, but I don't know if it is a good solution. Just added one new type including the <code>WizardSilent</code> check:</p>

<pre><code>[Types]
Name: silent; Description: {cm:instCustom}; Check: WizardSilent
Name: custom; Description: {cm:instCustom}; Flags: iscustom
Name: full; Description: {cm:instFull}
</code></pre>

<p>And use it in the components section, component "Usuario" (the component I want to install by default in a silent installation):</p>

<pre><code>[Components]
Name: Programador; Description: {cm:cmpProgramador}; Types: full
Name: Usuario; Description: {cm:cmpUsuario}; Types: full silent
Name: Reporte; Description: {cm:cmpReporte}; Types: full
</code></pre>

<p>Now, it works really as I want. But I don't like to have two types with the same description, unless only one is showed in the setup wizard.</p>

<p>Is it a good idea?</p>

<p>Thanks!</p>