; This is version ; 0.01 ; Maintainer: Bernd Nowak ; You need the Inno Setup Quickpack to use it. ; Homepage: http://www.jrsoftware.org/isinfo.php ; Download: http://files.jrsoftware.org/ispack/ispack-5.2.2.exe ; ; History ; Original version released to the public ; 0.01 #define moddir ReadIni(".\edits\install.ini","installinfo", "modDirectory") #define dialogtitle ReadIni(".\edits\install.ini","installinfo", "dialogTitle") #define name ReadIni(".\edits\install.ini","installinfo", "name") #define author ReadIni(".\edits\install.ini","installinfo", "author") #define version ReadIni(".\edits\install.ini","installinfo", "version") #if "" == version #define version "1.00" #endif #if "" == author #define author "Close Combat Last Stand Arnhem Mod Installer" #endif #define screenshot "false" #if fileexists(".\edits\screenshot.bmp") #define screenshot "true" #endif ; Additional checks and messages to help #if "" == modDir #error You must fill in a value for modDirectory in the .\edits\INSTALL.INI file before compiling. This is mandatory ! #endif #if "" == dialogtitle #error You must fill in a value for dialogtitle in the .\edits\INSTALL.INI file before compiling. This is mandatory ! #endif #if "" == name #error You must fill in a value for name in the .\edits\INSTALL.INI file before compiling. This is mandatory ! #endif [Setup] OutputBaseFilename=CCLSAMod{#moddir}v{#version} AppCopyright={#author} AppName={#name} AppVerName={#name} DefaultDirName={code:GetDefaultPathRegistry|'C:\Matrix Games\Close Combat Last Stand Arnhem'} UsePreviousAppDir=false DirExistsWarning=no AllowUNCPath=false AppendDefaultDirName=false DisableProgramGroupPage=true UsePreviousGroup=false ShowLanguageDialog=no SetupIconFile=.\edits\modinstaller.ico WizardImageFile=.\edits\WizardLeftImage.bmp WizardSmallImageFile=.\edits\WizardSmallImage.bmp Compression=lzma/ultra Uninstallable=true UninstallDisplayName={#name} UninstallFilesDir={app}\mods\{#name} VersionInfoVersion={#version} VersionInfoCompany={#author} VersionInfoDescription={#name} VersionInfoTextVersion={#name} VersionInfoCopyright={#author} PrivilegesRequired=admin DefaultGroupName=Close Combat Last Stand Arnhem\{#name} [Components] Name: "ovm1"; Description: "Standard OVM"; Flags: exclusive Name: "ovm2"; Description: "Enhanced OVM with Contour Lines"; Flags: exclusive [Tasks] Name: desktopicon; Description: Create a Steam &desktop icon; GroupDescription: Additional icons: Name: desktopicon1; Description: Create a Matrix &desktop icon; GroupDescription: Additional icons: [Icons] Name: {group}\Steam {#name}; Filename: {app}\autorun.exe; Parameters: " /D {#moddir}"; WorkingDir: {app}; IconFilename: {app}\{#moddir}\mod.ico; IconIndex: 0 Name: {userdesktop}\Steam {#name}; Filename: {app}\autorun.exe; Tasks: desktopicon; Parameters: " /D {#moddir}"; WorkingDir: {app}; IconFilename: {app}\{#moddir}\mod.ico; IconIndex: 0 Name: {group}\Matrix {#name}; Filename: {app}\CCE.exe; Parameters: " /D {#moddir}"; WorkingDir: {app}; IconFilename: {app}\{#moddir}\mod.ico; IconIndex: 0 Name: {userdesktop}\Matrix {#name}; Filename: {app}\CCE.exe; Tasks: desktopicon1; Parameters: " /D {#moddir}"; WorkingDir: {app}; IconFilename: {app}\{#moddir}\mod.ico; IconIndex: 0 [Files] Tasks: desktopicon; Source: edits\autorun.exe; DestDir: {app}\; Flags: ignoreversion overwritereadonly uninsneveruninstall Source: edits\readme.txt; DestDir: {app}\{#moddir}; Flags: overwritereadonly ignoreversion isreadme Source: edits\mod.ico; DestDir: {app}\{#moddir}; Flags: overwritereadonly ignoreversion Source: mod\*.*; DestDir: {app}\{#moddir}; Flags: overwritereadonly ignoreversion recursesubdirs createallsubdirs Source: edits\StandardOVM\*.*; DestDir: {app}\{#moddir}\MAPS; Components: ovm1 Source: edits\CustomOVM\*.*; DestDir: {app}\{#moddir}\MAPS; Components: ovm2 [Registry] Root: HKLM; Subkey: SOFTWARE\CCLSA\Mods; ValueType: string; ValueName: CCLSAPath; ValueData: {app}; Flags: deletevalue noerror; Components: [CustomMessages] modinstallchoices_Caption=Please choose your options modinstallchoices_Description=Adjust the setup and read the notes checkccLSA=No CCE.exe found in your destination directory ! Please select a valid destination directory [Messages] AdminPrivilegesRequired=The Installer needs Admin rights ! SetupWindowTitle={#dialogtitle} SetupAppTitle={#name} WelcomeLabel1={#name} WelcomeLabel2=This will install/update CCLSA Mod: {#name} {#version} on your computer.%n%nIt is recommended that you close all other applications before continuing. WizardSelectDir=Select your CCLSA directory (usually C:\Matrix Games\Close Combat Last Stand Arnhem) SelectDirLabel3=The CCLSA Mod Installer will add/update {#name} {#version} to the following selected CCLSA Installation. SelectDirBrowseLabel=To continue, click Next. If you would like to select a different CCLSA Installation, click Browse. SelectDirDesc=Where is your Close Combat Last Stand Arnhem base directory ? [Code] function GetDefaultPathRegistry(DefaultPath: string): string; begin if not RegQueryStringValue(HKLM,'SOFTWARE\CCLSA\Mods','CCLSAPath',Result) then begin if not RegQueryStringValue(HKLM,'SOFTWARE\Matrix Games\Close Combat Last Stand Arnhem','installed to',Result) then begin Result := ExpandConstant(DefaultPath); end; end; end; function checkmoddir():boolean; var moddir : String; begin result :=false; moddir := ExpandConstant('{app}')+'\{#moddir}'; // Check if moddir exist if DirExists(moddir) then begin if msgbox('It looks like the mod has been installed because the installer found this moddir:' + #13 + moddir + #13 + 'depending on your choosen CCLSA directory !' + #13 + 'Do you want to adjust your CCLSA directory ?',mbConfirmation, MB_YESNO or MB_DEFBUTTON1)= IDYES then begin result:=true; end; end; end; procedure CurStepChanged(CurStep: TSetupStep); begin case CurStep of ssPostInstall: begin // end; end; end; function CheckCCLSA(Path: String):Boolean; begin Result:= FileExists(Path + '\CCE.EXE'); // MsgBox('File to check: ' + Path + '\CCe if not Result then MsgBox(ExpandConstant('{cm:checkccLSA}'), mbInformation, MB_OK) end; function NextButtonClick(CurPageID: Integer): boolean; begin result:=true; if CurPageID=wpSelectDir then begin // Check for CCE.exe in selected directory if not CheckCCLSA(WizardDirValue) then begin result:=false; exit; end; // if moddir is existing make a small warning if checkmoddir then begin result:=false; exit; end; end; end; procedure InitializeWizard(); begin // trackinstallchoices_CreatePage(wpSelectDir); end;