Skip to content

Commit

Permalink
MDEV-11214 Windows : MSI installation fails, if run by a service user…
Browse files Browse the repository at this point in the history
… (e.g LocalSystem)

Skip  permission for data directory for LogonUser, if installation
runs by one of the service accounts (determined from their well-known SID).
There is no real LogonUser in this case.
  • Loading branch information
vaintroub committed Nov 3, 2016
1 parent 2a2e79b commit e0f48e5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion win/packaging/extra.wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,24 @@
<RegistryValue Root='HKLM'
Key='SOFTWARE\@MANUFACTURER@\@CPACK_WIX_PACKAGE_NAME@'
Name='DATADIR' Value='[DATADIR]' Type='string' KeyPath='yes'/>
<CreateFolder>
<util:PermissionEx User="NetworkService" GenericAll="yes" />
</CreateFolder>
</Component>

<Component Id="C.datadir.permissions" Directory="DATADIR">
<Condition>
<!--
Skip setting permissions for LogonUser, if package is installed by
service user (e.g LocalSystem)
-->
<![CDATA[ (UserSID <> "S-1-5-18") AND (UserSID <> "S-1-5-19") AND (UserSID <> "S-1-5-20") ]]>
</Condition>
<RegistryValue Root='HKLM'
Key='SOFTWARE\Monty Program AB\@CPACK_WIX_PACKAGE_NAME@'
Name='InstalledBy' Value='[USER_DOMAIN]\[LogonUser]' Type='string' KeyPath='yes'/>
<CreateFolder>
<util:PermissionEx User="[LogonUser]" Domain="[USER_DOMAIN]" GenericAll="yes" />
<util:PermissionEx User="NetworkService" GenericAll="yes" />
</CreateFolder>
</Component>

Expand Down

0 comments on commit e0f48e5

Please sign in to comment.