The process to create a user, create a service, and then set the
service to run as the user is fairly straitforward. I have <User> and
<ServiceInstall> elements and I've verified that they're working fine
by themselves; both the user and the service are created upon install.

The problem comes when I try to assign the user the appropriate rights
to start the service. I have the appropriate <Permission> element
underneath <ServiceInstall>, but whenever I run my MSI with that
element, I get the following error message in my install log:

ExecSecureObjects:  Error 0x80070424: failed to get security info for
object: hmr_db

As best as I can tell, both the user and the service are being created
before this message is logged; I see these two log messages prior to
the error:
Action 13:53:44: CreateUser.
Action 13:53:48: InstallServices. Installing new services

Here's the appropriate parts of my WXS file:

<Component Id="postgresql_service" Guid="9BDBC894-66D1-4F38-BB0B-15E564F82130">
  <File Id="pg_ctl.exe" LongName="pg_ctl.exe" Name="PG_CTL.EXE"
Source="..\..\..\..\..\..\..\Program Files\pgsql\bin\pg_ctl.exe"
KeyPath="yes" DiskId="1" />
  <ServiceInstall Id="postgresql_service" Description="Hybrid Medical
Records Database Server" DisplayName="HMR Database"
ErrorControl="critical" Name="[SERVICE_NAME]" Start="auto"
Type="ownProcess" Vital="yes" Arguments="runservice -W -N
&quot;[SERVICE_NAME]&quot; -D &quot;[postgresql_data]&quot;"
Account="[DATABASE_USER_DOMAIN]\[DATABASE_USER_NAME]"
Password="[DATABASE_USER_PASSWORD]">
    <Permission User="[DATABASE_USER_NAME]"
Domain="[DATABASE_USER_DOMAIN]" ServiceStart="yes" ServiceStop="yes"
ServiceInterrogate="yes" ServicePauseContinue="yes"
ServiceQueryConfig="yes" ServiceQueryStatus="yes" Extended="yes"
ServiceChangeConfig="yes" ServiceEnumerateDependents="yes"
ServiceUserDefinedControl="yes" />
  </ServiceInstall>
</Component>
[...snip...]
<Component Id="postgresql_account" Guid="E67E92FE-6926-46F7-8F86-E5BD981CD84C">
  <User Id="postgresql_user" Name="[DATABASE_USER_NAME]"
CanNotChangePassword="yes" CreateUser="yes" Disabled="no"
Domain="[DATABASE_USER_DOMAIN]" FailIfExists="no"
Password="[DATABASE_USER_PASSWORD]" PasswordExpired="no"
PasswordNeverExpires="yes" RemoveOnUninstall="yes"
UpdateIfExists="yes" />
</Component>

(The two Components are in different <Directory>s, if that matters. I
can supply the full WXS and log file if necessary. The SERVICE_NAME
property is set to "hmr_db"; the error message does appear to be
referring to the service with the correct name.)

As I mentioned, the user and service are being created correctly
(although the service can't start due to the missing permissions), but
the minute that I add in <Permission> the install fails. I've Googled
all over the net for any information on this problem to no avail. Can
anyone help with this? It looks like a WIX/MSI bug to me; is there a
workaround?

Thanks,

Craig

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to