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

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!

Related

Unpack SFX file using Inno Setup

I'm trying to run Inno Setup to automatically extract my SFX file without having to run extract manually. Is there any way? I leave my script below.
Is there also a way to make Inno Setup extract the SFX in the Myprogramfolder created by the installer?
I have compressed the SFX file using Winrar.
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Program2019"
#define MyAppVersion "1.0"
#define MyAppPublisher "Myappname."
#define MyAppURL "/"
[Setup]
WizardImageFile=C:\Users\Administrator\Desktop\Cover.bmp
; NOTE: The value of AppId uniquely identifies this application.
AppID={{31D336CF-0483-4A76-00000000000000000}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\Myprogram2019
DefaultGroupName={#MyAppName}
LicenseFile=C:\Users\Administrator\Desktop\Program2019\readme.txt
OutputDir=C:\Users\Administrator\Desktop\Program2019\Myprografolder
OutputBaseFilename=setup
SetupIconFile=C:\Users\Administrator\Desktop\Program2019\Myprogram\icon.ico
Compression=none
SolidCompression=true
InternalCompressLevel=Fast
[Languages]
Name: "english"; MessagesFile: "compiler:Languages\English.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
[Files]
Source: "C:\Program Files (x86)\Myprogramfolder\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\Administrator\Desktop\Program2019\Unpack\Evilpack.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
Source: "C:\Users\Administrator\Desktop\Program2019\languages\spanish\*"; DestDir: "{app}\game"; Languages: spanish; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Run]
Filename: "{tmp}\Evilpack.exe"; Parameters: "{tmp}\ZipFile.ZIP -d C:\TargetDir"
[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Myprogram2019"; Filename: "{app}\mypro.exe"; IconFilename: {app}\icon.ico; \
AfterInstall: SetElevationBit('{commondesktop}\Myprogram.lnk')
[Code]
{ RedesignWizardFormBegin } // Don't remove this line!
// Don't modify this section. It is generated automatically.
procedure RedesignWizardForm;
begin
{ ReservationBegin }
// This part is for you. Add your specialized code here.
{ ReservationEnd }
end;
[Messages]
BeveledLabel=Myapp
Is very easy unpack in silent way SFX, setup to silent from the menu option ADVANCED, then SFX options in winrar.
That is all!!
Finally
[Files]
Source: "C:\pathtofile\yoursfx.exe"; DestDir: "C:\Program Files\";Flags: ignoreversion
[Run]
Filename: "C:\Program Files\yoursfx.exe"; StatusMsg: "Your MSG"; Flags: runascurrentuser
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
begin;
DeleteFile(ExpandConstant('C:\Program Files\yoursfx.exe'));
begin
// user clicked Yes
end;
end;
end;

How to complete instalation ant then restart windows?

I try to rework existing inno setup script and include some dependencies to it. But at the middle of installation VC++ redistributable always restart the windows not from installing wizard window. And this restart totally has broken all installation progress. I have this script.
[Files]
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Launcher\AAC Psychologue.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Launcher\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\dxwebsetup.exe"; DestDir: "{app}"; AfterInstall: DirecXinstaller; Flags: ignoreversion deleteafterinstall
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\Windows6.1-KB2670838-x64.msu"; DestDir: "{app}"; Flags: 64bit deleteafterinstall
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\Windows6.1-KB2670838-x86.msu"; DestDir: "{app}"; AfterInstall: Win7Update; Flags: 32bit deleteafterinstall
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\Windows6.1-KB2670838-x86.msu"; DestDir: "{app}"; AfterInstall: Win7Update; Flags: 32bit deleteafterinstall
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\vc_redist.x86.exe"; DestDir: "{app}";AfterInstall: vcInstaller; Flags: 32bit deleteafterinstall
Source: "E:\engine\repos\AACPsychologue_all\aacpsychologue\Installers\Resources\vc_redist.x64.exe"; DestDir: "{app}";AfterInstall: vcInstaller; Flags: 64bit deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
[Code]
procedure DirecXinstaller;
var
ResultCode: Integer;
begin
if not Exec(ExpandConstant('{app}\dxwebsetup.exe'), '', '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode)
then
MsgBox('Other installer failed to run!' + #13#10 +
SysErrorMessage(ResultCode), mbError, MB_OK);
end;
procedure Win7Update;
var
ResultCode: Integer;
begin
if IsWin64 then
begin
Exec(ExpandConstant('{app}\Windows6.1-KB2670838-x64.msu'), '', '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode)
end
else
begin
Exec(ExpandConstant('{app}\Windows6.1-KB2670838-x86.msu'), '', '', SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode)
end;
end;
procedure vcInstaller;
var
ResultCode: Integer;
begin
if IsWin64 then
begin
Exec(ExpandConstant('{app}\vc_redist.x64.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode)
end
else
begin
Exec(ExpandConstant('{app}\vc_redist.x86.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode)
end;
end;
[Run]
Filename: "{app}\{#MyAppExeName}"; Flags: postinstall skipifsilent waituntilterminated unchecked;
Have any ideas?
vc_redist.*.exe have /norestart switch to prevent the restart.
You can then make Inno Setup restart the machine using AlwaysRestart directive.
Also, note that it is better to use [Run] section to execute the sub-installer. Additionally, it not a good practice to install temporary files to {app}. I also do not think that you want to use ewNoWait.
[Setup]
AlwaysRestart=yes
[Files]
Source: "...\vc_redist.x86.exe"; DestDir: "{tmp}"; Flags: 32bit
Source: "...\vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: 64bit
[Run]
Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/norestart"; Flags: 32bit
Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/norestart"; Flags: 64bit

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;

How to determine the Office version programmatically using the Inno Setup?

I have two types of Office add-ins – one for Office 2013 and another for other versions (2003-2010).
I use Inno Setup for distribution package.
Is it possible to determine the Office version that installed on target machine and than to run the right installation file?
I tried to write the code that detects the Word version and installs appropriate files but I failed to compile it. Since this is the first time that I write such a code, I would like to ask you to take a look on my code.
[Files]
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013.exe"; DestDir: "{app}"; Check: "Install2013"; MinVersion: 0.0,5.0;
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010.exe"; DestDir: "{app}"; Check: "Install2010"; MinVersion: 0.0,5.0;
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013x86.dll"; DestDir: "{app}"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 32bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2013x64.dll"; DestDir: "{app}"; Check: "Install2013 and Is64BitInstallMode"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 64bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010x84.dll"; DestDir: "{app}"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 32bit
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg2010x64.dll"; DestDir: "{app}"; Check: "Install2010 and Is64BitInstallMode"; MinVersion: 0.0,5.0; Flags: regserver noregerror ignoreversion 64bit
Root: HKCU; Subkey: "Software\My Program\AppforWord"; ValueName: "AppBarStyle"; ValueType: String; ValueData: "1"; Components: "AppforWord"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforExcel"; ValueName: "Enable"; ValueType: String; ValueData: "2"; Components: "AppforWord"; Check: "Install2010"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforWord"; ValueName: "AppBarStyle"; ValueType: String; ValueData: "1"; Components: "AppforWord"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Software\My Program\AppforExcel"; ValueName: "Enable"; ValueType: String; ValueData: "2"; Components: "AppforWord"; Check: "Install2013"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue
[Icons]
Name: "{commondesktop}\MyProg 2013"; Filename: "{app}\MyProg2013.exe"; Comment: "The settings for My Program 2013"; Check: "Install2013"; MinVersion: 0.0,5.0;
Name: "{commondesktop}\MyProg 2010"; Filename: "{app}\MyProg2010.exe"; Comment: "The settings of My Program"; Check: "Install2010"; MinVersion: 0.0,5.0;
[Code]
{ Get office version }
function IsInstall2013(): boolean;
var
success: boolean;
OfficeVer: cardinal;
begin
success :=
RegQueryDWordValue(
HKEY_CLASSES_ROOT, 'Word.Application\CurVer', Word.Application.15' );
Result := success and (OfficeVer = Word.Application.15);
end;
{ RETURNS OPPOSITE OF IsInstall2013 FUNCTION }
function Install2013(): Boolean;
begin
Result := (IsInstall2013 = false);
end;
{ RETURNS OPPOSITE OF not Office2013 FUNCTION }
function Install2010(): Boolean;
begin
Result := (IsInstall2010 = true);
end;
Since I also would like to create an Inno Setup installation routine which detects the version of Office someone is using. I have tried various iterations of the above code and can't seem to get things to work.
My objective is simple... install files A,B,C if someone is using Office 2010. If someone is using Office 2013, install files D,E,F,.

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