Select Component exclusively ( InnoSetup ) - inno-setup

Two Components are displayed well with below code.
If I select 'Server' component, then 'Client' component should be unchecked.
If I select 'Client' component, then 'Server' component should be unchecked.
Can you let me know how I can do that?
[Files]
Source: "C:\MAEK\bin\MAEK\*.exe"; DestDir: "{app}\bin\"; Flags: ignoreversion ; Components: Server
Source: "C:\MAEK\bin\MAEK\*.exe"; DestDir: "{app}\bin\"; Flags: ignoreversion ; Components: Client
[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "Server"; Description: "Server"; Types: custom;
Name: "Client"; Description: "Client"; Types: custom;

Only 1 component to choose??
[Components]
Name: "Server"; Description: "Server"; Types: custom; Flags: exclusive
Name: "Client"; Description: "Client"; Types: custom; Flags: exclusive
If more:
[Components]
Name: "Mode"; Description: "Installation Mode"; Types: custom; Flags: fixed
Name: "Mode\Server"; Description: "Server"; Types: custom; Flags: exclusive
Name: "Mode\Client"; Description: "Client"; Types: custom; Flags: exclusive

Related

Prechecked or unchecked components in Inno Setup custom install

I only need 1 custom installation type with 3 components :
The first is needed, so checked and readonly.
The second is optional but part of the default, so checked and writable.
The third is just optional, so unchecked and writable.
If I don't specify a type explicitly, I don't manage to have components checked by default.
If I specify one, I don't manage to have the last component unchecked as default.
I tried with 2 types but, it has no meaning as it's only one custom installation.
Any idea how to get the expected behavior with a single type?
[Types]
Name: "standard"; Description: "Standard installation";
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "first"; Description: "First Component"; Types: standard custom; Flags: fixed
Name: "second"; Description: "Second Component"; Types: standard custom;
Name: "third"; Description: "Third Component"; Types: custom;
This should do:
[Types]
Name: "custom"; Description: "Dummy custom installation"; Flags: iscustom
[Components]
Name: "first"; Description: "First Fixed Component"; Types: custom; Flags: fixed
Name: "second"; Description: "Second Checked Component"; Types: custom
Name: "third"; Description: "Third Unchecked Component"

Inno Setup - How to localize component and type names?

How to localize component and type names? For example:
[Languages]
Name: "eng"; MessagesFile: "Idiomas\English.isl"
Name: "spa"; MessagesFile: "Idiomas\Spanish.isl"
If I choose English:
[Types]
Name: "full"; Description: "Full installation"
Name: "compact"; Description: "Compact installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "program"; Description: "Program Files"; Types: full compact custom; \
Flags: fixed
Name: "readme"; Description: "Readme File"; Types: full
or if I choose Spanish:
[Types]
Name: "full"; Description: "Instalación Completa"
Name: "compact"; Description: "Instalación Mínima"
Name: "custom"; Description: "Instalación Personalizada"; Flags: iscustom
[Components]
Name: "program"; Description: "Archivos de Programa"; Types: full compact custom; \
Flags: fixed
Name: "readme"; Description: "Archivo de Ayuda"; Types: full
Define custom messages in the language files:
idiomas\English.isl:
[CustomMessages]
FullInstallation=Full installation
CompactInstallation=Compact installation
CustomInstallation=Custom installation
ProgramFilesComponent=Program Files
ReadmeFileComponent=Readme File
idiomas\Spanish.isl:
[CustomMessages]
FullInstallation=Instalación Completa
CompactInstallation=Instalación Mínima
CustomInstallation=Instalación Personalizada
ProgramFilesComponent=Archivos de Programa
ReadmeFileComponent=Archivo de Ayuda
or you can use the [CustomMessages] section in the main .iss file:
[CustomMessages]
eng.FullInstallation=Full installation
spa.FullInstallation=Instalación Completa
...
And then use these custom messages using the {cm:MessageName} constant in your script:
[Types]
Name: "full"; Description: "{cm:FullInstallation}"
Name: "compact"; Description: "{cm:CompactInstallation}"
Name: "custom"; Description: "{cm:CustomInstallation}"; Flags: iscustom
[Components]
Name: "program"; Description: "{cm:ProgramFilesComponent}"; \
Types: full compact custom; Flags: fixed
Name: "readme"; Description: "{cm:ReadmeFileComponent}"; \
Types: full

Default components for silent installation with Inno Setup

I'm developing an installation file in Inno setup.
It has 3 different optional components to install when user selects 'custom'.
It works fine, but when /SILENT parameter is passed, no component is installed. I suppose because no component is checked.
...here is the code fragment related:
[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
I need that one of the three components (component 'Usuario') was installed by default when the /silent or /verysilent parameter is passed.
I think I have to use Check: WizardSilent, but I don't know where. In fact, I tried adding the WizardSilent in Components section, but nothing happens:
[Components]
Name: Programador; Description: {cm:cmpProgramador}; Types: full
Name: Usuario; Description: {cm:cmpUsuario}; Types: full; Check: WizardSilent
Neither in the Files section:
[Files]
Source: {#MyAppExeNameB}; DestDir: {app}\Usuario; Flags: promptifolder; Components: Usuario; Check: WizardSilent
Here is what I need:
MIVES_211.exe /SP- /verysilent >>> installs "Usuario" component by default (silent mode, and no /components parameter)
MIVES_211.exe /SP- /silent /components=Reporte >>> installs only "Reporte" component (silent mode, and components parameter)
MIVES_211.exe /SP- /silent /components=Usuario,Reporte >>> installs "Usuario" and "Reporte" components (silent mode, and components parameter)
EDITED:
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 WizardSilent check:
[Types]
Name: silent; Description: {cm:instCustom}; Check: WizardSilent
Name: custom; Description: {cm:instCustom}; Flags: iscustom
Name: full; Description: {cm:instFull}
And use it in the components section, component "Usuario" (the component I want to install by default in a silent installation):
[Components]
Name: Programador; Description: {cm:cmpProgramador}; Types: full
Name: Usuario; Description: {cm:cmpUsuario}; Types: full silent
Name: Reporte; Description: {cm:cmpReporte}; Types: full
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.
Is it a good idea?
Thanks!
I believe your setup is conceptually wrong.
The silent installation should install whatever the typical/default/common installation is. Now it looks like the default installation is the "Full" installation, but you want the silent installation to behave differently. That does not seem right.
So you should have a default "Typical" installation type, with the "Usuario" component. Just like you have the "Silent" type now. But the "Typical" type will make sense even in an interactive installation.
[Types]
Name: typical; Description: "Typical"
Name: full; Description: "Full"
Name: custom; Description: "Custom"; Flags: iscustom
[Components]
Name: Programador; Description: "Programador"; Types: full
Name: Usuario; Description: "Usuario"; Types: full typical
Name: Reporte; Description: "Reporte"; Types: full
And anyway, the /SILENT should always be accompanied with /LOADINF or at least /COMPONENTS or /TYPE.
Your solution with "silent" type, while a hack, will work somewhat, because the Check: WizardSilent will hide this type in the interactive installation.
Btw, note that with mere /SILENT, when upgrading, the installer will use components selected in the previous (possibly interactive) installation.

Tasks section - added 2 tasks, but always install

I'm trying to add 2 more optional components in [tasks] section, but they both install even if they aren't selected. Here is what i'm using:
[Types]
Name: "custom"; Description: "Custom installation"; Flags:iscustom
[Components]
Name: "A"; Description: {#DescriptionA};Types:custom;
Name: "B"; Description: {#DescriptionB};Types:custom;
Name: "B"; Description: {#DescriptionC};Types:custom;
Name: "D"; Description: {#DescriptionD};Types:custom;
Name: "E"; Description: {#DescriptionE};Types:custom;
[Tasks]
Name:'F'; Description: {#DescriptionF};
Name:'G'; Description: {#DescriptionG};
[Files]
Source: {#SourceA}; Components: A; DestDir: {#FinalDestination}; Flags: onlyifdoesntexist;
Source: {#SourceB}; Components: B; DestDir: {#FinalDestination}; Flags: onlyifdoesntexist;
Source: {#SourceC}; Components: C; DestDir: {#FinalDestination}; Flags: onlyifdoesntexist;
Source: {#SourceD}; Components: D; DestDir: {#Destination}; Flags: onlyifdoesntexist;
Source: {#SourceE}; Components: E; DestDir: {#Destination}; Flags:
onlyifdoesntexist;
Source: {#SourceF}; DestDir: {#Destination}; Flags: onlyifdoesntexist;
Source: {#SourceG}; DestDir: {#Destination}; Flags: onlyifdoesntexist;
What am I doing wrong? Thanks
If u want to conditionally install files then You have to add task/components parameter with the files to work according to the checkbox checked or unchecked.Without parameter(Tasks: '*' or Components: '*') Files will install every time.
So here is the correct script that will conditionally install files according to components and tasks checkboxs:
[Types]
Name: custom; Description: Custom installation; Flags: iscustom
[Components]
Name: A; Description: {#DescriptionA}; Types: custom
Name: B; Description: {#DescriptionB}; Types: custom
Name: C; Description: {#DescriptionC}; Types: custom
Name: D; Description: {#DescriptionD}; Types: custom
Name: E; Description: {#DescriptionE}; Types: custom
[Tasks]
Name: 'F'; Description: {#DescriptionF}
Name: 'G'; Description: {#DescriptionG}
[Files]
Source: "{#SourceA}"; DestDir: "{#FinalDestination}"; Flags: onlyifdoesntexist; Components: A
Source: "{#SourceB}"; DestDir: "{#FinalDestination}"; Flags: onlyifdoesntexist; Components: B
Source: "{#SourceC}"; DestDir: "{#FinalDestination}"; Flags: onlyifdoesntexist; Components: C
Source: "{#SourceD}"; DestDir: "{#Destination}"; Flags: onlyifdoesntexist; Components: D
Source: "{#SourceE}"; DestDir: "{#Destination}"; Flags: onlyifdoesntexist:; Components: E
Source: "{#SourceF}"; DestDir: "{#Destination}"; Flags: onlyifdoesntexist; Tasks: 'F'
Source: "{#SourceG}"; DestDir: "{#Destination}"; Flags: onlyifdoesntexist; Tasks: 'G'

Inno Setup - Correct use of [Types], [Components] and [Tasks]

I am writing a script that requires users to choose which parts of the application to install:
Application only, DataBase Engine only, Data only, or any combination of these.
I know I should be using the [Components] section to define these, but I am getting confused by the interplay between Types, Components and Tasks - for one, I thought [Tasks] was for "extra" installations, but then I saw code that links explicitly the three.
Can anyone point me to a good explanation of how these work together? - I am sure there is one...
Thanks
Components are made of one or more Types. In the script you'll use the Components as selector depending on the Type chosen by the end user. Components can be used in the Tasks because depending on the Types chosen by the user a Task will have or not to be executed.
For example:
; 'Types': What get displayed during the setup
[Types]
Name: "full"; Description: "Full installation";
Name: "app"; Description: "Fapplication only";
Name: "dbengine"; Description: "Database engine only";
Name: "data"; Description: "Data only";
; Components are used inside the script and can be composed of a set of 'Types'
[Components]
Name: "full"; Description: "Full installation"; Types: full app dbengine app
Name: "app"; Description: "Fapplication only"; Types: app
Name: "dbengine"; Description: "Database engine only";Types: dbengine
Name: "data"; Description: "Data only"; Types: data
; Defines which files are setup, based on the differents components
[Files]
Source: "MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: full app
Source: "ADll.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: full app
Source: "Engine.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: full dbengine
Source: "data_0"; DestDir: "{app}"; Flags: ignoreversion; Components: full data
Source: "data_1"; DestDir: "{app}"; Flags: ignoreversion; Components: full data
; In the same fashion, a task can be set for a specific component
[Tasks]
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Components: full app
My understanding is that a Component is a basically a set of files - it constitutes a major 'component' of what can be installed. A 'type' of installation is a selection of components that it makes sense to install together. Here's the way I would code #az01 's example.
; Lists types of installations - the user is presented
; with a list containing these Descriptions:
[Types]
Name: "full"; Description: "Full installation";
Name: "app-only"; Description: "Application only";
Name: "engine-only"; Description: "Database engine only";
Name: "data-only"; Description: "Data only";
; This lists the installable components of the product and
; specifies which type of install they are included in
[Components]
Name: "app"; Description: "Application"; Types: full app-only
Name: "engine"; Description: "Database engine"; Types: full engine-only
Name: "data"; Description: "Data"; Types: full data-only
; each file is assigned to one component, unless it is shared between
; components, in which case maybe it should go in a 'shared' component.
[Files]
Source: "MyApp.exe"; DestDir: "{app}"; Flags:; Components: app
Source: "ADll.dll"; DestDir: "{app}"; Flags:; Components: app
Source: "Engine.dll"; DestDir: "{app}"; Flags:; Components: engine
Source: "data_0"; DestDir: "{app}"; Flags: ignoreversion; Components: data
Source: "data_1"; DestDir: "{app}"; Flags: ignoreversion; Components: data
A complete explanation can be found on Innosetup help page :
Components and Tasks Parameters
and [Components] section
I give you below a generic sample :
[Components]
Name: a; Description: a
Name: b; Description: b
[Tasks]
Name: p; Description: a or b; Components: a or b
Name: q; Description: a and b; Components: a and b
Name: r; Description: not a or b; Components: not a or b
Name: s; Description: not (a or b); Components: not (a or b)
Name: t; Description: a or b - old style; Components: a b

Resources