Skip to content

Commit

Permalink
Added: No start to update callback command
Browse files Browse the repository at this point in the history
--nost when sent to the updater.exe will tell it not to start the
browser after a upgrade.
  • Loading branch information
InternalError503 committed Feb 23, 2017
1 parent 220882d commit 8cd1b91
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _Build/_Installer/app.config
@@ -1,6 +1,6 @@
;Script generated by 8pecxstudios.
;Copyright (c) 2012-2017 8pecxstudios
;Script Version: 2.6.2
;Script Version: 2.6.3

;Define our conditionals
#define SignedInstall False
Expand Down
32 changes: 30 additions & 2 deletions _Build/_Installer/code.inc
@@ -1,4 +1,7 @@
[Code]
var
UpdateNoStart: String;

// Setup exit code for check for running function.
procedure ExitProcess(exitCode:integer);
external 'ExitProcess@kernel32.dll stdcall';
Expand Down Expand Up @@ -107,6 +110,27 @@ var
end;
end;
end;

// Check if nost command line argument was set.
function UpdateNoStInstall(const Count : LongInt): boolean;
var
UpgradeNoStInstallation : Boolean;
ii : LongInt;
Param : String;
begin
UpgradeNoStInstallation := FALSE;
for ii := 0 to Count do
begin
Param := ParamStr(ii)
if CompareText(Param,'--nost')=0 then
begin
UpdateNoStart := ' --nost';
UpgradeNoStInstallation := TRUE;
log('Do not start after update install set: True');
Result := TRUE;
end;
end;
end;

// Get the uninstall string;
function GetUninstallString: string;
Expand Down Expand Up @@ -159,7 +183,7 @@ function wasUpdate : boolean;
var
iResultCode: Integer;
begin
if ExecAsOriginalUser(ExpandConstant('{app}\updater.exe'), '--upgrade', '', SW_SHOWNORMAL, ewNoWait, iResultCode) then
if ExecAsOriginalUser(ExpandConstant('{app}\updater.exe'), '--upgrade' + UpdateNoStart, '', SW_SHOWNORMAL, ewNoWait, iResultCode) then
begin
log('Program was launched successfully.');
Result := True;
Expand Down Expand Up @@ -305,7 +329,11 @@ procedure CurStepChanged(CurStep: TSetupStep);
end;
if CurStep = ssDone then
begin
if (WasUpdateInstall(ParamCount())) then begin wasUpdate(); end;
if (WasUpdateInstall(ParamCount())) then
begin
UpdateNoStInstall(ParamCount());
wasUpdate();
end;
if (StartAfterInstall(ParamCount())) and not (WasUpdateInstall(ParamCount())) then begin startBrowser(); end;
end
end;
Expand Down
2 changes: 1 addition & 1 deletion _Build/_InstallerConfig/app.config
@@ -1,6 +1,6 @@
;Script generated by 8pecxstudios.
;Copyright (c) 2012-2017 8pecxstudios
;Script Version: 2.6.2
;Script Version: 2.6.3

;Define our conditionals
#define SignedInstall True
Expand Down

0 comments on commit 8cd1b91

Please sign in to comment.