Reputation: 2261
I am installing a service using wix. also I am creating a directory using CreateFolder. The service when it start checks if this directory is existing or not.
Because of permissions issue, the service is unable to check the presence of the directory. Hence it is failing.
Can anyone please tell me how to make sure to give proper permissions while creating the directory so that the service succeeds.
Here is the service install and start code:
<ServiceInstall Id="MyServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="MyService"
DisplayName="MyService"
Description="MyService"
Start="auto"
Account="LocalSystem"
ErrorControl="normal"
Interactive="no">
<ServiceDependency Id="Winmgmt"/>
<util:PermissionEx User="Everyone"
GenericAll="yes"
ServiceChangeConfig="yes"
ServiceEnumerateDependents="yes"
ChangePermission="yes"
ServiceInterrogate="yes"
ServicePauseContinue="yes"
ServiceQueryConfig="yes"
ServiceQueryStatus="yes"
ServiceStart="yes"
ServiceStop="yes"/>
<util:ServiceConfig FirstFailureActionType="restart"
SecondFailureActionType="restart"
ThirdFailureActionType="none"
ResetPeriodInDays="1"/>
</ServiceInstall>
<ServiceControl Id="MyServiceController"
Start="install"
Stop="both"
Remove="uninstall"
Name="MyService"
Wait="no"/>
And here is the directory creation code:
<Directory Id="D_MYDIR" Name="Mydir">
<Component Id="C_FolderCreate" Guid="{CCCCCCB1-47BC-44E9-AAAA-1E750E257086}">
<CreateFolder>
<Permission GenericAll="yes" User="SYSTEM"/>
<Permission User="Users" Domain="[LOCAL_MACHINE_NAME]" GenericRead="yes" Read="yes" GenericExecute="yes" ChangePermission="yes" Delete="yes"/>
</CreateFolder>
</Component>
</Directory>
Thanks a lot for the help :)
Best Regards, Marc
Upvotes: 0
Views: 1243
Reputation: 5447
Maybe you just need to set the permissions for the LocalSystem user, since that's the user your service is running under since you set Account="LocalSystem"
.
<Permission GenericAll="yes" User="LocalSystem"/>
Upvotes: 2