Code refactoring

This commit is contained in:
Jaex 2024-01-22 03:38:49 +03:00
parent 575973f8b0
commit c97126a464
1 changed files with 6 additions and 10 deletions

View File

@ -102,21 +102,17 @@ Root: "HKCU"; Subkey: "Software\Classes\SystemFileAssociations\image\shell\Share
#include "CodeDependencies.iss"
[Code]
function IsAdmin(): Boolean;
function IsAdmin: Boolean;
begin
Result := (IsAdminLoggedOn or IsPowerUserLoggedOn);
end;
procedure InitializeWizard();
var
installDir: String;
procedure InitializeWizard;
begin
if IsAdmin() then
installDir := ExpandConstant('{pf}\{#MyAppName}')
else
installDir := ExpandConstant('{userpf}\{#MyAppName}');
WizardForm.DirEdit.Text := installDir;
if not IsAdmin then
begin
WizardForm.DirEdit.Text := ExpandConstant('{userpf}\{#MyAppName}');
end;
Dependency_InitializeWizard;
end;