mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-30 15:23:01 +00:00
templates/windows/installer: Add command line flag for portable installation
Users of the Installer can now specify the `/Portable` flag in addition to other flags to install as Portable.
This commit is contained in:
parent
761f741c56
commit
df12d2fb80
1 changed files with 27 additions and 3 deletions
|
@ -154,6 +154,24 @@ begin
|
||||||
PAnsiChar(S), SMTO_ABORTIFHUNG, 5000, MsgResult);
|
PAnsiChar(S), SMTO_ABORTIFHUNG, 5000, MsgResult);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
function ParamExists(Name: String): Boolean;
|
||||||
|
var
|
||||||
|
Idx: Integer;
|
||||||
|
Limit: Integer;
|
||||||
|
Param: String;
|
||||||
|
begin
|
||||||
|
Limit := ParamCount()
|
||||||
|
for Idx := 1 to Limit do begin
|
||||||
|
Param := ParamStr(Idx);
|
||||||
|
if SameText(Param, '/' + Name) then begin
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
var
|
var
|
||||||
oModePageSystemChoice: TNewRadioButton;
|
oModePageSystemChoice: TNewRadioButton;
|
||||||
|
@ -196,9 +214,15 @@ procedure OnModePageSystemChoiceClick(Sender: TObject); forward;
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
function InitializeSetup(): Boolean;
|
function InitializeSetup(): Boolean;
|
||||||
begin
|
begin
|
||||||
bIsSystemMode := IsAdmin();
|
if ParamExists('Portable') then begin
|
||||||
bIsUsermode := not IsAdmin();
|
bIsSystemMode := False;
|
||||||
bIsPortableMode := False;
|
bIsUserMode := False;
|
||||||
|
bIsPortableMode := True;
|
||||||
|
end else begin
|
||||||
|
bIsSystemMode := IsAdmin();
|
||||||
|
bIsUserMode := not IsAdmin();
|
||||||
|
bIsPortableMode := False;
|
||||||
|
end;
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in a new issue