Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Script generated by the Inno Setup Script Wizard.
- ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
- #define MyAppName "Expansive Civilian Warfare"
- #define MyAppVersion "1.0.0"
- #define MyAppPublisher "Expansive Civilian Warfare"
- #define MyAppURL "http://expansivecivilianwarfare.com/"
- #define MyAppExeName "ECW.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={{E3A60976-1DE1-40E2-9915-02631397DF03}
- AppName={#MyAppName}
- AppVersion={#MyAppVersion}
- ;AppVerName={#MyAppName} {#MyAppVersion}
- AppPublisher={#MyAppPublisher}
- AppPublisherURL={#MyAppURL}
- AppSupportURL={#MyAppURL}
- AppUpdatesURL={#MyAppURL}
- DefaultDirName={pf}\{#MyAppName}
- DefaultGroupName={#MyAppName}
- AllowNoIcons=yes
- OutputBaseFilename=setup
- Compression=lzma
- SolidCompression=yes
- [Languages]
- Name: "english"; MessagesFile: "compiler:Default.isl"
- [Tasks]
- Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
- Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
- [Files]
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\ECW.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\_MOD_SCRIPTS.DLL"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\00000000.256"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\00000409.016"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\00000409.256"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\54251___.TTF"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\ARI_____.TTF"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\BandTest.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\bhs.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\binkw32.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Config.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\d3d8.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\d3d9.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\d3dx9_32.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\d3dx9_42.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\DataGridViewPercentageColumn.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\drvmgt.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game100.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game1000.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game150.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game200.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game2000.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game300.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game400.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game4000.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game500.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Game750.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\ICSharpCode.SharpZipLib.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\keycfg.exe"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Launcher.bmp"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Meebey.SmartIrc4net.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Mp3dec.asi"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Mss32.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Mssa3d.m3d"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Mssds3dh.m3d"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Msseax.m3d"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Msseax2.m3d"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Mssfast.m3d"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Notes.ico"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\patchget.dat"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\PATCHW32.DLL"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Renegade.lcf"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\RP2CSP.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\scripts.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\scripts2.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\shaders.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\SMAA.fx"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\SMAA.h"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\TabControlEX.dll"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Uninst.loc"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Uninst.wsu"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Update.bat"; DestDir: "{app}"; Flags: ignoreversion
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\Data\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\dxwebsetup.exe"; Flags: dontcopy
- ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
- [Icons]
- Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
- Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
- Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
- [Run]
- Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
- [Files]
- Source: "C:\Users\Brandan\Desktop\scripts\isxdl\isxdl.dll"; Flags: dontcopy
- [Code]
- //replace PAnsiChar with PChar on non-unicode Inno Setup
- procedure isxdl_AddFile(URL, Filename: PAnsiChar);
- external 'isxdl_AddFile@files:isxdl.dll stdcall';
- function isxdl_DownloadFiles(hWnd: Integer): Integer;
- external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
- //replace PAnsiChar with PChar on non-unicode Inno Setup
- function isxdl_SetOption(Option, Value: PAnsiChar): Integer;
- external 'isxdl_SetOption@files:isxdl.dll stdcall';
- [Files]
- Source: "C:\Users\Brandan\Desktop\scripts\isxdl\german2.ini"; Flags: dontcopy
- [Code]
- type
- TProduct = record
- File: String;
- Title: String;
- Parameters: String;
- InstallClean : boolean;
- MustRebootAfter : boolean;
- end;
- InstallResult = (InstallSuccessful, InstallRebootRequired, InstallError);
- var
- installMemo, downloadMemo, downloadMessage: string;
- products: array of TProduct;
- delayedReboot: boolean;
- DependencyPage: TOutputProgressWizardPage;
- procedure AddProduct(FileName, Parameters, Title, Size, URL: string; InstallClean : boolean; MustRebootAfter : boolean);
- var
- path: string;
- i: Integer;
- begin
- installMemo := installMemo + '%1' + Title + #13;
- path := ExpandConstant('{src}{\}') + CustomMessage('DependenciesDir') + '\' + FileName;
- if not FileExists(path) then begin
- path := ExpandConstant('{tmp}{\}') + FileName;
- isxdl_AddFile(URL, path);
- downloadMemo := downloadMemo + '%1' + Title + #13;
- downloadMessage := downloadMessage + ' ' + Title + ' (' + Size + ')' + #13;
- end;
- i := GetArrayLength(products);
- SetArrayLength(products, i + 1);
- products[i].File := path;
- products[i].Title := Title;
- products[i].Parameters := Parameters;
- products[i].InstallClean := InstallClean;
- products[i].MustRebootAfter := MustRebootAfter;
- end;
- function SmartExec(prod : TProduct; var ResultCode : Integer) : boolean;
- begin
- if (LowerCase(Copy(prod.File,Length(prod.File)-2,3)) = 'exe') then begin
- Result := Exec(prod.File, prod.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
- end else begin
- Result := ShellExec('', prod.File, prod.Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
- end;
- end;
- function PendingReboot : boolean;
- var names: String;
- begin
- if (RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'PendingFileRenameOperations', names)) then begin
- Result := true;
- end else if ((RegQueryMultiStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager', 'SetupExecute', names)) and (names <> '')) then begin
- Result := true;
- end else begin
- Result := false;
- end;
- end;
- function InstallProducts: InstallResult;
- var
- ResultCode, i, productCount, finishCount: Integer;
- begin
- Result := InstallSuccessful;
- productCount := GetArrayLength(products);
- if productCount > 0 then begin
- DependencyPage := CreateOutputProgressPage(CustomMessage('depinstall_title'), CustomMessage('depinstall_description'));
- DependencyPage.Show;
- for i := 0 to productCount - 1 do begin
- if (products[i].InstallClean and (delayedReboot or PendingReboot())) then begin
- Result := InstallRebootRequired;
- break;
- end;
- DependencyPage.SetText(FmtMessage(CustomMessage('depinstall_status'), [products[i].Title]), '');
- DependencyPage.SetProgress(i, productCount);
- if SmartExec(products[i], ResultCode) then begin
- //setup executed; ResultCode contains the exit code
- //MsgBox(products[i].Title + ' install executed. Result Code: ' + IntToStr(ResultCode), mbInformation, MB_OK);
- if (products[i].MustRebootAfter) then begin
- //delay reboot after install if we installed the last dependency anyways
- if (i = productCount - 1) then begin
- delayedReboot := true;
- end else begin
- Result := InstallRebootRequired;
- end;
- break;
- end else if (ResultCode = 0) then begin
- finishCount := finishCount + 1;
- end else if (ResultCode = 3010) then begin
- //ResultCode 3010: A restart is required to complete the installation. This message indicates success.
- delayedReboot := true;
- finishCount := finishCount + 1;
- end else begin
- Result := InstallError;
- break;
- end;
- end else begin
- //MsgBox(products[i].Title + ' install failed. Result Code: ' + IntToStr(ResultCode), mbInformation, MB_OK);
- Result := InstallError;
- break;
- end;
- end;
- //only leave not installed products for error message
- for i := 0 to productCount - finishCount - 1 do begin
- products[i] := products[i+finishCount];
- end;
- SetArrayLength(products, productCount - finishCount);
- DependencyPage.Hide;
- end;
- end;
- function PrepareToInstall(var NeedsRestart: boolean): String;
- var
- i: Integer;
- s: string;
- begin
- delayedReboot := false;
- case InstallProducts() of
- InstallError: begin
- s := CustomMessage('depinstall_error');
- for i := 0 to GetArrayLength(products) - 1 do begin
- s := s + #13 + ' ' + products[i].Title;
- end;
- Result := s;
- end;
- InstallRebootRequired: begin
- Result := products[0].Title;
- NeedsRestart := true;
- //write into the registry that the installer needs to be executed again after restart
- RegWriteStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce', 'InstallBootstrap', ExpandConstant('{srcexe}'));
- end;
- end;
- end;
- function NeedRestart : boolean;
- begin
- if (delayedReboot) then
- Result := true;
- end;
- function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
- var
- s: string;
- begin
- if downloadMemo <> '' then
- s := s + CustomMessage('depdownload_memo_title') + ':' + NewLine + FmtMessage(downloadMemo, [Space]) + NewLine;
- if installMemo <> '' then
- s := s + CustomMessage('depinstall_memo_title') + ':' + NewLine + FmtMessage(installMemo, [Space]) + NewLine;
- s := s + MemoDirInfo + NewLine + NewLine + MemoGroupInfo
- if MemoTasksInfo <> '' then
- s := s + NewLine + NewLine + MemoTasksInfo;
- Result := s
- end;
- function NextButtonClick(CurPageID: Integer): boolean;
- begin
- Result := true;
- if CurPageID = wpReady then begin
- if downloadMemo <> '' then begin
- //change isxdl language only if it is not english because isxdl default language is already english
- if (ActiveLanguage() <> 'en') then begin
- ExtractTemporaryFile(CustomMessage('isxdl_langfile'));
- isxdl_SetOption('language', ExpandConstant('{tmp}{\}') + CustomMessage('isxdl_langfile'));
- end;
- //isxdl_SetOption('title', FmtMessage(SetupMessage(msgSetupWindowTitle), [CustomMessage('appname')]));
- if SuppressibleMsgBox(FmtMessage(CustomMessage('depdownload_msg'), [downloadMessage]), mbConfirmation, MB_YESNO, IDYES) = IDNO then
- Result := false
- else if isxdl_DownloadFiles(StrToInt(ExpandConstant('{wizardhwnd}'))) = 0 then
- Result := false;
- end;
- end;
- end;
- function IsX86: boolean;
- begin
- Result := (ProcessorArchitecture = paX86) or (ProcessorArchitecture = paUnknown);
- end;
- function IsX64: boolean;
- begin
- Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
- end;
- function IsIA64: boolean;
- begin
- Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64);
- end;
- function GetString(x86, x64, ia64: String): String;
- begin
- if IsX64() and (x64 <> '') then begin
- Result := x64;
- end else if IsIA64() and (ia64 <> '') then begin
- Result := ia64;
- end else begin
- Result := x86;
- end;
- end;
- function GetArchitectureString(): String;
- begin
- if IsX64() then begin
- Result := '_x64';
- end else if IsIA64() then begin
- Result := '_ia64';
- end else begin
- Result := '';
- end;
- end;
- [Code]
- type
- NetFXType = (NetFx10, NetFx11, NetFx20, NetFx30, NetFx35, NetFx40Client, NetFx40Full);
- const
- netfx11plus_reg = 'Software\Microsoft\NET Framework Setup\NDP\';
- function netfxinstalled(version: NetFXType; lcid: string): boolean;
- var
- regVersion: cardinal;
- regVersionString: string;
- begin
- if (lcid <> '') then
- lcid := '\' + lcid;
- if (version = NetFx10) then begin
- RegQueryStringValue(HKLM, 'Software\Microsoft\.NETFramework\Policy\v1.0\3705', 'Install', regVersionString);
- Result := regVersionString <> '';
- end else begin
- case version of
- NetFx11:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'Install', regVersion);
- NetFx20:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'Install', regVersion);
- NetFx30:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0\Setup' + lcid, 'InstallSuccess', regVersion);
- NetFx35:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'Install', regVersion);
- NetFx40Client:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Install', regVersion);
- NetFx40Full:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Install', regVersion);
- end;
- Result := (regVersion <> 0);
- end;
- end;
- function netfxspversion(version: NetFXType; lcid: string): integer;
- var
- regVersion: cardinal;
- begin
- if (lcid <> '') then
- lcid := '\' + lcid;
- case version of
- NetFx10:
- //not supported
- regVersion := -1;
- NetFx11:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'SP', regVersion)) then
- regVersion := -1;
- NetFx20:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'SP', regVersion)) then
- regVersion := -1;
- NetFx30:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0' + lcid, 'SP', regVersion)) then
- regVersion := -1;
- NetFx35:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'SP', regVersion)) then
- regVersion := -1;
- NetFx40Client:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Servicing', regVersion)) then
- regVersion := -1;
- NetFx40Full:
- if (not RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Servicing', regVersion)) then
- regVersion := -1;
- end;
- Result := regVersion;
- end;
- [Code]
- const
- dotnetfx40full_url = 'http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe';
- procedure dotnetfx40full();
- begin
- if (not netfxinstalled(NetFx40Full, '')) then
- AddProduct('dotNetFx40_Full_setup.exe',
- CustomMessage('dotnetfx40full_lcid') + '/q /passive /norestart',
- CustomMessage('dotnetfx40full_title'),
- CustomMessage('dotnetfx40full_size'),
- dotnetfx40full_url,
- false, false);
- end;
- procedure DecodeVersion( verstr: String; var verint: array of Integer );
- var
- i,p: Integer; s: string;
- begin
- verint := [0,0,0,0];
- i := 0;
- while ( (Length(verstr) > 0) and (i < 4) ) do
- begin
- p := pos('.', verstr);
- if p > 0 then
- begin
- if p = 1 then s:= '0' else s:= Copy( verstr, 1, p - 1 );
- verint[i] := StrToInt(s);
- i := i + 1;
- verstr := Copy( verstr, p+1, Length(verstr) );
- end
- else
- begin
- verint[i] := StrToInt( verstr );
- verstr := '';
- end;
- end;
- end;
- function CompareVersion( ver1, ver2: String ) : Integer;
- var
- verint1, verint2: array of Integer;
- i: integer;
- begin
- SetArrayLength( verint1, 4 );
- DecodeVersion( ver1, verint1 );
- SetArrayLength( verint2, 4 );
- DecodeVersion( ver2, verint2 );
- Result := 0; i := 0;
- while ( (Result = 0) and ( i < 4 ) ) do
- begin
- if verint1[i] > verint2[i] then
- Result := 1
- else
- if verint1[i] < verint2[i] then
- Result := -1
- else
- Result := 0;
- i := i + 1;
- end;
- end;
- function GetDirectXVersion(): String;
- var
- sVersion: String;
- begin
- sVersion := '';
- RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\DirectX', 'Version', sVersion );
- Result := sVersion;
- end;
- function InitializeSetup(): Boolean;
- var
- ResultCode: Integer;
- begin
- if CompareVersion( GetDirectXVersion(), '4.9.0.904') < 0 then
- begin
- Result := MsgBox('DirectX 9.0.904 or higher is needed but it has not been found. Do you wish to continue with the installation?',
- mbConfirmation, MB_YESNO) = idYes;
- if Result = False then begin
- MsgBox('Please upgrade your DirectX Version to at least least 9.0.904. (DirectX 9,0c aug 2009)', mbInformation, MB_OK);
- end
- else begin
- ExtractTemporaryFile('dxwebsetup.exe');
- // Launch Notepad and wait for it to terminate
- if Exec(ExpandConstant('{tmp}\dxwebsetup.exe'), '', '', SW_SHOW,
- ewWaitUntilTerminated, ResultCode) then
- begin
- // handle success if necessary; ResultCode contains the exit code
- end
- else begin
- // handle failure if necessary; ResultCode contains the error code
- end;
- end
- end
- else
- Result := true;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement