Innosetup - components

I choose the type of installation, server or client.
if you install a server must start the MySQL installation, but such is not a client.
[Types]
Name: "Server"; Description: "Installazione Server"
Name: "Client"; Description: "Installazione Client"

[Components]
Name: "program"; Description: "Program Files"; Types: Server; Flags: fixed
Name: "program"; Description: "Program Files"; Types: Client

[Run]
Filename: "{app}\Installation\mysql.exe";

Open in new window

danz67Asked:
Who is Participating?
 
mirtheilCommented:
Actually the sample I gave should do what you are trying.  But here's another example.  This example includes the Mysql.exe installer in the setup package. It could be modified to run the installer from a different location.

The way the script works is that the mysql.exe installer isn't run unless the "Server" component is selected.
; -- Components.iss --
; Demonstrates a components-based installation.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=userdocs:Inno Setup Examples Output

[Types]
Name: "Server"; Description: "Server installation"
Name: "Client"; Description: "Client installation"

[Components]
Name: "Client"; Description: "Client Files"; Types: Client
Name: "Server"; Description: "Server File"; Types: Server

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Components: Client Server
Source: "mysql.exe"; DestDir: "{app}\installation"; Components: Server

[Run]
Filename: "{app}\installation\mysql.exe"; Components: Server;

Open in new window

0
 
mirtheilCommented:
Using your code as an example:

2:
3:
4:
5:
6:
7:
8:
9:
10:

	

[Types]
Name: "Server"; Description: "Installazione Server"
Name: "Client"; Description: "Installazione Client"

[Components]
Name: "program"; Description: "Program Files"; Types: Server; Flags: fixed
Name: "program"; Description: "Program Files"; Types: Client

[Run]
Filename: "{app}\Installation\mysql.exe"; Components: program;

Open in new window

0
 
mirtheilCommented:
Sorry, I missed that you have the same component name twice.  You should probably change it to something like:

2:
3:
4:
5:
6:
7:
8:
9:
10:

	

[Types]
Name: "Server"; Description: "Installazione Server"
Name: "Client"; Description: "Installazione Client"

[Components]
Name: "program"; Description: "Program Files"; Types: Server; Flags: fixed
Name: "client"; Description: "Program Files"; Types: Client

[Run]
Filename: "{app}\Installation\mysql.exe"; Components: program;

Open in new window

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
danz67Author Commented:
Let me explain better
the user running the setup has two possibilities ...
1. Client
2. server

If you choose 1. This installation package will install only Software.exe

if the user chooses 2. This installation package will install the Software.exe and mysql.exe

can you help me with a code example?
0
 
danz67Author Commented:
Following your advice I created this script, but eventually I get this error and not part of the installation mysql.exe
; Script generated by the Inno Setup Script Wizard.
; SEE THE  DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
AppName=OpenGest PRO VERSIONE 4.9
AppVerName=OpenGest PRO
AppPublisher=OpenGest Software
AppPublisherURL=http://www.opengest.net
AppSupportURL=http://www.opengest.net
AppUpdatesURL=http://www.opengest.net
DefaultDirName=c:\programmi\OpenGest Software
DefaultGroupName=OpenGest Software
DisableProgramGroupPage=yes
LicenseFile=G:\PROGETTO OPENGEST\VERSIONI\Condizioni_vendita.txt
OutputBaseFilename=v49PRO
Compression=lzma
SolidCompression=yes
WindowVisible=yes
WizardImageFile=G:\PROGETTO OPENGEST\Setup\Immagini\WizModernImage-IS.bmp
WizardSmallImageFile=G:\PROGETTO OPENGEST\Setup\Immagini\WizModernSmallImage-IS.bmp

[Languages]
Name: italian; MessagesFile: compiler:Languages\Italian.isl

[Types]
Name: Server; Description: Server installation
Name: Client; Description: Client installation

[Components]
Name: Client; Description: Client Files; Types: Client
Name: Server; Description: Server File; Types: Server

;Name: "readme"; Description: "Readme File"; Types: full
Name: readme\en; Description: Italiano; Flags: exclusive
Name: readme\de; Description: Inglese; Flags: exclusive

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Run]
Filename: {app}\Installation\mysql.exe

;Filename: "{app}\Installation\mysql.exe";
;Filename: "{app}\Upgrade\Opengest_SW_Updater.exe";
Filename: {app}\installation\mysql.exe; Components: Server
Filename: {app}\OpengestPRO.exe; Description: {cm:LaunchProgram,OpenGest}; Flags: nowait postinstall skipifsilent

;[Registry]
;Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Opengest_SW_Updater"; ValueData: """{app}\Opengest_SW_Updater.exe"""; Flags: uninsdeletevalue
[Files]
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\OpenGestPRO.exe; DestDir: {app}; Components: Client Server
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Report\*; DestDir: C:\Programmi\OpenGest Software\Report; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Documenti\*; DestDir: C:\Programmi\OpenGest Software\Documenti; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Scontrini\*; DestDir: C:\Programmi\OpenGest Software\Scontrini; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Icone\*; DestDir: C:\Programmi\OpenGest Software\Icone; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Immagini\*; DestDir: C:\Programmi\OpenGest Software\Immagini; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\upgrade\*; DestDir: C:\Programmi\OpenGest Software\Upgrade; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Last; DestDir: C:\Programmi\OpenGest Software\Last; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Suoni; DestDir: C:\Programmi\OpenGest Software\Suoni; Flags: ignoreversion recursesubdirs createallsubdirs
Source: G:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\Installation\*; DestDir: C:\Programmi\OpenGest Software\Installation; Components: Server
Source: C:\Data\*; DestDir: C:\Data\; Flags: ignoreversion recursesubdirs createallsubdirs
;Source: "F:\PROGETTO OPENGEST\VERSIONI\4842\OpenGest Vittorio\gestionale\*"; DestDir: "C:\Programmi\MySQL\MySQL Server 5.0\data\gestionale"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: {group}\Opengest PRO; Filename: {app}\OpengestPRO.exe
Name: {group}\{cm:UninstallProgram,OpenGest PRO}; Filename: {uninstallexe}
Name: {commondesktop}\Opengest PRO; Filename: {app}\OpengestPRO.exe; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\OpenGest PRO; Filename: {app}\OpengestPRO.exe; Tasks: quicklaunchicon

Open in new window

error.jpg
0
 
mirtheilCommented:
That seems to be a MySQL setup error message.  Can you run the mysql.exe program to install it outside of the InnoSetup program?  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.