installer: fix wintun hash check, pre-install exit code, WinForms guard, cmake arch
This commit is contained in:
parent
77678b51bc
commit
6f5e7bcfb3
1 changed files with 29 additions and 6 deletions
|
|
@ -12,6 +12,8 @@ OutputDir=dist
|
||||||
Compression=lzma2/ultra64
|
Compression=lzma2/ultra64
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
ArchitecturesInstallIn64BitMode=x64
|
ArchitecturesInstallIn64BitMode=x64
|
||||||
|
; DragonMoonlight embeds Wintun for WireGuard VPN functionality.
|
||||||
|
; Wintun requires a kernel-mode driver which must run as Administrator.
|
||||||
PrivilegesRequired=admin
|
PrivilegesRequired=admin
|
||||||
WizardStyle=modern
|
WizardStyle=modern
|
||||||
SetupIconFile=app\icon.ico
|
SetupIconFile=app\icon.ico
|
||||||
|
|
@ -34,7 +36,7 @@ Source: "{src}\dist\win\styles\*"; DestDir: "{app}\styles"; Flags: ignoreversion
|
||||||
Source: "{src}\dist\win\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
Source: "{src}\dist\win\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
||||||
Source: "{src}\dist\win\qml\*"; DestDir: "{app}\qml"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
Source: "{src}\dist\win\qml\*"; DestDir: "{app}\qml"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
||||||
Source: "{src}\dist\win\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
Source: "{src}\dist\win\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs skipifnotexists
|
||||||
Source: "{src}\package\win\pre-install.ps1"; DestDir: "{tmp}"; Flags: deleteafterinstall
|
Source: "{src}\package\win\pre-install.ps1"; DestDir: "{tmp}"; Flags: dontcopy deleteafterinstall
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{userdesktop}\DragonMoonlight"; Filename: "{app}\DragonMoonlight.exe"
|
Name: "{userdesktop}\DragonMoonlight"; Filename: "{app}\DragonMoonlight.exe"
|
||||||
|
|
@ -42,7 +44,6 @@ Name: "{group}\DragonMoonlight"; Filename: "{app}\DragonMoonlight.exe"
|
||||||
Name: "{group}\Uninstall DragonMoonlight"; Filename: "{uninstallexe}"
|
Name: "{group}\Uninstall DragonMoonlight"; Filename: "{uninstallexe}"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{tmp}\pre-install.ps1"""; Flags: runhidden waituntilterminated; Description: "Running pre-installation checks..."
|
|
||||||
Filename: "{app}\DragonMoonlight.exe"; Flags: nowait postinstall skipifsilent; Description: "Launch DragonMoonlight"
|
Filename: "{app}\DragonMoonlight.exe"; Flags: nowait postinstall skipifsilent; Description: "Launch DragonMoonlight"
|
||||||
|
|
||||||
[UninstallRun]
|
[UninstallRun]
|
||||||
|
|
@ -50,18 +51,40 @@ Filename: "powershell.exe"; Parameters: "-Command ""Get-Process DragonMoonlight
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
function InitializeSetup(): Boolean;
|
function InitializeSetup(): Boolean;
|
||||||
|
var
|
||||||
|
ResultCode: Integer;
|
||||||
begin
|
begin
|
||||||
|
// Check Windows version (Windows 10 or later)
|
||||||
if GetWindowsVersion() < $0A00 then
|
if GetWindowsVersion() < $0A00 then
|
||||||
begin
|
begin
|
||||||
MsgBox('DragonMoonlight requires Windows 10 or later.' + #13#13 +
|
MsgBox('DragonMoonlight requires Windows 10 or later.' + #13#13 +
|
||||||
'Your system does not meet the minimum requirements.',
|
'Your system does not meet the minimum requirements.',
|
||||||
mbCriticalError, MB_OK);
|
mbCriticalError, MB_OK);
|
||||||
Result := False;
|
Result := False;
|
||||||
end
|
Exit;
|
||||||
else
|
|
||||||
begin
|
|
||||||
Result := True;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Extract pre-install script to temporary directory
|
||||||
|
ExtractTemporaryFile('pre-install.ps1');
|
||||||
|
|
||||||
|
// Run pre-installation checks via PowerShell
|
||||||
|
if not Exec('powershell.exe',
|
||||||
|
'-ExecutionPolicy Bypass -NonInteractive -File "' + ExpandConstant('{tmp}') + '\pre-install.ps1"',
|
||||||
|
'', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
|
||||||
|
begin
|
||||||
|
MsgBox('Pre-installation checks could not run.', mbError, MB_OK);
|
||||||
|
Result := False;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Check exit code from pre-install script
|
||||||
|
if ResultCode <> 0 then
|
||||||
|
begin
|
||||||
|
Result := False; // InitializeSetup returns False = abort install
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure CurStepChanged(CurStep: TSetupStep);
|
procedure CurStepChanged(CurStep: TSetupStep);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue