Skip to content

Commit e817ba7

Browse files
kumarakBethGriggs
authored andcommitted
win,msi: set install directory permission
Explicitly set permission for Windows install directory. Refs: https://hackerone.com/reports/1211160 PR-URL: nodejs-private/node-private#269 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent cac4f90 commit e817ba7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/msvs/msi/product.wxs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@
4646
<Property Id="ApplicationFolderName" Value="nodejs"/>
4747
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
4848

49+
<!-- PropertyRef of the account users for setting InstallDir permission explicitly -->
50+
<Property Id="AUTHENTICATED_USERS" Value="Authenticated Users"/>
51+
52+
<PropertyRef Id="WIX_ACCOUNT_LOCALSYSTEM" />
53+
<PropertyRef Id="WIX_ACCOUNT_USERS" />
54+
<PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />
55+
4956
<Property Id="INSTALLDIR" Secure="yes">
5057
<RegistrySearch Id="InstallPathRegistry"
5158
Type="raw"
@@ -73,6 +80,7 @@
7380
<ComponentRef Id="NodeStartMenu"/>
7481
<ComponentRef Id="AppData" />
7582
<ComponentRef Id="InstallToolsBat" />
83+
<ComponentRef Id="SetInstallDirPermission" />
7684
<ComponentGroupRef Id="Product.Generated"/>
7785

7886
<Feature Id="NodeEtwSupport"
@@ -93,6 +101,7 @@
93101
<ComponentRef Id="NpxBashScript"/>
94102
<ComponentRef Id="NpmConfigurationFile"/>
95103
<ComponentRef Id="AppData" />
104+
<ComponentRef Id="SetInstallDirPermission" />
96105
<ComponentGroupRef Id="NpmSourceFiles"/>
97106
</Feature>
98107

@@ -169,6 +178,20 @@
169178
<?endif?>
170179
</DirectoryRef>
171180

181+
<DirectoryRef Id="INSTALLDIR">
182+
<!-- Create component for setting the install directory permission explicitly -->
183+
<Component Id="SetInstallDirPermission" Guid="{EFFC4F74-183A-4237-BBD7-0CAD2B950053}">
184+
<CreateFolder>
185+
<Permission User="[WIX_ACCOUNT_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
186+
GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
187+
<Permission User="[AUTHENTICATED_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
188+
GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
189+
<Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" GenericAll="yes"/>
190+
<Permission User="[WIX_ACCOUNT_LOCALSYSTEM]" GenericAll="yes"/>
191+
</CreateFolder>
192+
</Component>
193+
</DirectoryRef>
194+
172195
<DirectoryRef Id="ApplicationProgramsFolder">
173196
<Component Id="NodeStartMenu">
174197
<!-- RegistryValue needed because every Component must have a KeyPath.

0 commit comments

Comments
 (0)