Open the "CUSTOMIZE.txt" file at the end of the installation instead of the "INSTALL.txt" file.

git-svn-id: 4c7b768bc2e2a56aa1c56b1b5a9454ba68342430@2873 ac9c905b-388a-4ddf-9b6a-4063a022bc57

; Script generated by the Inno Setup Script Wizard.

#define MyAppName "Logtalk"
#define MyAppVerName "Logtalk 2.28.0"
#define MyAppPublisher "Logtalk.org"
#define MyAppURL "http://logtalk.org"
#define MyAppUrlName "Logtalk Web Site.url"
#define MyAppRegURL "http://logtalk.org/regform.html"
#define MyAppRegUrlName "Logtalk Registration.url"

#define LOGTALKHOME "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,LOGTALKHOME|{pf}\Logtalk}"
#define LOGTALKUSER "{reg:HKCU\Environment,LOGTALKUSER|{userdocs}\Logtalk}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesEnvironment=yes
DefaultDirName={#LOGTALKHOME}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\logtalk\LICENSE.txt
InfoBeforeFile=C:\logtalk\README.txt
OutputBaseFilename=lgt2280
Compression=lzma
SolidCompression=yes

VersionInfoVersion=2.28.0
VersionInfoCopyright= Paulo Moura, 1998-2006

AllowRootDirectory=yes
UninstallFilesDir="{userdocs}\Logtalk uninstaller"

MinVersion=0,5.0

[Types]
Name: "full"; Description: "Full installation (recommended)"
Name: "base"; Description: "Base system installation"
Name: "user"; Description: "User data files installation (must be run by all end-users)"
Name: "prolog"; Description: "Prolog integration (see documentation for compatibility details)"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "base"; Description: "Base system"; Types: full base custom; Flags: disablenouninstallwarning
Name: "user"; Description: "User data files"; Types: full user custom; Flags: checkablealone
Name: "user\backup"; Description: "Backup current user data files"; Types: full user custom
Name: "prolog"; Description: "Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\ciao"; Description: "Ciao Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\eclipse"; Description: "ECLiPSe integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\gprolog"; Description: "GNU Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\plc"; Description: "K-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\sicstus"; Description: "SICStus Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\swi"; Description: "SWI-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\xsb"; Description: "XSB integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\yap"; Description: "YAP integration"; Types: full prolog custom; Flags: disablenouninstallwarning

[Tasks]
Name: registration; Description: "&Register {#MyAppName}"; Components: base user
Name: shortcut; Description: "&Create a desktop shortcut to the Logtalk user folder"; Components: user

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Messages]
BeveledLabel=Logtalk 2.28.0  Paulo Moura, 1998-2006

[Dirs]
Name: {code:GetLgtUserDir}; Components: user; Flags: uninsneveruninstall
Name: "{userdocs}\Logtalk uninstaller"

[Files]
Source: "C:\logtalk\*"; Excludes: ".*,CVS"; DestDir: "{app}"; Components: base; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\logtalk\configs\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\configs"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\contributions\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\contributions"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\examples\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\examples"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\libpaths\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\libpaths"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\library\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\library"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\xml\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\xml"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall

[INI]
Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}"; Components: base
Filename: "{app}\{#MyAppRegUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppRegURL}"; Components: base

[Icons]
Name: "{group}\{#MyAppName} Bibliography"; Filename: "{app}\BIBLIOGRAPHY.txt"; Components: base
Name: "{group}\{#MyAppName} Documentation"; Filename: "{app}\manuals\index.html"; Components: base
Name: "{group}\{#MyAppName} License"; Filename: "{app}\LICENSE.txt"; Components: base
Name: "{group}\{#MyAppName} Release Notes"; Filename: "{app}\RELEASE_NOTES.txt"; Components: base
Name: "{group}\{#MyAppName} Read Me"; Filename: "{app}\README.txt"; Components: base

Name: "{group}\{#MyAppName} Web Site"; Filename: "{app}\{#MyAppUrlName}"; Components: base
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: base

Name: "{code:GetLgtUserDir}\manuals"; Filename: "{app}\manuals"; Components: user
Name: "{code:GetLgtUserDir}\wenv"; Filename: "{app}\wenv"; Components: user

Name: "{userdesktop}\Logtalk user files"; Filename: "{code:GetLgtUserDir}"; Components: user; Tasks: shortcut

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "LOGTALKHOME"; ValueData: "{app}"; Components: base; Flags: deletevalue uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "LOGTALKUSER"; ValueData: "{code:GetLgtUserDir}"; Flags: deletevalue uninsdeletevalue

[Run]
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_ciaolgt.js"""; Description: "Ciao Prolog integration"; Components: prolog\ciao
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_eclipselgt.js"""; Description: "ECLiPSe integration"; Components: prolog\eclipse
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_gplgt.js"""; Description: "GNU Prolog integration"; Components: prolog\gprolog
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_plclgt.js"""; Description: "K-Prolog integration"; Components: prolog\plc
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_sicstuslgt.js"""; Description: "SICStus Prolog integration"; Components: prolog\sicstus
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_swilgt.js"""; Description: "SWI-Prolog integration"; Components: prolog\swi
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_xsblgt.js"""; Description: "XSB integration"; Components: prolog\xsb
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_yaplgt.js"""; Description: "YAP integration"; Components: prolog\yap

Filename: "{app}\RELEASE_NOTES.txt"; Description: "View the release notes"; Components: base user; Flags: postinstall shellexec skipifsilent
Filename: "{app}\CUSTOMIZE.txt"; Description: "Read the customization instructions for completing your setup"; Components: base user; Flags: postinstall shellexec skipifsilent

Filename: "{app}\{#MyAppRegUrlName}"; Flags: shellexec nowait; Tasks: registration

[UninstallDelete]
Type: filesandordirs; Name: "{app}"; Components: base
Type: filesandordirs; Name: "{group}"; Components: base

[Code]
var
  LgtUserDirPage: TInputDirWizardPage;
  WarningPage: TOutputMsgWizardPage;
  Explanation, Warning, Scripts: String;

procedure InitializeWizard;
begin
  Explanation := 'Select the folder in which Setup should install Logtalk user data files, then click Next.'
                 + Chr(13) + Chr(13)
                 + 'These files allows each user to independently customize Logtalk and to freely modify the provided programming examples.'
                 + Chr(13) + Chr(13)
                 + 'A copy of these files must exist in the user home folder in order to use the Logtalk-Prolog integration scripts available from the Start Menu.'
                 + Chr(13) + Chr(13)
                 + 'Addtional end-users may use this installer to make a copy of these files on their home folders after a full installation of Logtalk.';
  LgtUserDirPage := CreateInputDirPage(wpSelectDir,
    'Select folder for Logtalk user data files', 'Where should Logtalk user data files be installed?',
    Explanation,
    False, 'New Folder');
  LgtUserDirPage.Add('');
  LgtUserDirPage.Values[0] := ExpandConstant('{#LOGTALKUSER}');
  if not IsAdminLoggedOn then
  begin
    Warning := 'Full installation of Logtalk requires an administrative user.'
               + Chr(13) + Chr(13)
               + 'If the base Logtalk system is already installed, you may proceed in order to setup Logtalk for you as an end-user.'
               + Chr(13) + Chr(13)
               + 'If Logtalk is already set for you, this installer will make a backup copy of your current files (if you choose the same installation folder) and will restore all user data files to their default, pristine state.';
    WarningPage := CreateOutputMsgPage(wpWelcome,
  'Information', 'Please read the following important information before continuing.', Warning);
  end
end;

function GetLgtUserDir(Param: String): String;
begin
  Result := LgtUserDirPage.Values[0]
end;

function GetCurrentDate(Param: String): String;
begin
  Result := GetDateTimeString('dddddd tt', '-', '-')
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpSelectDir) and not IsAdminLoggedOn then
    Result := True
  else if (PageID = wpSelectComponents) and not IsAdminLoggedOn then
  begin
    WizardForm.TypesCombo.ItemIndex := 2;
    WizardForm.TypesCombo.OnChange(nil);
    Result := True
  end
  else if (PageID = wpReady) and not IsAdminLoggedOn then
    Result := True
  else
    Result := False;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if (CurStep = ssInstall) and DirExists(LgtUserDirPage.Values[0]) and (pos('backup', WizardSelectedComponents(False)) > 0) then
    RenameFile(LgtUserDirPage.Values[0], LgtUserDirPage.Values[0] + ' backup ' + GetDateTimeString('dddddd tt', '-', '-'));
  if (CurStep = ssInstall) and (pos('prolog', WizardSelectedComponents(False)) > 0) then
  begin
    Scripts := 'The installer needs to run a set of JScripts scripts within command shells' + Chr(13) +
               'in order to integrate Logtalk with your installed Prolog compilers.' + Chr(13) + Chr(13) +
               'Make sure that any security software you may have installed do not block' + Chr(13) +
               'the execution of the scripts.';
    MsgBox(Scripts, mbInformation, MB_OK)
  end
end;

; Script generated by the Inno Setup Script Wizard.

#define MyAppName "Logtalk"
#define MyAppVerName "Logtalk 2.28.0"
#define MyAppPublisher "Logtalk.org"
#define MyAppURL "http://logtalk.org"
#define MyAppUrlName "Logtalk Web Site.url"
#define MyAppRegURL "http://logtalk.org/regform.html"
#define MyAppRegUrlName "Logtalk Registration.url"

#define LOGTALKHOME "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,LOGTALKHOME|{pf}\Logtalk}"
#define LOGTALKUSER "{reg:HKCU\Environment,LOGTALKUSER|{userdocs}\Logtalk}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesEnvironment=yes
DefaultDirName={#LOGTALKHOME}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\logtalk\LICENSE.txt
InfoBeforeFile=C:\logtalk\README.txt
OutputBaseFilename=lgt2280
Compression=lzma
SolidCompression=yes

VersionInfoVersion=2.28.0
VersionInfoCopyright= Paulo Moura, 1998-2006

AllowRootDirectory=yes
UninstallFilesDir="{userdocs}\Logtalk uninstaller"

MinVersion=0,5.0

[Types]
Name: "full"; Description: "Full installation (recommended)"
Name: "base"; Description: "Base system installation"
Name: "user"; Description: "User data files installation (must be run by all end-users)"
Name: "prolog"; Description: "Prolog integration (see documentation for compatibility details)"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "base"; Description: "Base system"; Types: full base custom; Flags: disablenouninstallwarning
Name: "user"; Description: "User data files"; Types: full user custom; Flags: checkablealone
Name: "user\backup"; Description: "Backup current user data files"; Types: full user custom
Name: "prolog"; Description: "Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\ciao"; Description: "Ciao Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\eclipse"; Description: "ECLiPSe integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\gprolog"; Description: "GNU Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\plc"; Description: "K-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\sicstus"; Description: "SICStus Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\swi"; Description: "SWI-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\xsb"; Description: "XSB integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\yap"; Description: "YAP integration"; Types: full prolog custom; Flags: disablenouninstallwarning

[Tasks]
Name: registration; Description: "&Register {#MyAppName}"; Components: base user
Name: shortcut; Description: "&Create a desktop shortcut to the Logtalk user folder"; Components: user

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Messages]
BeveledLabel=Logtalk 2.28.0  Paulo Moura, 1998-2006

[Dirs]
Name: {code:GetLgtUserDir}; Components: user; Flags: uninsneveruninstall
Name: "{userdocs}\Logtalk uninstaller"

[Files]
Source: "C:\logtalk\*"; Excludes: ".*,CVS"; DestDir: "{app}"; Components: base; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\logtalk\configs\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\configs"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\contributions\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\contributions"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\examples\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\examples"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\libpaths\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\libpaths"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\library\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\library"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\xml\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\xml"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall

[INI]
Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}"; Components: base
Filename: "{app}\{#MyAppRegUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppRegURL}"; Components: base

[Icons]
Name: "{group}\{#MyAppName} Bibliography"; Filename: "{app}\BIBLIOGRAPHY.txt"; Components: base
Name: "{group}\{#MyAppName} Documentation"; Filename: "{app}\manuals\index.html"; Components: base
Name: "{group}\{#MyAppName} License"; Filename: "{app}\LICENSE.txt"; Components: base
Name: "{group}\{#MyAppName} Release Notes"; Filename: "{app}\RELEASE_NOTES.txt"; Components: base
Name: "{group}\{#MyAppName} Read Me"; Filename: "{app}\README.txt"; Components: base

Name: "{group}\{#MyAppName} Web Site"; Filename: "{app}\{#MyAppUrlName}"; Components: base
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: base

Name: "{code:GetLgtUserDir}\manuals"; Filename: "{app}\manuals"; Components: user
Name: "{code:GetLgtUserDir}\wenv"; Filename: "{app}\wenv"; Components: user

Name: "{userdesktop}\Logtalk user files"; Filename: "{code:GetLgtUserDir}"; Components: user; Tasks: shortcut

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "LOGTALKHOME"; ValueData: "{app}"; Components: base; Flags: deletevalue uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "LOGTALKUSER"; ValueData: "{code:GetLgtUserDir}"; Flags: deletevalue uninsdeletevalue

[Run]
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_ciaolgt.js"""; Description: "Ciao Prolog integration"; Components: prolog\ciao
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_eclipselgt.js"""; Description: "ECLiPSe integration"; Components: prolog\eclipse
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_gplgt.js"""; Description: "GNU Prolog integration"; Components: prolog\gprolog
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_plclgt.js"""; Description: "K-Prolog integration"; Components: prolog\plc
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_sicstuslgt.js"""; Description: "SICStus Prolog integration"; Components: prolog\sicstus
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_swilgt.js"""; Description: "SWI-Prolog integration"; Components: prolog\swi
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_xsblgt.js"""; Description: "XSB integration"; Components: prolog\xsb
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_yaplgt.js"""; Description: "YAP integration"; Components: prolog\yap

Filename: "{app}\RELEASE_NOTES.txt"; Description: "View the release notes"; Components: base user; Flags: postinstall shellexec skipifsilent
Filename: "{app}\INSTALL.txt"; Description: "Review the install instructions for completing your setup"; Components: base user; Flags: postinstall shellexec skipifsilent

Filename: "{app}\{#MyAppRegUrlName}"; Flags: shellexec nowait; Tasks: registration

[UninstallDelete]
Type: filesandordirs; Name: "{app}"; Components: base
Type: filesandordirs; Name: "{group}"; Components: base

[Code]
var
  LgtUserDirPage: TInputDirWizardPage;
  WarningPage: TOutputMsgWizardPage;
  Explanation, Warning, Scripts: String;

