|
| 1 | +#include <idp.iss> |
| 2 | + |
| 3 | +#define SourceRoot SourcePath + "\..\Source" |
| 4 | +#define BinDir SourceRoot + "\bin\Release" |
| 5 | +#define OutputDir SourcePath + "\..\Release" |
| 6 | + |
| 7 | +#define MyAppName "Warframe Alert Tracker" |
| 8 | +#define MyAppExeName "WAT.exe" |
| 9 | +#define MyAppVersion RemoveFileExt(GetFileVersion(BinDir + "\" + MyAppExeName)) |
| 10 | +#define MyAppPublisher "ScriptFUSION" |
| 11 | +#define MyAppURL "https://github.com/ScriptFUSION/WAT" |
| 12 | + |
| 13 | +[Setup] |
| 14 | +AppId={{6FE66627-C1FC-4509-B914-BE115AFB98C2} |
| 15 | +AppName={#MyAppName} |
| 16 | +AppVersion={#MyAppVersion} |
| 17 | +AppPublisher={#MyAppPublisher} |
| 18 | +AppPublisherURL={#MyAppURL} |
| 19 | +AppSupportURL={#MyAppURL} |
| 20 | +AppUpdatesURL={#MyAppURL} |
| 21 | +DefaultDirName={pf}\{#MyAppPublisher}\{#MyAppName} |
| 22 | +DefaultGroupName={#MyAppPublisher}\{#MyAppName} |
| 23 | +LicenseFile={#SourceRoot}\..\LICENSE |
| 24 | +OutputDir={#OutputDir} |
| 25 | +OutputBaseFilename={#MyAppName} {#MyAppVersion} setup |
| 26 | +AllowNoIcons=yes |
| 27 | +SolidCompression=yes |
| 28 | + |
| 29 | +[Languages] |
| 30 | +Name: "english"; MessagesFile: "compiler:Default.isl" |
| 31 | + |
| 32 | +[Tasks] |
| 33 | +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked |
| 34 | +Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 |
| 35 | + |
| 36 | +[Files] |
| 37 | +Source: "{#BinDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion |
| 38 | +Source: "{#BinDir}\*.dll"; DestDir: "{app}"; Flags: ignoreversion |
| 39 | + |
| 40 | +[Icons] |
| 41 | +Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" |
| 42 | +Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" |
| 43 | +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" |
| 44 | +Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon |
| 45 | +Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon |
| 46 | + |
| 47 | +[Run] |
| 48 | +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent |
| 49 | + |
| 50 | +[Code] |
| 51 | +var |
| 52 | + dotNetInstaller: string; |
| 53 | +
|
| 54 | +procedure InitializeWizard; |
| 55 | +var |
| 56 | + netVersion: cardinal; |
| 57 | +begin |
| 58 | + dotNetInstaller := ExpandConstant('{tmp}\NetFrameworkInstaller.exe'); |
| 59 | +
|
| 60 | + RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', netVersion) |
| 61 | +
|
| 62 | + // .NET Framework version < 4.5.1. |
| 63 | + if (netVersion < 378675) then begin |
| 64 | + // Download .NET Framework 4.5.2 Web installer. |
| 65 | + idpAddFile('http://go.microsoft.com/fwlink/?LinkId=397707', dotNetInstaller); |
| 66 | + idpDownloadAfter(wpReady); |
| 67 | + end; |
| 68 | +end; |
| 69 | +
|
| 70 | +procedure InstallFramework; |
| 71 | +var |
| 72 | + StatusText: string; |
| 73 | + ResultCode: Integer; |
| 74 | +begin |
| 75 | + if not FileExists(dotNetInstaller) then exit; |
| 76 | +
|
| 77 | + StatusText := WizardForm.StatusLabel.Caption; |
| 78 | + WizardForm.StatusLabel.Caption := 'Installing .NET Framework 4.5.2. This may take a few minutes...'; |
| 79 | + WizardForm.ProgressGauge.Style := npbstMarquee; |
| 80 | + try |
| 81 | + if not Exec(dotNetInstaller, '/passive /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin |
| 82 | + MsgBox('.NET Framework installation failed: ' + SysErrorMessage(ResultCode) + ' (#' + IntToStr(ResultCode) + ').', mbError, MB_OK); |
| 83 | + end; |
| 84 | + finally |
| 85 | + WizardForm.StatusLabel.Caption := StatusText; |
| 86 | + WizardForm.ProgressGauge.Style := npbstNormal; |
| 87 | +
|
| 88 | + DeleteFile(dotNetInstaller); |
| 89 | + end; |
| 90 | +end; |
| 91 | +
|
| 92 | +procedure CurStepChanged(CurStep: TSetupStep); |
| 93 | +begin |
| 94 | + // Install .NET Framework before program files. |
| 95 | + if CurStep = ssInstall then InstallFramework; |
| 96 | +end; |
0 commit comments