WiX v3.6 PermissionEx - Sddl attribute required?

2019-08-01 03:05发布

问题:

Really?

I am trying to do something like this -

<PermissionEx
              User="Authenticated Users"
              GenericAll="yes"
              ServiceChangeConfig="yes"
              ServiceEnumerateDependents="yes"
              ChangePermission="yes"
              ServiceInterrogate="yes"
              ServicePauseContinue="yes"
              ServiceQueryConfig="yes"
              ServiceQueryStatus="yes"
              ServiceStart="yes"
              ServiceStop="yes" />

and it is giving me

The required attribute 'Sddl' is missing.

Not familiar with Sddl. How do I create an Sddl string to match the above permissions?

回答1:

PermissionEx is the tag for MSI 5.0's MsiLockPermissionsEx functionality, which requires an SDDL string. There's also a PermissionEx tag in WixUtilExtension, which allows similar functionality on all versions of MSI. You're using the former with the latter's attributes. If you want the WixUtilExtension variant of PermissionEx, use the WixUtilExtension namespace:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
...
<util:PermissionEx ... />


回答2:

Either use the API ConvertSecurityDescriptorToStringSecurityDescriptor or work it out in your head following the format described on MSDN article Security Descriptor String Format. Or look for examples of what you need online.



标签: wix wix3.6