Tasks section - added 2 tasks, but always install - inno-setup

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'

Related

Inno setup script doesn't run accessruntime after installing .net

I have some troubles with the installer script
I want to install my app and it needs .net 4.5 to be installed on the host. Also it needs AccessRuntime2007.
I have some troubles because the Accessruntime will not install using the script.
Maybe something wrong with the sequence? who can help me?
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "JazzNotes"
#define MyAppVersion "1.0"
#define MyAppPublisher "EMDEE TECH"
#define MyAppURL "www.jazznotes.com"
#define MyAppExeName "JazzNotes.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2F4E8FD6-6151-45A1-A421-8CA123E312CF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\license.txt
OutputDir=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\inno output
OutputBaseFilename=Install Jazznotes
SetupIconFile=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\icons\Itzikgur-My-Seven-Music-Piano-Chello.ico
Compression=lzma
SolidCompression=yes
[Types]
Name: "full"; Description: "Full installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "program"; Description: "Program Files"; Types: full custom; Flags: fixed
Name: "help"; Description: "Help File"; Types: full
Name: "Net"; Description: ".NET 4.5 Framework"; Types: full
Name: "Acrobat" ; Description: "Acrobat Reader 8"; Types: full
Name: "Access" ; Description: "Access runtime files"; Types: full
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "dependencies\AccessRuntime.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework2; Components: Access
Source: "dependencies\AdbeRdr11010_en_US.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework3; Components: Acrobat
Source: "dependencies\dotnetfx45_full_x86_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework; Check: FrameworkIsNotInstalled ;Components: Net
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\JazzNotes.exe"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\AxInterop.AcroPDFLib.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\AxInterop.WMPLib.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\Interop.AcroPDFLib.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\Interop.WMPLib.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\JazzNotes.exe.config"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\UltraID3Lib.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.VisualBasic.Compatibility.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Deployment.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Design.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.XML.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\stdole.dll"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPE.TTF"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEB.TTF"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEBO.TTF"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEO.TTF"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\jingle.wav"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\musica.accdb"; DestDir: "{app}"; Flags: ignoreversion ; Components: program
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Code]
function FrameworkIsNotInstalled: Boolean;
begin
Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.5');
end;
procedure InstallFramework;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing .NET framework...';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\dotnetfx45_full_x86_x64.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// you can interact with the user that the installation failed
MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
procedure InstallFramework2;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing Access Runtime files...';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\AccessRuntime.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// you can interact with the user that the installation failed
MsgBox('Access Runtime installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
procedure InstallFramework3;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := 'Installing Acrobar Reader';
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\AdbeRdr11010_en_US.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
// you can interact with the user that the installation failed
MsgBox('Acrobat installation failed with code: ' + IntToStr(ResultCode) + '.',
mbError, MB_OK);
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
end;
end;
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Thanks Martin ! Your advise in removing the /q helped! Turns out that the accessruntime.exe does not allow the /noreboot....i changed it to /norestart... and it worked!

Select Component exclusively ( InnoSetup )

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

Keep getting compiler error period ('.') expected - Inno Setup

Have never used Inno Setup before and with the help of people on stack overflow have managed to figure out most of it. However I have rewritten this setup many times as I keep getting a period ('.') expected and hilited line is end:
If I change the semi colon to a period the compile will run with erratic results.
For example in a basic setup which is working if I add the following to my Pascal Code section after the procedure InitializeWizard(); I get the error
var
teula : string;
PrintButton : TButton;
Page : TWizardPage;
SStatic : TNewStaticText;
begin
teula := 'Click next to accept the EULA (click button at right)';
PrintButton := TButton.Create(page);
PrintButton.Caption := 'Toolbar EULA';
PrintButton.Left :=355;
PrintButton.Width :=150;
PrintButton.Top :=286;
PrintButton.onClick := #PrintButtonClick;
PrintButton.Parent := WizardForm;
SStatic := TNewStaticText.Create(Page);
SStatic.Left :=10;
SStatic.Top :=290;
SStatic.Width :=200;
SStatic.Parent := WizardForm;
SStatic.Caption := teula;
end;
This is the entire listing.
; ///////////////////////////////////////////////////////////
; // Graphical Installer for Inno Setup //
; // Version v3.3.01 (Katka) //
; // Copyright (c) 2011 - 2013 unSigned Softworks //
; // www.unsigned-softworks.sk www.graphical-installer.com //
; // info#unsigned-softworks.sk //
; // All rights reserved. //
; ///////////////////////////////////////////////////////////
; *********************************************
; * Main script file. *
; *********************************************
; Script generated with Graphical Installer Wizard.
; This identifier is used for compiling script as Graphical Installer powered installer. Comment it out for regular compiling.
#define GRAPHICAL_INSTALLER_PROJECT
#ifdef GRAPHICAL_INSTALLER_PROJECT
; File with setting for graphical interface
#include "gkhptry5.graphics.iss"
#else
; Default UI file
#define public GraphicalInstallerUI ""
#endif
[Setup]
AppName=Grahams Karaoke Home Player
AppVersion=2.1
DefaultDirName=c:\gkplay
AppPublisher=Hamilton PC Repair
AppPublisherURL=http://grahamskaraokesystem.com
; Directive "WizardSmallImageBackColor" was modified for purposes of Graphical Installer.
WizardSmallImageBackColor={#GraphicalInstallerUI}
WindowVisible=True
BackColor=$00FF6633
BackSolid=True
UsePreviousAppDir=False
DisableDirPage=yes
UsePreviousGroup=False
[Files]
Source: "C:\gkplay\redist\filesrequiringregistration.txt"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\gdiplus.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MFC71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.lic"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\MoviePlayer.ocx"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\msvcp71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\msvcr71.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\reregister64.bat"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_conv2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_core2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_format2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_multi2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\vid_trans2.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscomaudio.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommediafile.dll"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\redist\viscommem.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgadec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscommpgdec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomoverlay.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomqtde.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsec.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsilencedetection.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomsplitter.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\viscomwmvp.dll"; DestDir: "{app}\redist"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\redist\wmfdist.exe"; DestDir: "{app}\redist"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister64.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\reregister.bat"; DestDir: "{app}\comctl"; Flags: ignoreversion; Components: player
Source: "C:\gkplay\comctl\mscomctl.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\MSCOMCT2.OCX"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay\comctl\comctl32.ocx"; DestDir: "{app}\comctl"; Flags: ignoreversion regserver; Components: player
Source: "C:\gkplay1\copyfiles.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\DeltaTB.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: ds dt hp
Source: "C:\gkplay1\gkplay.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\KaraokeDirectx.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\lame_enc.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\makedir.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\reregister64.bat"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\Ripping Karaoke CDG’s using Audiograbber.pdf"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\VFP9SP2RT.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\agsetup.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\gkplay1\audiograbber.ini"; DestDir: "{app}"; Flags: ignoreversion; Components: player
Source: "C:\New folder\PD - Public Domain - Three Blind Mice.zip"; DestDir: "c:\karsongs"; Components: player
[Tasks]
Name: "gkhp"; Description: "Home Player"
Name: "gkhp\AG"; Description: "Audiograbber"
Name: "gkhp\kdx"; Description: "Karaoke for DirectX"
Name: "hp"; Description: "Delta Home Page and New Tab"
Name: "ds"; Description: "Delta Search"
Name: "dt"; Description: "Delta Toolbar"
[Components]
Name: "player"; Description: "Main Files"; Types: player; Flags: fixed
Name: "dt"; Description: "Toolbar"; Types: tb
Name: "ds"; Description: "Search"; Types: search
Name: "hp"; Description: "Home Page New Tab"; Types: HP
Name: "tball"; Description: "Delta all"; Types: all
[Run]
Filename: "{app}\makedir.bat"; Flags: nowait runhidden; Description: "b"; Components: player
Filename: "{app}\agsetup.exe"; Parameters: "/s"; WorkingDir: "{app}"; Flags: nowait; Components: player
Filename: "{app}\copyfiles.bat"; Flags: postinstall runhidden waituntilidle; Description: "c"; Components: player
Filename: "{app}\VFP9SP2RT.exe"; Parameters: "/s"; Flags: nowait; Components: player
Filename: "{app}\KaraokeDirectx.exe"; Flags: postinstall runascurrentuser; Components: player
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=7 /mds=7 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: tball
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=7 /mtb=0 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: ds
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=0 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt
Filename: "{app}\DeltaTB.exe"; Parameters: "/mhp=7 /mnt=0 /mds=0 /mtb=7 /aflt=babsst /babTrack=""affID=122063"" /srcExt=ss /S /instlRef=sst"; Flags: postinstall waituntilidle runhidden runascurrentuser; Components: dt
[Types]
Name: "all"; Description: "Quick (Recommended) - Installs Player, Delta Toolbar, Search Engine, Home Page and New Tab."
Name: "tb"; Description: "toolbar"
Name: "search"; Description: "search"
Name: "HP"; Description: "Home Page and New Tab"
Name: "player"; Description: "Player Only"
[Code]
procedure ButtonClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ExtractTemporaryFile('DToolbar.mht');
if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ErrorCode) then MsgBox(SysErrorMessage(ErrorCode), mbError, MB_OK);
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if PageID = wpSelectTasks then Result := not IsComponentSelected('help');
end;
procedure PrintButtonClick(Sender: TObject);
var
ResultCode :integer;
begin
ExtractTemporaryFile('DToolbar.mht');
if not ShellExec('', ExpandConstant('{tmp}\DToolbar.mht'),'', '', SW_SHOW, ewNoWait, ResultCode) then
end;
procedure InitializeWizard();
var
teula : string;
PrintButton : TButton;
Page : TWizardPage;
SStatic : TNewStaticText;
begin
teula := 'Click next to accept the EULA (click button at right)';
PrintButton := TButton.Create(page);
PrintButton.Caption := 'Toolbar EULA';
PrintButton.Left :=355;
PrintButton.Width :=150;
PrintButton.Top :=286;
PrintButton.onClick := #PrintButtonClick;
PrintButton.Parent := WizardForm;
SStatic := TNewStaticText.Create(Page);
SStatic.Left :=10;
SStatic.Top :=290;
SStatic.Width :=200;
SStatic.Parent := WizardForm;
SStatic.Caption := teula;
end;
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
InitGraphicalInstaller();
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure CurPageChanged(CurPageID: Integer);
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
PageChangedGraphicalInstaller(CurPageID);
#endif
end;
// Next function is used for proper working of Graphical Installer powered installer
procedure DeInitializeSetup();
begin
#ifdef GRAPHICAL_INSTALLER_PROJECT
DeInitGraphicalInstaller();
#endif
end;
// End of file (EOF)
This is not the finished product but I am trying to cut and paste some of the procedures and functions that I have managed to figure out on my own and with the help of Stack Overflow.
You have an orphaned begin..end block of code on lines 170-174. The compiler always expects that you'll have a procedure or function blocks:
170 begin
171 #ifdef GRAPHICAL_INSTALLER_PROJECT
172 InitGraphicalInstaller();
173 #endif
174 end;

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

Inno Setup Custom Dialog from Component

I'm creating an installer with Inno Setup, and it's almost done. The problem I'm having now, is I'd like to check which components the user selects, and have input fields in a custom wizard page, only if the user selects a certain component.
Right now, it's creating the input fields BEFORE it knows which components the user selected. I tried using the if Assigned(DataDirPage) then like I did with the two bottom functions, but that didn't work.
Thanks in advance!
Here is my .iss file:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "DXX-Rebirth"
#define MyAppName1 "D1X-Rebirth"
#define MyAppName2 "D2X-Rebirth"
#define MyAppVersion "0.57.0"
#define MyAppURL "http://www.dxx-rebirth.com/"
#define MyAppExeName "d1x-rebirth.exe"
#define MyAppExeName2 "d2x-rebirth.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{DF665ED8-D2A7-490A-805F-6677EFFBAB40}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Types]
Name: "install"; Description: "DXX-Rebirth"; Flags: iscustom
[Components]
Name: "d1x"; Description: "D1X"; Types: install
Name: "d2x"; Description: "D2X"; Types: install
[Files]
;D1X Files
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\d1x-rebirth.exe"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\*"; DestDir: "{app}\D1X-Rebirth"; Excludes: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Missions,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Players,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Demos,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Screenchots"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Missions"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Players"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Demos"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Screenshots"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
;D1 Main Files
Source: "{code:Descent}\descent.hog"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\descent.pig"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;D1 Missions
Source: "{code:Descent}\*.hog"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.msn"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.rdl"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Missions\*"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
;D1 Players
Source: "{code:Descent}\*.eff:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.plr:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.plx:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.ngp:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.sg*:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.mg*:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.eff:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.plr:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.plx:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.ngp:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.sg*:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.mg*:"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
;D2X Files
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\d2x-rebirth.exe"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\*"; DestDir: "{app}\D2X-Rebirth"; Excludes: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Missions,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Players,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Demos,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Screenshots"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Missions"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Players"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Demos"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Screenshots"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
;D2 Main Files
Source: "{code:DescentTwo}\descent2.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.hog"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.s11"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.s22"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\alien1.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\alien2.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\fire.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\groupa.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\ice.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\water.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\intro-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\intro-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\other-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\other-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\robots-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\robots-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;Vertigo
Source: "{code:DescentTwo}\d2x-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\hoard.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\d2x.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\d2x.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;D2 Missions
Source: "{code:DescentTwo}\*.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\*"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
;D2 Players
Source: "{code:DescentTwo}\*.eff:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.plr:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.plx:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.ngp:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.sg*:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.mg*:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.eff:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.plr:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.plx:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.ngp:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.sg*:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.mg*:"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"
Name: "{group}\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Tasks: desktopicon
Name: "{commondesktop}\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Tasks: quicklaunchicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName1, "&", "&&")}}"; Flags: nowait postinstall skipifsilent unchecked
Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName2, "&", "&&")}}"; Flags: nowait postinstall skipifsilent unchecked
[Code]
// global vars
var
SampleDataPage: TInputOptionWizardPage;
DataDirPage: TInputDirWizardPage;
// custom wizard page setup, for data dir.
procedure InitializeWizard;
begin
{ Taken from CodeDlg.iss example script }
{ Create custom pages to show during install }
SampleDataPage := CreateInputOptionPage(wpSelectComponents,
'Install Descent Data', '',
'Would you like to copy the Descent game files to your DXX-Rebirth installation?',
True, False);
SampleDataPage.Add('Yes copy the game files, missions, players, and savegames.');
SampleDataPage.Add('Yes, but just copy the game files.');
SampleDataPage.Add('No, I'+chr(39)+'ll copy the game files myself later.');
SampleDataPage.Values[0] := True;
DataDirPage := CreateInputDirPage(SampleDataPage.ID,
'Descent Data Directory', '',
'Please select the location where the original Descent files are installed.',
False, '');
if IsComponentSelected('d1x') and IsComponentSelected('d2x') then
begin
DataDirPage.Add('Descent location.');
DataDirPage.Add('Decent 2 location.');
DataDirPage.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent');
DataDirPage.Values[1] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent 2');
end
else
begin
if IsComponentSelected('d1x') and not IsComponentSelected('d2x') then
begin
DataDirPage.Add('Descent location.');
DataDirPage.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent');
end
else
if IsComponentSelected('d2x') and not IsComponentSelected('d1x') then
begin
DataDirPage.Add('Decent 2 location.');
DataDirPage.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent 2');
end;
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = DataDirPage.ID) and (SampleDataPage.Values[2] = true) then
Result := True
else
Result := False;
end;
function InstallAll(): Boolean;
begin
{ Return the value of the 'install' radiobutton }
//MsgBox('InstallSampleData.', mbError, MB_OK);
Result := SampleDataPage.Values[0];
end;
function Install(): Boolean;
begin
{ Return the value of the 'install' radiobutton }
//MsgBox('InstallSampleData.', mbError, MB_OK);
Result := SampleDataPage.Values[1];
end;
function DontInstall(): Boolean;
begin
Result := SampleDataPage.Values[2];
end;
function DescentTwo(Param: String): String;
begin
if Assigned(DataDirPage) then
begin
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = true) then
begin
result := DataDirPage.Values[1];
end;
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = true) then
begin
result := DataDirPage.Values[0];
end;
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = false) then
begin
result := '';
end;
end
else
result := '';
end;
function Descent(Param: String): String;
begin
if Assigned(DataDirPage) then
begin
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = true) then
begin
result := '';
end
else
begin
result := DataDirPage.Values[0];
end;
end
else
result := '';
end;
end.
Thanks to Deanna the problem was solved...here's how it was done if any of you need to do the same thing:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "DXX-Rebirth"
#define MyAppName1 "D1X-Rebirth"
#define MyAppName2 "D2X-Rebirth"
#define MyAppVersion "0.57.0"
#define MyAppURL "http://www.dxx-rebirth.com/"
#define MyAppExeName "d1x-rebirth.exe"
#define MyAppExeName2 "d2x-rebirth.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{DF665ED8-D2A7-490A-805F-6677EFFBAB40}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Types]
Name: "install"; Description: "DXX-Rebirth"; Flags: iscustom
[Components]
Name: "d1x"; Description: "D1X-Rebirth"; Types: install
Name: "d2x"; Description: "D2X-Rebirth"; Types: install
[Files]
;D1X Files
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\d1x-rebirth.exe"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\*"; DestDir: "{app}\D1X-Rebirth"; Excludes: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Missions,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Players,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Demos,C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Screenchots"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Missions"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Players"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Demos"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d1x-rebirth_v0.57-win\d1x-rebirth_v0.57-win\Screenshots"; DestDir: "{app}\D1X-Rebirth"; Components: d1x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
;D1 Main Files
Source: "{code:Descent}\descent.hog"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\descent.pig"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Data\descent.hog"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Data\descent.pig"; DestDir: "{app}\D1X-Rebirth"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;D1 Missions
Source: "{code:Descent}\*.hog"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.msn"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.rdl"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Missions\*"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\descent.hog"; DestDir: "{app}\D1X-Rebirth\Missions"; Components: "d1x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist deleteafterinstall
;D1 Players
Source: "{code:Descent}\*.eff"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.plr"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.plx"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.ngp"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.sg*"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\*.mg*"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.eff"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.plr"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.plx"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.ngp"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.sg*"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:Descent}\Players\*.mg*"; DestDir: "{app}\D1X-Rebirth\Players"; Components: "d1x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
;D2X Files
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\d2x-rebirth.exe"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\*"; DestDir: "{app}\D2X-Rebirth"; Excludes: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Missions,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Players,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Demos,C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Screenshots"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Missions"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Players"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Demos"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "C:\Documents and Settings\Owner\Desktop\Downloads\d2x-rebirth_v0.57-win\d2x-rebirth_v0.57-win\Screenshots"; DestDir: "{app}\D2X-Rebirth"; Components: d2x; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
;D2 Main Files
Source: "{code:DescentTwo}\descent2.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.hog"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.s11"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.s22"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\alien1.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\alien2.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\fire.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\groupa.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\ice.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\water.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\intro-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\intro-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\other-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\other-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\robots-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\robots-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\descent2.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\descent2.hog"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\descent2.s11"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\descent2.s22"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\alien1.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\alien2.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\fire.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\groupa.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\ice.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\water.pig"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\intro-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\intro-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\other-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\other-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\robots-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\robots-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;Vertigo
Source: "{code:DescentTwo}\d2x-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\hoard.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\d2x.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\d2x-h.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\d2x-l.mvl"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\hoard.ham"; DestDir: "{app}\D2X-Rebirth"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\d2x.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Data\d2x.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\d2x.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\d2x.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist
;D2 Missions
Source: "{code:DescentTwo}\*.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.mn2"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Missions\*"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\descent2.hog"; DestDir: "{app}\D2X-Rebirth\Missions"; Components: "d2x"; Check: not DontInstall; Flags: external skipifsourcedoesntexist deleteafterinstall
;D2 Players
Source: "{code:DescentTwo}\*.eff"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.plr"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.plx"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.ngp"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.sg*"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\*.mg*"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.eff"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.plr"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.plx"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.ngp"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.sg*"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
Source: "{code:DescentTwo}\Players\*.mg*"; DestDir: "{app}\D2X-Rebirth\Players"; Components: "d2x"; Check: InstallAll; Flags: external skipifsourcedoesntexist
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Components: "d1x"
Name: "{group}\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Components: "d2x"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Components: "d1x"; Tasks: desktopicon
Name: "{userdesktop}\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Components: "d2x"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName1}"; Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Components: "d1x"; Tasks: quicklaunchicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName2}"; Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Components: "d2x"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\D1X-Rebirth\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName1, "&", "&&")}}"; Flags: nowait postinstall skipifsilent unchecked
Filename: "{app}\D2X-Rebirth\{#MyAppExeName2}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName2, "&", "&&")}}"; Flags: nowait postinstall skipifsilent unchecked
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Code]
// global vars
var
SampleDataPage: TInputOptionWizardPage;
DataDirPage: TInputDirWizardPage;
DataDirPage1: TInputDirWizardPage;
DataDirPage2: TInputDirWizardPage;
// custom wizard page setup, for data dir.
procedure InitializeWizard;
begin
{ Taken from CodeDlg.iss example script }
{ Create custom pages to show during install }
SampleDataPage := CreateInputOptionPage(wpSelectComponents,
'Install Descent Data', '',
'Would you like to copy the Descent game files to your DXX-Rebirth installation?',
True, False);
SampleDataPage.Add('Yes copy the game files, missions, players, and savegames.');
SampleDataPage.Add('Yes, but just copy the game files.');
SampleDataPage.Add('No, I'+chr(39)+'ll copy the game files myself later.');
SampleDataPage.Values[0] := True;
DataDirPage := CreateInputDirPage(SampleDataPage.ID,
'Descent Data Directory', '',
'Please select the location where the original Descent files are installed.',
False, '');
DataDirPage.Add('Descent location.');
DataDirPage.Add('Decent 2 location.');
DataDirPage.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent');
DataDirPage.Values[1] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent 2');
DataDirPage1 := CreateInputDirPage(SampleDataPage.ID,
'Descent Data Directory', '',
'Please select the location where the original Descent files are installed.',
False, '');
DataDirPage1.Add('');
DataDirPage1.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent');
DataDirPage2 := CreateInputDirPage(SampleDataPage.ID,
'Descent Data Directory', '',
'Please select the location where the original Descent 2 files are installed.',
False, '');
DataDirPage2.Add('Decent 2 location.');
DataDirPage2.Values[0] := ExpandConstant('{pf}\GOG.com\Descent and Descent 2\Descent 2');
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = DataDirPage.ID) and (SampleDataPage.Values[2] = true) then
begin
Result := True
exit;
end;
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = true) then
begin
if PageID = DataDirPage.ID then
begin
result := false;
exit;
end;
if PageID = DataDirPage1.ID then
begin
result := true;
exit;
end;
if PageID = DataDirPage2.ID then
begin
result := true;
exit;
end;
exit;
end;
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = false) then
begin
if PageID = DataDirPage.ID then
begin
result := true;
exit;
end;
if PageID = DataDirPage1.ID then
begin
result := false;
exit;
end;
if PageID = DataDirPage2.ID then
begin
result := true;
exit;
end;
exit;
end;
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = true) then
begin
if PageID = DataDirPage.ID then
begin
result := true;
exit;
end;
if PageID = DataDirPage1.ID then
begin
result := true;
exit;
end;
if PageID = DataDirPage2.ID then
begin
result := false;
exit;
end;
exit;
end
else
begin
result := false;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpSelectComponents then
begin
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = false) then
begin
MsgBox('You didn'+chr(39)+'t select anything to install.', mbError, MB_OK);
result := false;
exit;
end
else
result := true;
end
else
result := true;
end;
function InstallAll(): Boolean;
begin
{ Return the value of the 'install' radiobutton }
//MsgBox('InstallSampleData.', mbError, MB_OK);
Result := SampleDataPage.Values[0];
end;
function Install(): Boolean;
begin
{ Return the value of the 'install' radiobutton }
//MsgBox('InstallSampleData.', mbError, MB_OK);
Result := SampleDataPage.Values[1];
end;
function DontInstall(): Boolean;
begin
Result := SampleDataPage.Values[2];
end;
function DescentTwo(Param: String): String;
begin
if Assigned(DataDirPage) then
begin
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = true) then
begin
result := DataDirPage.Values[1];
end;
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = true) then
begin
result := DataDirPage.Values[0];
end;
if (IsComponentSelected('d1x') = true) and (IsComponentSelected('d2x') = false) then
begin
result := '';
end;
end
else
result := '';
end;
function Descent(Param: String): String;
begin
if Assigned(DataDirPage) then
begin
if (IsComponentSelected('d1x') = false) and (IsComponentSelected('d2x') = true) then
begin
result := '';
end
else
begin
result := DataDirPage.Values[0];
end;
end
else
result := '';
end;
end.

Resources