mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-06 23:34:05 +02:00
Make update installer download the portable version for portable installations
This commit is contained in:
parent
ec2e26752a
commit
93e9f28d69
@ -39,14 +39,18 @@ Source: "..\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignorever
|
||||
Source: "..\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "*.xml,*.pdb,devtools_resources.pak,d3dcompiler_43.dll,widevinecdmadapter.dll,debug.js"
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent
|
||||
|
||||
[Code]
|
||||
var UpdatePath: String;
|
||||
|
||||
function TDGetNetFrameworkVersion: Cardinal; forward;
|
||||
|
||||
{ Check .NET Framework version on startup, ask user if they want to proceed if older than 4.5.2. }
|
||||
function InitializeSetup: Boolean;
|
||||
begin
|
||||
UpdatePath := ExpandConstant('{param:UPDATEPATH}')
|
||||
|
||||
if TDGetNetFrameworkVersion() >= 379893 then
|
||||
begin
|
||||
Result := True;
|
||||
@ -62,6 +66,21 @@ begin
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
{ Set the installation path if updating. }
|
||||
procedure InitializeWizard();
|
||||
begin
|
||||
if (UpdatePath <> '') then
|
||||
begin
|
||||
WizardForm.DirEdit.Text := UpdatePath;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ Skip the install path selection page if running from an update installer. }
|
||||
function ShouldSkipPage(PageID: Integer): Boolean;
|
||||
begin
|
||||
Result := (PageID = wpSelectDir) and (UpdatePath <> '')
|
||||
end;
|
||||
|
||||
{ Return DWORD value containing the build version of .NET Framework. }
|
||||
function TDGetNetFrameworkVersion: Cardinal;
|
||||
var FrameworkVersion: Cardinal;
|
||||
|
@ -72,6 +72,7 @@ function TDIsUninstallable: Boolean; forward;
|
||||
function TDFindUpdatePath: String; forward;
|
||||
function TDGetNetFrameworkVersion: Cardinal; forward;
|
||||
function TDGetAppVersionClean: String; forward;
|
||||
function TDGetFullDownloadFileName: String; forward;
|
||||
function TDIsMatchingCEFVersion: Boolean; forward;
|
||||
procedure TDExecuteFullDownload; forward;
|
||||
|
||||
@ -93,7 +94,7 @@ begin
|
||||
|
||||
if not TDIsMatchingCEFVersion() then
|
||||
begin
|
||||
idpAddFile('https://github.com/{#MyAppPublisher}/{#MyAppName}/releases/download/'+TDGetAppVersionClean()+'/{#MyAppName}.exe', ExpandConstant('{tmp}\{#MyAppName}.Full.exe'));
|
||||
idpAddFile('https://github.com/{#MyAppPublisher}/{#MyAppName}/releases/download/'+TDGetAppVersionClean()+'/'+TDGetFullDownloadFileName(), ExpandConstant('{tmp}\{#MyAppName}.Full.exe'));
|
||||
end;
|
||||
|
||||
if TDGetNetFrameworkVersion() >= 379893 then
|
||||
@ -205,6 +206,12 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
{ Return the name of the full installer file to download from GitHub. }
|
||||
function TDGetFullDownloadFileName: String;
|
||||
begin
|
||||
if IsPortable then Result := '{#MyAppName}.Portable.exe' else Result := '{#MyAppName}.exe';
|
||||
end;
|
||||
|
||||
{ Return whether the version of the installed libcef.dll library matches internal one. }
|
||||
function TDIsMatchingCEFVersion: Boolean;
|
||||
var CEFVersion: String;
|
||||
|
Loading…
Reference in New Issue
Block a user