procedure InitializeWizard;
begin
  Explanation := 'Select the folder in which Setup should install Logtalk user data files, then click Next.'
                 + Chr(13) + Chr(13)
                 + 'These files allows each user to independently customize Logtalk and to freely modify the provided programming examples.'
                 + Chr(13) + Chr(13)
                 + 'A copy of these files must exist in the user home folder in order to use the Logtalk-Prolog integration scripts available from the Start Menu.'
                 + Chr(13) + Chr(13)
                 + 'Addtional end-users may use this installer to make a copy of these files on their home folders after a full installation of Logtalk.';
  LgtUserDirPage := CreateInputDirPage(wpSelectDir,
    'Select folder for Logtalk user data files', 'Where should Logtalk user data files be installed?',
    Explanation,
    False, 'New Folder');
  LgtUserDirPage.Add('');
  LgtUserDirPage.Values[0] := ExpandConstant('{#LOGTALKUSER}');
  if not IsAdminLoggedOn then
  begin
    Warning := 'Full installation of Logtalk requires an administrative user.'
               + Chr(13) + Chr(13)
               + 'If the base Logtalk system is already installed, you may proceed in order to setup Logtalk for you as an end-user.'
               + Chr(13) + Chr(13)
               + 'If Logtalk is already set for you, this installer will make a backup copy of your current files (if you choose the same installation folder) and will restore all user data files to their default, pristine state.';
    WarningPage := CreateOutputMsgPage(wpWelcome,
  'Information', 'Please read the following important information before continuing.', Warning);
  end
end;

function GetLgtUserDir(Param: String): String;
begin
  Result := LgtUserDirPage.Values[0]
end;

function GetCurrentDate(Param: String): String;
begin
  Result := GetDateTimeString('dddddd tt', '-', '-')
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpSelectDir) and not IsAdminLoggedOn then
    Result := True
  else if (PageID = wpSelectComponents) and not IsAdminLoggedOn then
  begin
    WizardForm.TypesCombo.ItemIndex := 2;
    WizardForm.TypesCombo.OnChange(nil);
    Result := True
  end
  else if (PageID = wpReady) and not IsAdminLoggedOn then
    Result := True
  else
    Result := False;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if (CurStep = ssInstall) and DirExists(LgtUserDirPage.Values[0]) and (pos('backup', WizardSelectedComponents(False)) > 0) then
    RenameFile(LgtUserDirPage.Values[0], LgtUserDirPage.Values[0] + ' backup ' + GetDateTimeString('dddddd tt', '-', '-'));
  if (CurStep = ssInstall) and (pos('prolog', WizardSelectedComponents(False)) > 0) then
  begin
    Scripts := 'The installer needs to run a set of JScripts scripts within command shells' + Chr(13) +
               'in order to integrate Logtalk with your installed Prolog compilers.' + Chr(13) + Chr(13) +
               'Make sure that any security software you may have installed do not block' + Chr(13) +
               'the execution of the scripts.';
    MsgBox(Scripts, mbInformation, MB_OK)
  end
end;


Simplify Windows installer script.

Simplify Windows installer script.

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@11960 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

;;
;; Set up parameters
;;

#if MMArch == "x64"
#  define MMArch_x86amd64 "amd64"
#  define MMArch_x86x64 "x64"
#  define MMArch_bits "64"
#elif MMArch == "Win32"
#  define MMArch_x86amd64 "x86"
#  define MMArch_x86x64 "x86"
#  define MMArch_bits "32"
#else
#  error MMArch must be set to "x64" or "Win32" before including this file
#endif

#define MMStageDir "..\stage\Release\" + MMArch

;;
;; Basic installer setup
;;

[Setup]
AppName=Micro-Manager-1.4
AppVerName=Micro-Manager-1.4
AppPublisher=UCSF
AppPublisherURL=http://www.micro-manager.org
AppSupportURL=http://www.micro-manager.org
AppUpdatesURL=http://www.micro-manager.org
DefaultDirName=C:/Program Files/Micro-Manager-1.4
DefaultGroupName=Micro-Manager-1.4
OutputBaseFilename=MMSetup_{#MMArch_bits}bit
Compression=lzma
SolidCompression=true
VersionInfoVersion=1.4
VersionInfoCompany=(c)University of California San Francisco
VersionInfoCopyright=(c)University of California San Francisco, (c)100XImaging Inc
AppCopyright=University of California San Francisco, 100XImaging Inc
ShowLanguageDialog=yes
AppVersion=1.4
AppID=31830087-F23D-4198-B67D-AD4A2A69147F

#if MMArch == "x64"
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
#endif

[Languages]
Name: eng; MessagesFile: compiler:Default.isl

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

;;
;; Visual C++ redistributables
;;

[InstallDelete]
; Remove VC++ 2008 Redistributable Package installed by previous versions
Type: filesandordirs; Name: {app}\Microsoft.VC90.ATL
Type: filesandordirs; Name: {app}\Microsoft.VC90.CRT
Type: filesandordirs; Name: {app}\Microsoft.VC90.MFC
Type: filesandordirs; Name: {app}\Microsoft.VC90.MFCLOC
Type: filesandordirs; Name: {app}\Microsoft.VC90.OPENMP

[Files]
Source: "..\..\3rdparty\Microsoft\vcredist\2008SP1\vcredist_{#MMArch_x86x64}.exe"; DestDir: "{app}"; DestName: "vcredist_{#MMArch_x86x64}_2008SP1.exe"; Flags: deleteafterinstall
Source: "..\..\3rdparty\Microsoft\vcredist\2010SP1\vcredist_{#MMArch_x86x64}.exe"; DestDir: "{app}"; DestName: "vcredist_{#MMArch_x86x64}_2010SP1.exe"; Flags: deleteafterinstall

[Run]
Filename: "{app}\vcredist_{#MMArch_x86x64}_2008SP1.exe"; Parameters: "/q"; Description: "Microsoft Visual C++ 2008 SP1 Redistributable Package"; StatusMsg: "Installing Microsoft Visual C++ 2008 SP1 Redistributable Package"
Filename: "{app}\vcredist_{#MMArch_x86x64}_2010SP1.exe"; Parameters: "/q"; Description: "Microsoft Visual C++ 2010 SP1 Redistributable Package"; StatusMsg: "Installing Microsoft Visual C++ 2010 SP1 Redistributable Package"

;;
;; Micro-Manager application files
;;

[Files]

; Java Runtime
Source: {#MMStageDir}\jre\*; DestDir: {app}\jre; Flags: ignoreversion recursesubdirs createallsubdirs

; Vendor DLLs
; Please keep in ASCII lexical order!
; TODO Include these from a separate file
#if MMArch == "x64"
Source: {#MMStageDir}\FxLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\LaserCombinerSDK64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\PCO_Kamlib64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\SysInfo.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\TIS_DShowLib10_x64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\TIS_UDSHL10_x64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\XCLIBW64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\atmcd64d.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\hidapi.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\hrfw64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\inpoutx64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\libusb0.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mcam64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mcammr64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mrc564.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mrfw64.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\opencv_core231.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\opencv_highgui231.dll; DestDir: {app}; Flags: ignoreversion
#else
Source: {#MMStageDir}\DSLRRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\FireCamJ.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\FxLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\LaserCombinerSDK.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\MexJCam.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\NKRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\PCO_Kamlib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\PSRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\ProcessLib.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\SysInfo.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\TIS_DShowLib10.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\TIS_UDSHL10.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\XCLIBWNT.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\atmcd32d.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\camconj.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\hidapi.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\hrfw.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\inpout32.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\libusb0.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mcam.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mcammr.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mrc5.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\mrfw.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\opencv_core231.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\opencv_highgui231.dll; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\usb_main.bin; DestDir: {app}; Flags: ignoreversion
#endif

; Olympus IX*3 control module
Source: {#MMStageDir}\OlympusIX3Control\*; DestDir: {app}\OlympusIX3Control; Flags: ignoreversion recursesubdirs createallsubdirs

; Java wrapper
Source: {#MMStageDir}\MMCoreJ_wrap.dll; DestDir: {app}; Flags: ignoreversion

; Device adapters
Source: {#MMStageDir}\mmgr_dal_*.dll; DestDir: {app}; Flags: ignoreversion

; Python wrapper
Source: {#MMStageDir}\_MMCorePy.pyd; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\MMCorePy.py; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\MMCoreWrapDemo.py; DestDir: {app}; Flags: ignoreversion

; BeanShell scripts
Source: {#MMStageDir}\scripts\*; DestDir: {app}\scripts; Flags: ignoreversion

; Configuration files
Source: {#MMStageDir}\MMConfig_demo.cfg; DestDir: {app}; Flags: ignoreversion

; ImageJ files
Source: {#MMStageDir}\ImageJ.exe; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\ImageJ.cfg; DestDir: {app}; Flags: onlyifdoesntexist; Permissions: users-modify
Source: {#MMStageDir}\ij.jar; DestDir: {app}; Flags: ignoreversion
Source: {#MMStageDir}\IJ_Prefs.txt; DestDir: {app}; Flags: onlyifdoesntexist
Source: {#MMStageDir}\macros\*; DestDir: {app}\macros; Flags: ignoreversion recursesubdirs createallsubdirs
Source: {#MMStageDir}\plugins\*; DestDir: {app}\plugins; Flags: ignoreversion recursesubdirs createallsubdirs

; Plugins
Source: {#MMStageDir}\mmplugins\*; DestDir: {app}\mmplugins; Flags: ignoreversion recursesubdirs createallsubdirs
Source: {#MMStageDir}\mmautofocus\*; DestDir: {app}\mmautofocus; Flags: ignoreversion recursesubdirs createallsubdirs

;;
;; Additional install settings
;;

[Dirs]
Name: "{app}"; Permissions: users-modify
; TODO Test if subdir permissions really need to be set here.
Name: "{app}\macros"; Permissions: users-modify
Name: "{app}\plugins"; Permissions: users-modify
Name: "{app}\mmplugins"; Permissions: users-modify
Name: "{app}\mmautofocus"; Permissions: users-modify

[Icons]
Name: {group}\Micro-Manager-1.4; Filename: {app}\ImageJ.exe; WorkingDir: {app}
Name: {group}\{cm:UninstallProgram,Micro-Manager-1.4}; Filename: {uninstallexe}
Name: {commondesktop}\Micro-Manager 1.4; Filename: {app}\ImageJ.exe; Tasks: desktopicon; WorkingDir: {app}; IconIndex: 0

[Run]
Filename: "{app}\ImageJ.exe"; WorkingDir: "{app}"; Description: {cm:LaunchProgram,Micro-Manager-1.4}; Flags: nowait postinstall skipifsilent

#if MMArch == "x64"
#  define MMArch_x86amd64 "amd64"
#  define MMArch_x86x64 "x64"
#  define MMArch_bits "64"
#elif MMArch == "Win32"
#  define MMArch_x86amd64 "x86"
#  define MMArch_x86x64 "x86"
#  define MMArch_bits "32"
#else
#  error MMArch must be set to "x64" or "Win32" before including this file
#endif

[Setup]
AppName=Micro-Manager-1.4
AppVerName=Micro-Manager-1.4
AppPublisher=UCSF
AppPublisherURL=http://www.micro-manager.org
AppSupportURL=http://www.micro-manager.org
AppUpdatesURL=http://www.micro-manager.org
DefaultDirName=C:/Program Files/Micro-Manager-1.4
DefaultGroupName=Micro-Manager-1.4
OutputBaseFilename=MMSetup_{#MMArch_bits}bit
Compression=lzma
SolidCompression=true
VersionInfoVersion=1.4
VersionInfoCompany=(c)University of California San Francisco
VersionInfoCopyright=(c)University of California San Francisco, (c)100XImaging Inc
AppCopyright=University of California San Francisco, 100XImaging Inc
ShowLanguageDialog=yes
AppVersion=1.4
AppID=31830087-F23D-4198-B67D-AD4A2A69147F
#if MMArch == "x64"
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
#endif

[Languages]
Name: eng; MessagesFile: compiler:Default.isl

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

[InstallDelete]
; Remove VC++ 2008 Redistributable Package installed by previous versions
Type: filesandordirs; Name: {app}\Microsoft.VC90.ATL
Type: filesandordirs; Name: {app}\Microsoft.VC90.CRT
Type: filesandordirs; Name: {app}\Microsoft.VC90.MFC
Type: filesandordirs; Name: {app}\Microsoft.VC90.MFCLOC
Type: filesandordirs; Name: {app}\Microsoft.VC90.OPENMP

[Files]
Source: "..\..\3rdparty\Microsoft\vcredist\2008SP1\vcredist_{#MMArch_x86x64}.exe"; DestDir: "{app}"; DestName: "vcredist_{#MMArch_x86x64}_2008SP1.exe"; Flags: deleteafterinstall
Source: "..\..\3rdparty\Microsoft\vcredist\2010SP1\vcredist_{#MMArch_x86x64}.exe"; DestDir: "{app}"; DestName: "vcredist_{#MMArch_x86x64}_2010SP1.exe"; Flags: deleteafterinstall

[Run]
Filename: "{app}\vcredist_{#MMArch_x86x64}_2008SP1.exe"; Parameters: "/q"; Description: "Microsoft Visual C++ 2008 SP1 Redistributable Package"; StatusMsg: "Installing Microsoft Visual C++ 2008 SP1 Redistributable Package"
Filename: "{app}\vcredist_{#MMArch_x86x64}_2010SP1.exe"; Parameters: "/q"; Description: "Microsoft Visual C++ 2010 SP1 Redistributable Package"; StatusMsg: "Installing Microsoft Visual C++ 2010 SP1 Redistributable Package"

[Files]

; Java Runtime
Source: ..\stage\Release\{#MMArch}\jre\*; DestDir: {app}\jre; Flags: ignoreversion recursesubdirs createallsubdirs

; Vendor DLLs
; Please keep in ASCII lexical order!
; TODO Include these from a separate file
#if MMArch == "x64"
Source: ..\stage\Release\x64\FxLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\LaserCombinerSDK64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\PCO_Kamlib64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\SysInfo.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\TIS_DShowLib10_x64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\TIS_UDSHL10_x64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\XCLIBW64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\atmcd64d.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\hidapi.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\hrfw64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\inpoutx64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\libusb0.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\mcam64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\mcammr64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\mrc564.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\mrfw64.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\opencv_core231.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\x64\opencv_highgui231.dll; DestDir: {app}; Flags: ignoreversion
#else
Source: ..\stage\Release\Win32\DSLRRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\FireCamJ.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\FxLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\LaserCombinerSDK.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\MexJCam.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\NKRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\PCO_Kamlib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\PSRemoteLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\ProcessLib.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\SysInfo.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\TIS_DShowLib10.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\TIS_UDSHL10.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\XCLIBWNT.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\atmcd32d.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\camconj.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\hidapi.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\hrfw.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\inpout32.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\libusb0.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\mcam.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\mcammr.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\mrc5.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\mrfw.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\opencv_core231.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\opencv_highgui231.dll; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\Win32\usb_main.bin; DestDir: {app}; Flags: ignoreversion
#endif

; Olympus IX*3 control module
Source: ..\stage\Release\{#MMArch}\OlympusIX3Control\*; DestDir: {app}\OlympusIX3Control; Flags: ignoreversion recursesubdirs createallsubdirs

; Java wrapper
Source: ..\stage\Release\{#MMArch}\MMCoreJ_wrap.dll; DestDir: {app}; Flags: ignoreversion

; device adapters
Source: ..\stage\Release\{#MMArch}\mmgr_dal_*.dll; DestDir: {app}; Flags: ignoreversion

; python wrapper
Source: ..\stage\Release\{#MMArch}\_MMCorePy.pyd; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\{#MMArch}\MMCorePy.py; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\{#MMArch}\MMCoreWrapDemo.py; DestDir: {app}; Flags: ignoreversion

; beanshell scripts
Source: ..\stage\Release\{#MMArch}\scripts\*; DestDir: {app}\scripts; Flags: ignoreversion

; configuration files
Source: ..\stage\Release\{#MMArch}\MMConfig_demo.cfg; DestDir: {app}; Flags: ignoreversion

; ImageJ files
Source: ..\stage\Release\{#MMArch}\ImageJ.exe; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\{#MMArch}\ImageJ.cfg; DestDir: {app}; Flags: onlyifdoesntexist; Permissions: users-modify
Source: ..\stage\Release\{#MMArch}\ij.jar; DestDir: {app}; Flags: ignoreversion
Source: ..\stage\Release\{#MMArch}\IJ_Prefs.txt; DestDir: {app}; Flags: onlyifdoesntexist
Source: ..\stage\Release\{#MMArch}\macros\*; DestDir: {app}\macros; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ..\stage\Release\{#MMArch}\plugins\*; DestDir: {app}\plugins; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ..\stage\Release\{#MMArch}\mmplugins\*; DestDir: {app}\mmplugins; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ..\stage\Release\{#MMArch}\mmautofocus\*; DestDir: {app}\mmautofocus; Flags: ignoreversion recursesubdirs createallsubdirs

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: "{app}"; Permissions: users-modify
; TODO Test if subdir permissions really need to be set here.
Name: "{app}\macros"; Permissions: users-modify
Name: "{app}\plugins"; Permissions: users-modify
Name: "{app}\mmplugins"; Permissions: users-modify
Name: "{app}\mmautofocus"; Permissions: users-modify

[Icons]
Name: {group}\Micro-Manager-1.4; Filename: {app}\ImageJ.exe; WorkingDir: {app}
Name: {group}\{cm:UninstallProgram,Micro-Manager-1.4}; Filename: {uninstallexe}
Name: {commondesktop}\Micro-Manager 1.4; Filename: {app}\ImageJ.exe; Tasks: desktopicon; WorkingDir: {app}; IconIndex: 0

[Run]
Filename: "{app}\ImageJ.exe"; WorkingDir: "{app}"; Description: {cm:LaunchProgram,Micro-Manager-1.4}; Flags: nowait postinstall skipifsilent


Remove msvcr100 file causing packager error for newer java versions

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bitsquare with application files
[Setup]
AppId={{bitsquare}}
AppName=Bitsquare
AppVersion=0.3.2.2
AppVerName=Bitsquare
AppPublisher=Bitsquare
AppComments=Bitsquare
AppCopyright=Copyright (C) 2016
AppPublisherURL=https://bitsquare.io
AppSupportURL=https://bitsquare.io
;AppUpdatesURL=http://java.com/
DefaultDirName={localappdata}\Bitsquare
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
DefaultGroupName=Bitsquare
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Bitsquare
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=Bitsquare\Bitsquare.ico
UninstallDisplayIcon={app}\Bitsquare.ico
UninstallDisplayName=Bitsquare
WizardImageStretch=No
WizardSmallImageFile=Bitsquare-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=Yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "Bitsquare\Bitsquare.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bitsquare\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Bitsquare"; Filename: "{app}\Bitsquare.exe"; IconFilename: "{app}\Bitsquare.ico"; Check: returnTrue()
Name: "{commondesktop}\Bitsquare"; Filename: "{app}\Bitsquare.exe";  IconFilename: "{app}\Bitsquare.ico"; Check: returnFalse()

[Run]
Filename: "{app}\Bitsquare.exe"; Description: "{cm:LaunchProgram,Bitsquare}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Bitsquare.exe"; Parameters: "-install -svcName ""Bitsquare"" -svcDesc ""Bitsquare"" -mainExe ""Bitsquare.exe""  "; Check: returnFalse()

[UninstallRun]
Filename: "{app}\Bitsquare.exe "; Parameters: "-uninstall -svcName Bitsquare -stopOnUninstall"; Check: returnFalse()

[Code]
function returnTrue(): Boolean;
begin
  Result := True;
end;

function returnFalse(): Boolean;
begin
  Result := False;
end;

function InitializeSetup(): Boolean;
begin
// Possible future improvements:
//   if version less or same => just launch app
//   if upgrade => check if same app is running and wait for it to exit
//   Add pack200/unpack200 support?
  Result := True;
end;

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bitsquare with application files
[Setup]
AppId={{bitsquare}}
AppName=Bitsquare
AppVersion=0.3.2.2
AppVerName=Bitsquare
AppPublisher=Bitsquare
AppComments=Bitsquare
AppCopyright=Copyright (C) 2014
AppPublisherURL=https://bitsquare.io
AppSupportURL=https://bitsquare.io
;AppUpdatesURL=http://java.com/
DefaultDirName={localappdata}\Bitsquare
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=Yes
DisableFinishedPage=Yes
DisableWelcomePage=Yes
DefaultGroupName=Bitsquare
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename=Bitsquare
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=Bitsquare\Bitsquare.ico
UninstallDisplayIcon={app}\Bitsquare.ico
UninstallDisplayName=Bitsquare
WizardImageStretch=No
WizardSmallImageFile=Bitsquare-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ChangesAssociations=Yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "Bitsquare\Bitsquare.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bitsquare\runtime\jre\bin\plugin2\msvcr100.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bitsquare\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Bitsquare"; Filename: "{app}\Bitsquare.exe"; IconFilename: "{app}\Bitsquare.ico"; Check: returnTrue()
Name: "{commondesktop}\Bitsquare"; Filename: "{app}\Bitsquare.exe";  IconFilename: "{app}\Bitsquare.ico"; Check: returnFalse()

[Run]
Filename: "{app}\Bitsquare.exe"; Description: "{cm:LaunchProgram,Bitsquare}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\Bitsquare.exe"; Parameters: "-install -svcName ""Bitsquare"" -svcDesc ""Bitsquare"" -mainExe ""Bitsquare.exe""  "; Check: returnFalse()

[UninstallRun]
Filename: "{app}\Bitsquare.exe "; Parameters: "-uninstall -svcName Bitsquare -stopOnUninstall"; Check: returnFalse()

[Code]
function returnTrue(): Boolean;
begin
  Result := True;
end;

function returnFalse(): Boolean;
begin
  Result := False;
end;

function InitializeSetup(): Boolean;
begin
// Possible future improvements:
//   if version less or same => just launch app
//   if upgrade => check if same app is running and wait for it to exit
//   Add pack200/unpack200 support?
  Result := True;
end;


adding service description

adding service description

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.0.9"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: string; ValueName: "EventMessageFile"; ValueData: "%SystemRoot%\System32\EventCreate.exe"
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "TypeSupported"; ValueData: 7
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "CustomSource"; ValueData: 1
Root: HKLM; Subkey: "System\CurrentControlSet\Services\{#AppName}"; ValueType: string; ValueName: "Description"; ValueData: "ION Traffic Monitor"

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

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

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.0.9"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: string; ValueName: "EventMessageFile"; ValueData: "%SystemRoot%\System32\EventCreate.exe"
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "TypeSupported"; ValueData: 7
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "CustomSource"; ValueData: 1

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

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

[UninstallDelete]
Type: filesandordirs; Name: "{app}"


updated innosetup script for 0.2.5 package

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "AnnwvynSDK64"
#define MyAppVersion "0.2.5"
#define MyAppPublisher "Arthur (Ybalrid) Brainville"
#define MyAppURL "http://annwvyn.org/"

[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.)
CompressionThreads=8
AppId={{B94D9F2F-7B8F-4B38-933A-16F6220B656B}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Oculus\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Oculus\AnnwvynSDK64\Annwvyn\LICENSE
InfoAfterFile=C:\Oculus\AnnwvynSDK64\README.TXT
OutputDir=C:\Oculus\AnnwvynSetup64
OutputBaseFilename=setupAnnwvynSDKx64
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "C:\Oculus\AnnwvynSDK64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; Excludes: "*.sdf,*.ipch,*.pch, *.obj"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\RUNME-64.BAT"

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "AnnwvynSDK64"
#define MyAppVersion "0.2.4"
#define MyAppPublisher "Arthur (Ybalrid) Brainville"
#define MyAppURL "http://annwvyn.org/"

[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.)
CompressionThreads=8
AppId={{B94D9F2F-7B8F-4B38-933A-16F6220B656B}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Oculus\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Oculus\AnnwvynSDK64\Annwvyn\LICENSE
InfoAfterFile=C:\Oculus\AnnwvynSDK64\README.TXT
OutputDir=C:\Oculus\AnnwvynSetup64
OutputBaseFilename=setupAnnwvynSDKx64
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "C:\Oculus\AnnwvynSDK64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; Excludes: "*.sdf,*.ipch,*.pch, *.obj, VS2015_Dependencies_AnnwvynSDK_64-OVR1.7.zip, Annvyn.0.2.4-experimental_dependencies.zip"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\RUNME-64.BAT"


Make a no-colon app name option

Make a no-colon app name option

; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Imperial Splendour: Rise of the Republic"
#define MyAppNameNoColon "Imperial Splendour - Rise of the Republic"
#define MyAppVersion "1.2"
#define MyAppPublisher "Imperial Splendour"
#define MyAppURL "https://imperialsplendour.com/"
#define MyAppExeName "ImperialSplendour.exe"
#define TmpFolder "ImperialSplendour"
#define UninstallDir "IS_Uninstall"
#define UninstallHelperExe "deactivator.exe"
#define SetupName "ImperialSplendourSetup"
#define ETWDefaultPath "steam\steamapp\common\Empire Total War"
#define CampaignPath "data\campaigns\imperial_splendour"

#define MyAppId "{{DC820B8B-AE7B-4555-AB8A-C1399266A06F}"

[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={#MyAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DisableDirPage=yes
DefaultDirName={commonpf}
AlwaysShowDirOnReadyPage=yes
DefaultGroupName={#MyAppName}
OutputBaseFilename={#SetupName}
Compression=lzma
SolidCompression=yes
; 10GB = 10,737,418,240
ExtraDiskSpaceRequired=10737418240
DirExistsWarning=yes
SetupIconFile=appicon.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallFilesDir={app}\{#UninstallDir}
DiskSpanning=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#TmpFolder}\*.*"; DestDir: "{app}"; Flags: recursesubdirs

[Dirs]
Name: "{app}\{#CampaignPath}"

[Icons]
Name: "{group}\{#MyAppNameNoColon}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppNameNoColon}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppNameNoColon}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\{#UninstallDir}\{#UninstallHelperExe}"; WorkingDir: "{app}"

[UninstallDelete]
Type: filesandordirs; Name: "{app}\{#UninstallDir}";

[CustomMessages]
NewerVersionExists=A newer version of {#MyAppName} is already installed.%n%nInstaller version: {#MyAppVersion}%nCurrent version:
ConfirmReinstall=It looks like you already have this version of {#MyAppName} installed. Do you want to re-install it?
ETWNotFound=Couldn''t find your Empire Total War installation. Please make sure you have it installed correctly and manually select the install folder.
InvalidPath=The install path you picked is invalid. Please check it and try again.
DeactivationError=There was an error preparing the upgrade. Please delete any remaining Imperial Splendour files manually and try again.

[Code]

var ExpectedPath: String;
var HasInstallation: Boolean;
var OldInstallLocation: string;
var
  StartupInfoPage: TInputQueryWizardPage;
  InputDirPage:    TInputDirWizardPage;

function InitializeSetup: Boolean;
var InstalledVersion: String;
var RegistryPath: string;
var RegistryPathX32: string;
var RegistryPathX64: string;
var IsX64: string;
begin
  RegistryPathX32 := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1');
  RegistryPathX64 := ExpandConstant('Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1');

  HasInstallation := RegValueExists(HKEY_LOCAL_MACHINE, RegistryPathX32, 'DisplayVersion');
  if HasInstallation then
    RegistryPath := RegistryPathX32
  else begin
    HasInstallation := RegValueExists(HKEY_LOCAL_MACHINE, RegistryPathX64, 'DisplayVersion')
    if HasInstallation then
      RegistryPath := RegistryPathX64
  end;

  if not HasInstallation then
  begin
    Result := True;
    Exit;
  end;

  RegQueryStringValue(HKEY_LOCAL_MACHINE, RegistryPath, 'DisplayVersion', InstalledVersion);
  if InstalledVersion > '{#MyAppVersion}' then begin
    MsgBox(ExpandConstant('{cm:NewerVersionExists} '+InstalledVersion), mbInformation, MB_OK);
    Result := False;
    Exit;
  end else if InstalledVersion = '{#MyAppVersion}' then begin
    if MsgBox(ExpandConstant('{cm:ConfirmReinstall}'), mbConfirmation, MB_OKCANCEL) = IDCANCEL then
      Result := false;
      Exit;
  end;

  RegQueryStringValue(HKEY_LOCAL_MACHINE, RegistryPath, 'InstallLocation', OldInstallLocation);
  Result := True;
end;

procedure InitializeWizard;
begin
  ExpectedPath := ExpandConstant('{commonpf}\{#ETWDefaultPath}');

  StartupInfoPage:= CreateInputQueryPage(wpWelcome,
    'Welcome',
    'Please read the following important information before continuing',
    'Requirements:'#13#10 +
    '- an Empire: Total War installation through Steam'#13#10 +
    '- at least 10GB of hard drive space'#13#10 +
    ''#13#10 +
    'NOTE: Having a different mod installed alongside Imperial Splendour can lead to issues when using the launcher. In this case, you can still use the installer but we recommend to switch between mods manually.');

  InputDirPage := CreateInputDirPage(StartupInfoPage.ID,
    'Select existing Empire: Total War Installation Location',
    '',
    'Imperial Splendour will be installed inside the following Empire: Total War folder.'#13#10 +
    ''#13#10 +
    'To continue, click Next. If you would like to select a different folder, click Browse. The folder should usually look something like this: C:\Program Files\steam\steamapp\common\Empire Total War',
    False, '');

  InputDirPage.Add('');
  if HasInstallation then
     InputDirPage.Values[0] := OldInstallLocation
  else if DirExists(ExpectedPath) then
    InputDirPage.Values[0] := ExpectedPath
  else
    InputDirPage.Values[0] := '';

end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = StartupInfoPage.ID then
    if InputDirPage.Values[0] = '' then
      MsgBox(ExpandConstant('{cm:ETWNotFound}'), mbError, MB_OK);

  if CurPageID = InputDirPage.ID then begin
    if not DirExists(InputDirPage.Values[0]) then begin
      MsgBox(ExpandConstant('{cm:InvalidPath}'), mbError, MB_OK);
      Result := false;
      Exit;
    end;

    WizardForm.DirEdit.Text := InputDirPage.Values[0];
  end;

  Result := true;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if PageID = InputDirPage.ID then begin
    if HasInstallation then
      Result := True;
      Exit;
  end;

  Result := False;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
var ResultCode: Integer;
begin
  if not HasInstallation then begin
    Result := '';
    Exit;
  end;

  if not Exec(ExpandConstant(WizardForm.DirEdit.Text + '\{#UninstallDir}\{#UninstallHelperExe}'), '-strict', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    Result := ExpandConstant('{cm:DeactivationError}')
  else
    Result := '';
end;

; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Imperial Splendour: Rise of the Republic"
#define MyAppVersion "1.2"
#define MyAppPublisher "Imperial Splendour"
#define MyAppURL "https://imperialsplendour.com/"
#define MyAppExeName "ImperialSplendour.exe"
#define TmpFolder "ImperialSplendour"
#define UninstallDir "IS_Uninstall"
#define UninstallHelperExe "deactivator.exe"
#define SetupName "ImperialSplendourSetup"
#define ETWDefaultPath "steam\steamapp\common\Empire Total War"
#define CampaignPath "data\campaigns\imperial_splendour"

#define MyAppId "{{DC820B8B-AE7B-4555-AB8A-C1399266A06F}"

[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={#MyAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DisableDirPage=yes
DefaultDirName={commonpf}
AlwaysShowDirOnReadyPage=yes
DefaultGroupName={#MyAppName}
OutputBaseFilename={#SetupName}
Compression=lzma
SolidCompression=yes
; 10GB = 10,737,418,240
ExtraDiskSpaceRequired=10737418240
DirExistsWarning=yes
SetupIconFile=appicon.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallFilesDir={app}\{#UninstallDir}
DiskSpanning=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Files]
Source: "{#TmpFolder}\*.*"; DestDir: "{app}"; Flags: recursesubdirs

[Dirs]
Name: "{app}\{#CampaignPath}"

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\{#UninstallDir}\{#UninstallHelperExe}"; WorkingDir: "{app}"

[UninstallDelete]
Type: filesandordirs; Name: "{app}\{#UninstallDir}";

[CustomMessages]
NewerVersionExists=A newer version of {#MyAppName} is already installed.%n%nInstaller version: {#MyAppVersion}%nCurrent version:
ConfirmReinstall=It looks like you already have this version of {#MyAppName} installed. Do you want to re-install it?
ETWNotFound=Couldn''t find your Empire Total War installation. Please make sure you have it installed correctly and manually select the install folder.
InvalidPath=The install path you picked is invalid. Please check it and try again.
DeactivationError=There was an error preparing the upgrade. Please delete any remaining Imperial Splendour files manually and try again.

[Code]

var ExpectedPath: String;
var HasInstallation: Boolean;
var OldInstallLocation: string;
var
  StartupInfoPage: TInputQueryWizardPage;
  InputDirPage:    TInputDirWizardPage;

function InitializeSetup: Boolean;
var InstalledVersion: String;
var RegistryPath: string;
var RegistryPathX32: string;
var RegistryPathX64: string;
var IsX64: string;
begin
  RegistryPathX32 := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1');
  RegistryPathX64 := ExpandConstant('Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1');

  HasInstallation := RegValueExists(HKEY_LOCAL_MACHINE, RegistryPathX32, 'DisplayVersion');
  if HasInstallation then
    RegistryPath := RegistryPathX32
  else begin
    HasInstallation := RegValueExists(HKEY_LOCAL_MACHINE, RegistryPathX64, 'DisplayVersion')
    if HasInstallation then
      RegistryPath := RegistryPathX64
  end;

  if not HasInstallation then
  begin
    Result := True;
    Exit;
  end;

  RegQueryStringValue(HKEY_LOCAL_MACHINE, RegistryPath, 'DisplayVersion', InstalledVersion);
  if InstalledVersion > '{#MyAppVersion}' then begin
    MsgBox(ExpandConstant('{cm:NewerVersionExists} '+InstalledVersion), mbInformation, MB_OK);
    Result := False;
    Exit;
  end else if InstalledVersion = '{#MyAppVersion}' then begin
    if MsgBox(ExpandConstant('{cm:ConfirmReinstall}'), mbConfirmation, MB_OKCANCEL) = IDCANCEL then
      Result := false;
      Exit;
  end;

  RegQueryStringValue(HKEY_LOCAL_MACHINE, RegistryPath, 'InstallLocation', OldInstallLocation);
  Result := True;
end;

procedure InitializeWizard;
begin
  ExpectedPath := ExpandConstant('{commonpf}\{#ETWDefaultPath}');

  StartupInfoPage:= CreateInputQueryPage(wpWelcome,
    'Welcome',
    'Please read the following important information before continuing',
    'Requirements:'#13#10 +
    '- an Empire: Total War installation through Steam'#13#10 +
    '- at least 10GB of hard drive space'#13#10 +
    ''#13#10 +
    'NOTE: Having a different mod installed alongside Imperial Splendour can lead to issues when using the launcher. In this case, you can still use the installer but we recommend to switch between mods manually.');

  InputDirPage := CreateInputDirPage(StartupInfoPage.ID,
    'Select existing Empire: Total War Installation Location',
    '',
    'Imperial Splendour will be installed inside the following Empire: Total War folder.'#13#10 +
    ''#13#10 +
    'To continue, click Next. If you would like to select a different folder, click Browse. The folder should usually look something like this: C:\Program Files\steam\steamapp\common\Empire Total War',
    False, '');

  InputDirPage.Add('');
  if HasInstallation then
     InputDirPage.Values[0] := OldInstallLocation
  else if DirExists(ExpectedPath) then
    InputDirPage.Values[0] := ExpectedPath
  else
    InputDirPage.Values[0] := '';

end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = StartupInfoPage.ID then
    if InputDirPage.Values[0] = '' then
      MsgBox(ExpandConstant('{cm:ETWNotFound}'), mbError, MB_OK);

  if CurPageID = InputDirPage.ID then begin
    if not DirExists(InputDirPage.Values[0]) then begin
      MsgBox(ExpandConstant('{cm:InvalidPath}'), mbError, MB_OK);
      Result := false;
      Exit;
    end;

    WizardForm.DirEdit.Text := InputDirPage.Values[0];
  end;

  Result := true;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if PageID = InputDirPage.ID then begin
    if HasInstallation then
      Result := True;
      Exit;
  end;

  Result := False;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
var ResultCode: Integer;
begin
  if not HasInstallation then begin
    Result := '';
    Exit;
  end;

  if not Exec(ExpandConstant(WizardForm.DirEdit.Text + '\{#UninstallDir}\{#UninstallHelperExe}'), '-strict', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    Result := ExpandConstant('{cm:DeactivationError}')
  else
    Result := '';
end;


Updated release/solid.iss for auto version by build script

[_ISTool]
EnableISX=true

[Setup]
AppName=Solid
AppVerName=Solid ${version}
MinVersion=4.1,4.0
DefaultDirName={pf}\Solid
DefaultGroupName=Solid
UninstallDisplayIcon={app}\Solid.exe
Compression=lzma
SolidCompression=true
OutputBaseFilename=SolidSetup
AppCopyright=2007 SIL International and Payap University
VersionInfoVersion=${version}
VersionInfoCompany=palaso.org Payap Language Software Group
VersionInfoDescription=Solid MDF Lexicon Checker
DisableDirPage=true
CreateUninstallRegKey=false
AppID={{6f3075b4-e668-41e6-8e16-75503b24dfee}
VersionInfoCopyright=2007 palaso.org
DisableProgramGroupPage=true
AlwaysShowComponentsList=false
ShowComponentSizes=false
FlatComponentsList=false
UsePreviousSetupType=false
AlwaysShowDirOnReadyPage=false
AlwaysShowGroupOnReadyPage=false
TerminalServicesAware=false
DisableStartupPrompt=true
DisableReadyPage=true

[Dirs]
Name: {app}\mappings
Name: {app}\exporters
Name: {app}\templates
Name: {userdocs}\Solid Examples

[Files]
Source: ..\..\..\..\..\Program Files\ISTool\isxdl.dll; Flags: dontcopy
Source: ..\output\release\Solid.exe; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\SolidEngine.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\KeymanLink.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoReporting.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoUIWindowsForms.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\mappings\MappingXmlToHtml.xsl; DestDir: {app}\mappings
Source: ..\mappings\FLEX.mappingSystem; DestDir: {app}\mappings
Source: ..\mappings\LIFT.mappingSystem; DestDir: {app}\mappings
Source: ..\exporters\StructuredXml.xml; DestDir: {app}\exporters
Source: ..\exporters\FlatXml.xml; DestDir: {app}\exporters
Source: ..\exporters\solid2lift.xslt; DestDir: {app}\exporters
Source: ..\exporters\Lift.xml; DestDir: {app}\exporters
Source: ..\exporters\Solid2LiftAlt.xslt; DestDir: {app}\exporters
Source: ..\exporters\LiftAlt.xml; DestDir: {app}\exporters
Source: ..\templates\MDF Unicode.solid; DestDir: {app}\templates
Source: ..\templates\MDF Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Unicode.solid; DestDir: {app}\templates
Source: ..\Solid Examples\BambaraSolidDemo.db; DestDir: {userdocs}\Solid Examples
Source: ..\Solid Examples\BambaraTutorial2.db; DestDir: {userdocs}\Solid Examples

[Messages]
WinVersionTooLowError=Solid requires Windows NT4, Windows 98 or later.

[Icons]
Name: {group}\Solid; Filename: {app}\Solid.exe
Name: {group}\Uninstall Solid; Filename: {uninstallexe}

[Code]
var
  dotnetRedistPath: string;
  downloadNeeded: boolean;
  dotNetNeeded: boolean;
  memoDependenciesNeeded: string;

procedure isxdl_AddFile(URL, Filename: PChar);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://palaso.org/install/dotnet2/dotnetfx.exe';
  // local system for testing...
  //dotnetRedistURL = 'http://localhost/install/dotnet2/dotnetfx.exe';

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;

  // For testing
  //dotNetNeeded := true;
  //downloadNeeded := true;
  //SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));

end;

function NextButtonClick(CurPage: Integer): Boolean;
var
  hWnd: Integer;
  ResultCode: Integer;

begin
  Result := true;

  if CurPage = wpWelcome then begin

    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));

    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  s: string;

begin
  if memoDependenciesNeeded <> '' then s := s + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;
[Run]
Filename: {app}\Solid.exe; WorkingDir: {userdocs}\Solid Examples; Flags: nowait postinstall

[_ISTool]
EnableISX=true

[Setup]
AppName=Solid
AppVerName=Solid 0.8.4.3
MinVersion=4.1,4.0
DefaultDirName={pf}\Solid
DefaultGroupName=Solid
UninstallDisplayIcon={app}\Solid.exe
Compression=lzma
SolidCompression=true
OutputBaseFilename=SolidSetup
AppCopyright=2007 SIL International and Payap University
VersionInfoVersion=0.8.4.3
VersionInfoCompany=palaso.org Payap Language Software Group
VersionInfoDescription=Solid MDF Lexicon Checker
DisableDirPage=true
CreateUninstallRegKey=false
AppID={{6f3075b4-e668-41e6-8e16-75503b24dfee}
VersionInfoCopyright=2007 palaso.org
DisableProgramGroupPage=true
AlwaysShowComponentsList=false
ShowComponentSizes=false
FlatComponentsList=false
UsePreviousSetupType=false
AlwaysShowDirOnReadyPage=false
AlwaysShowGroupOnReadyPage=false
TerminalServicesAware=false
DisableStartupPrompt=true
DisableReadyPage=true

[Dirs]
Name: {app}\mappings
Name: {app}\exporters
Name: {app}\templates
Name: {userdocs}\Solid Examples

[Files]
Source: ..\..\..\..\..\Program Files\ISTool\isxdl.dll; Flags: dontcopy
Source: ..\output\release\Solid.exe; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\SolidEngine.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\KeymanLink.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoReporting.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoUIWindowsForms.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\mappings\MappingXmlToHtml.xsl; DestDir: {app}\mappings
Source: ..\mappings\FLEX.mappingSystem; DestDir: {app}\mappings
Source: ..\mappings\LIFT.mappingSystem; DestDir: {app}\mappings
Source: ..\exporters\StructuredXml.xml; DestDir: {app}\exporters
Source: ..\exporters\FlatXml.xml; DestDir: {app}\exporters
Source: ..\exporters\solid2lift.xslt; DestDir: {app}\exporters
Source: ..\exporters\Lift.xml; DestDir: {app}\exporters
Source: ..\exporters\Solid2LiftAlt.xslt; DestDir: {app}\exporters
Source: ..\exporters\LiftAlt.xml; DestDir: {app}\exporters
Source: ..\templates\MDF Unicode.solid; DestDir: {app}\templates
Source: ..\templates\MDF Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Unicode.solid; DestDir: {app}\templates
Source: ..\Solid Examples\BambaraSolidDemo.db; DestDir: {userdocs}\Solid Examples
Source: ..\Solid Examples\BambaraTutorial2.db; DestDir: {userdocs}\Solid Examples

[Messages]
WinVersionTooLowError=Solid requires Windows NT4, Windows 98 or later.

[Icons]
Name: {group}\Solid; Filename: {app}\Solid.exe
Name: {group}\Uninstall Solid; Filename: {uninstallexe}

[Code]
var
  dotnetRedistPath: string;
  downloadNeeded: boolean;
  dotNetNeeded: boolean;
  memoDependenciesNeeded: string;

procedure isxdl_AddFile(URL, Filename: PChar);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://palaso.org/install/dotnet2/dotnetfx.exe';
  // local system for testing...
  //dotnetRedistURL = 'http://localhost/install/dotnet2/dotnetfx.exe';

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;

  // For testing
  //dotNetNeeded := true;
  //downloadNeeded := true;
  //SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));

end;

function NextButtonClick(CurPage: Integer): Boolean;
var
  hWnd: Integer;
  ResultCode: Integer;

begin
  Result := true;

  if CurPage = wpWelcome then begin

    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));

    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  s: string;

begin
  if memoDependenciesNeeded <> '' then s := s + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;
[Run]
Filename: {app}\Solid.exe; WorkingDir: {userdocs}\Solid Examples; Flags: nowait postinstall