Wix: How to retrieve a localized Windows group user for a shared folder

225 views Asked by At

This post is a follow up on this thread I created not long ago.
Basically I'm setting up a shared folder with WiX, and I'd like to come up with a clean and efficient way of doing it (see the link above for the best practices).

My current setup looks like this:

<Directory Id="MYSHAREDFOLDER" Name="FolderName">
    <Component Id="MyShareComponent" Feature="MyShareFeature" Guid="MyGuid">
        <util:User Id="Everyone" Name="Everyone" />
        <util:FileShare Id="MyFileShare" Name="MyFolderName">
            <util:FileSharePermission User="Everyone" GenericAll="yes"/>
        </util:FileShare>
        <CreateFolder>
            <util:PermissionEx User="Everyone" GenericAll="yes" />
        </CreateFolder>
    </Component>
</Directory>

Ultimately I've ran into the good old issue of localization : the "Everyone" user group doesn't exists on non-english Windows, it is localized and translated into the OS culture.
I'm not trying to localize my msi, I just want to retrieve the "Everyone" user group equivalent in other cultures.

Now I've seen quite a few posts that could help me with this, but most of them are really becoming old, and in regard to the best practices (again, you can check Stein Åsmul's answer on my previous thread), I couldn't find any solution that doesn't involve using custom actions, or scripts or defining the user value directly into the .wxs file.

I'm trying to avoid custom actions, but most other solutions seems kind of obscure or hardly maintainable to me at the moment.
I'd like to know if, as of today, there is a better way to get the localized "Everyone" user group to pass on to the util:User tag ?
And if not, what solution should I go for then?

EDIT:
In regard to Stein's comments:
Unfortunately for me, "Everyone" doesn't translate at all at runtime, whether the OS is localized or not. I mean "Everyone" works on the english version of Windows of course, but my primary targets are foreign versions, where it doesn't translate.

I also forgot to mention originally that I considered using the built-in WixQueryOsWellKnownSID, because I saw Rob Mensching suggested it as well, however I get the following error and haven't been able to get around that (same behavior for User and Administrator):
Failed to create user. (-2147022694 BUILTIN\Users)

I've seen this post that was followed up here, but couldn't come up with anything better.
I've also checked the comments from this link where they explain you shouldn't be using a merge module, but I'm not. Everything is in the .wxs file.

As of the SDDL string, I have read the whole thing but as far as I understand, you need to know the exact location of the folder beforehand to generate the proper SDDL ? I can't rely on this solution as the folder location is decided at runtime. Unless I got it wrong of course.

0

There are 0 answers