Search code examples
wixwindows-serviceswindows-installersql-server-ce

WiX give write permission


I need to give permission to a LocalSystem windows service installed with WIX to write a SQL Server CE file to CommonAppDataFolder. I'm using:

<Directory Id="CommonAppDataFolder">
    <Directory Id="CompanyNameDataFolder" Name="!(loc.CompanyName)">
        <Directory Id="AppFolder" Name="!(loc.FolderName)" >
            <Component Id="DataDirectory" Guid="*">
                <CreateFolder>
                    <utils:PermissionEx User="[WIX_ACCOUNT_LOCALSYSTEM]" GenericAll="yes" 
                                        ChangePermission="yes" />
                </CreateFolder>
            </Component>
        </Directory>
    </Directory>
</Directory>

But it's not doing the trick. I am also trying this inside the service install, but no luck.

<utils:PermissionEx User="[WIX_ACCOUNT_LOCALSYSTEM]" GenericAll="yes" />

Any help is greatly appreciated.


Solution

  • Not really the core of my field, but in the interest of helping out, let us try: doesn't LocalSystem pretty much have "access all areas" on a normal computer? (with a few minor exceptions). There must be something else wrong? What do the logs say? What does the event viewer report?

    Maybe see if some of these answers are illuminating?: