mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
templates/windows/installer: Don't offer path selection for System & User mode
The location for System-wide and User-only installation depend on Windows-managed locations, which means that they will never require a user to select the correct location. Therefore it is best to hide the page in all modes except for Portable, which should still offer a path to extract to.
This commit is contained in:
parent
0390fbb05f
commit
79bd387972
1 changed files with 13 additions and 17 deletions
|
@ -219,7 +219,9 @@ end;
|
||||||
function ShouldSkipPage(PageID: Integer): Boolean;
|
function ShouldSkipPage(PageID: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if (PageID = wpSelectComponents) then begin
|
if (PageID = wpSelectDir) then begin
|
||||||
|
Result := not IsPortableMode();
|
||||||
|
end else if (PageID = wpSelectComponents) then begin
|
||||||
Result := True;
|
Result := True;
|
||||||
end else if (PageID = wpSelectProgramGroup) then begin
|
end else if (PageID = wpSelectProgramGroup) then begin
|
||||||
Result := not WizardIsComponentSelected('startmenu');
|
Result := not WizardIsComponentSelected('startmenu');
|
||||||
|
@ -261,27 +263,21 @@ function GetDefaultDirectory(Value: String): String;
|
||||||
var
|
var
|
||||||
sPath: String;
|
sPath: String;
|
||||||
begin
|
begin
|
||||||
|
// In all other cases, change depending on the chosen install method.
|
||||||
|
if (IsSystemMode()) then begin
|
||||||
|
// Default to ProgramData/obs-studio/@PROJECT_NAME@
|
||||||
|
Result := ExpandConstant('{commonappdata}\obs-studio\plugins\@PROJECT_NAME@');
|
||||||
|
end else if (IsUserMode()) then begin
|
||||||
|
Result := ExpandConstant('{userpf}\obs-studio\plugins\@PROJECT_NAME@');
|
||||||
|
end else begin
|
||||||
// If a path was given as an argument, use it.
|
// If a path was given as an argument, use it.
|
||||||
if (Value <> '') then begin
|
if (Value <> '') then begin
|
||||||
Result := Value;
|
Result := Value;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Otherwise, try and figure out where the previous installation of the same type went to.
|
Result := ExpandConstant('{userdesktop}\obs-studio');
|
||||||
if (RegQueryStringValue(HKA64, AppRegistryKey(), 'InstallLocation', sPath)) then begin
|
|
||||||
Result := sPath;
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// In all other cases, change depending on the chosen install method.
|
|
||||||
if (IsSystemMode()) then begin
|
|
||||||
// Default to ProgramData/obs-studio/@PROJECT_NAME@
|
|
||||||
Result := ExpandConstant('{commonappdata}\obs-studio\plugins\@PROJECT_NAME@');
|
|
||||||
end else begin
|
|
||||||
Result := ExpandConstant('{userpf}\obs-studio\plugins\@PROJECT_NAME@')
|
|
||||||
end;
|
|
||||||
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
Loading…
Reference in a new issue