Commit e0f48e5c authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-11214 Windows : MSI installation fails, if run by a service user (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.
parent 2a2e79b7
......@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment