mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-24 17:20:58 +12:00
Inno Setup Code to choose pf or userpf
This commit is contained in:
parent
7e487cefcb
commit
6db2c3aa07
|
@ -102,8 +102,23 @@ Root: "HKCU"; Subkey: "Software\Classes\SystemFileAssociations\image\shell\Share
|
|||
#include "CodeDependencies.iss"
|
||||
|
||||
[Code]
|
||||
procedure InitializeWizard;
|
||||
function IsAdmin(): Boolean;
|
||||
begin
|
||||
Result := (IsAdminLoggedOn or IsPowerUserLoggedOn);
|
||||
end;
|
||||
|
||||
procedure InitializeWizard();
|
||||
var
|
||||
installDir: String;
|
||||
begin
|
||||
if IsAdmin() then
|
||||
installDir := ExpandConstant('{pf}\{#MyAppName}')
|
||||
else
|
||||
installDir := ExpandConstant('{userpf}\{#MyAppName}');
|
||||
|
||||
ForceDirectories(installDir);
|
||||
WizardForm.DirEdit.Text := installDir;
|
||||
|
||||
Dependency_InitializeWizard;
|
||||
end;
|
||||
|
||||
|
|
Loading…
Reference in a new issue