mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
win32 setup: disable app dir inheritance (#19787)
This commit is contained in:
@@ -81,6 +81,9 @@ Name: "associatewithfiles"; Description: "{cm:AssociateWithFiles,{#NameLong}}";
|
|||||||
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
|
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
|
||||||
Name: "runcode"; Description: "{cm:RunAfter,{#NameShort}}"; GroupDescription: "{cm:Other}"; Check: WizardSilent
|
Name: "runcode"; Description: "{cm:RunAfter,{#NameShort}}"; GroupDescription: "{cm:Other}"; Check: WizardSilent
|
||||||
|
|
||||||
|
[Dirs]
|
||||||
|
Name: "{app}"; AfterInstall: DisableAppDirInheritance
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "*"; Excludes: "\CodeSignSummary*.md,\tools,\tools\*,\resources\app\product.json"; DestDir: "{code:GetDestDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "*"; Excludes: "\CodeSignSummary*.md,\tools,\tools\*,\resources\app\product.json"; DestDir: "{code:GetDestDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "tools\*"; DestDir: "{app}\tools"; Flags: ignoreversion
|
Source: "tools\*"; DestDir: "{app}\tools"; Flags: ignoreversion
|
||||||
@@ -332,3 +335,19 @@ end;
|
|||||||
#ifdef Debug
|
#ifdef Debug
|
||||||
#expr SaveToFile(AddBackslash(SourcePath) + "code-processed.iss")
|
#expr SaveToFile(AddBackslash(SourcePath) + "code-processed.iss")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls
|
||||||
|
// https://docs.microsoft.com/en-US/windows/security/identity-protection/access-control/security-identifiers
|
||||||
|
procedure DisableAppDirInheritance();
|
||||||
|
var
|
||||||
|
ResultCode: Integer;
|
||||||
|
Permissions: string;
|
||||||
|
begin
|
||||||
|
Permissions := '/grant:r "*S-1-5-18:(OI)(CI)F" /grant:r "*S-1-5-32-544:(OI)(CI)F" /grant:r "*S-1-5-11:(OI)(CI)RX" /grant:r "*S-1-5-32-545:(OI)(CI)RX"';
|
||||||
|
|
||||||
|
#if "user" == InstallTarget
|
||||||
|
Permissions := Permissions + ' /grant:r "*S-1-3-0:(OI)(CI)F"';
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Exec(ExpandConstant('{sys}\icacls.exe'), ExpandConstant('"{app}" /inheritancelevel:r ') + Permissions, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||||
|
end;
|
||||||
Reference in New Issue
Block a user