Skip to content

Commit

Permalink
templates: Move to 'usercf' instead of 'userpf'
Browse files Browse the repository at this point in the history
Local (per-user) add-ons to software should reside in "C:\Users\Username\AppData\Local\Programs\Common\", similar to System (all-users) add-ons which reside in "C:\Program Files\Common Files\".

Fixes #1049
  • Loading branch information
Xaymar committed May 20, 2023
1 parent 5bdcefd commit 70bc946
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions templates/windows/installer.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function user32_SendTextMessageTimeoutA(
uTimeout: UINT;
out lpdwResult: DWORD): LRESULT;
external 'SendMessageTimeoutA@user32.dll stdcall';

procedure RefreshEnvironment();
var
S: AnsiString;
Expand Down Expand Up @@ -247,11 +247,11 @@ begin

// If this is a User install, register the necessary environment changes.
if (IsUserMode()) then begin
sPluginsPath := ExpandConstant('{userpf}\obs-studio\plugins\%module%\bin\');
sPluginsPath := ExpandConstant('{usercf}\obs-studio\plugins\%module%\bin\');
StringChangeEx(sPluginsPath, '\', '/', True);
RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'OBS_PLUGINS_PATH', sPluginsPath);

sPluginsDataPath := ExpandConstant('{userpf}\obs-studio\plugins\%module%\data\');
sPluginsDataPath := ExpandConstant('{usercf}\obs-studio\plugins\%module%\data\');
StringChangeEx(sPluginsDataPath, '\', '/', True);
RegWriteExpandStringValue(HKEY_CURRENT_USER, 'Environment', 'OBS_PLUGINS_DATA_PATH', sPluginsDataPath);

Expand All @@ -268,8 +268,8 @@ begin
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 if (IsUserMode()) then begin
Result := ExpandConstant('{usercf}\obs-studio\plugins\@PROJECT_NAME@');
end else begin
// If a path was given as an argument, use it.
if (Value <> '') then begin
Expand Down Expand Up @@ -340,7 +340,7 @@ begin
Result := '';
if (RegQueryStringValue(HKCU64, AppRegistryKey(), 'UninstallString', sPath)) then begin
Result := sPath;
end;
end;
end;

function IsUserInstallPresent(): Boolean;
Expand Down Expand Up @@ -440,7 +440,7 @@ begin
bIsSystemMode := False;
bIsUserMode := True;
bIsPortableMode := False;

WizardSelectComponents('startmenu');
end;
end;
Expand All @@ -453,7 +453,7 @@ begin
bIsSystemMode := False;
bIsUserMode := False;
bIsPortableMode := True;

WizardSelectComponents('!startmenu');
end;

Expand Down Expand Up @@ -521,7 +521,7 @@ begin
oSystemText.WordWrap := True
oSystemText.Caption := 'Install for all users of this System, which will require Administrator rights for future updates. May cause problems with Portable and Current User installations.';
oSystemText.OnClick := @OnModePageSystemChoiceClick;

// Not available without Administrator rights.
if (not IsAdmin()) then begin
oSystemWarningText := TLabel.Create(oSystemPanel);
Expand Down Expand Up @@ -598,7 +598,7 @@ begin
oUserText.WordWrap := True
oUserText.Caption := 'Install for the current user only, which will allow you to use @PROJECT_NAME@. Updating will not require Administrator rights.';
oUserText.OnClick := @OnModePageUserChoiceClick;

// Not available with Administrator rights.
if (IsAdmin()) then begin
oUserWarningText := TLabel.Create(oUserPanel);
Expand Down Expand Up @@ -680,7 +680,7 @@ begin
oPortableText.WordWrap := True
oPortableText.Caption := 'Install for a portable OBS Studio environment.';
oPortableText.OnClick := @OnModePagePortableChoiceClick;

// Warn about Administrator rights
if (IsAdmin()) then begin
oPortableWarningText := TLabel.Create(oPortablePanel);
Expand Down

0 comments on commit 70bc946

Please sign in to comment.