I solved the issue, I reflected the ServiceInstaller class in 
System.ServiceProcess, I saw that it has an EventLogInstaller class that 
registers an event log for the service.

I added this to the service's component

<util:EventSource Log="TestService" Name="TestService -  [SERVICENAME]" 
EventMessageFile="[NETFRAMEWORK40CLIENTINSTALLROOTDIR64]EventLogMessages.dll" />


That solved the issue, thanks folks :)
Christoffel

-----Original Message-----
From: Christoffel le Roux [mailto:christoffe...@flowcentric.com]
Sent: 25 July 2013 12:07 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] ServiceInstaller custom local user

The service implements a timer that is supposed to keep the service alive and 
should not stop due to no activity.

-----Original Message-----
From: Christoffel le Roux [mailto:christoffe...@flowcentric.com]
Sent: 25 July 2013 09:36 AM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] ServiceInstaller custom local user

Hi have a very peculiar issue. I'm install a windows service using the 
following wix code

<!- Service Install Components -->

<Component Id="cmp2F9C5C2CDF330B0C3E022984E1A3936C" Guid="*">

         <File Id="filF81304C2C5868102C7E97E9A5C61A95E"

                 KeyPath="yes"

                 Source="$(var.BinariesBuildOutputPath)\TestService .exe" />

         <ServiceInstall Id="TestServiceServiceInstall"

                 Name="TestService - [SERVICENAME]"

                 DisplayName=" TestService - [SERVICENAME]"

                 Type="ownProcess"

                 Interactive="no"

                 Start="auto"

                 Vital="yes"

                 ErrorControl="normal"

                 Description="This is a test service"

                 Account="[SERVICEACCOUNT]"

                 Password="[SERVICEACCOUNTPASSWORD]"

                 xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"; />

         <ServiceControl Id=" TestServiceServiceControl"

                  Name="TestService - [SERVICENAME]"

                 Stop="both"

                 Remove="uninstall"

                 Wait="yes"

                 xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"; />

</Component>



<!--Log On As Service-->
<Component Id="LogOnAsServiceComponent" Directory="BINARIESDIRECTORY" 
Guid="273B0B31-3D44-4D62-A6D5-BDF3A9CC607F" MultiInstance="yes">

         <Condition><![CDATA[NOT Installed AND SERVICEACCOUNT <> "LocalSystem" 
AND SERVICEACCOUNT <> "NT AUTHORITY\LOCAL SERVICE" AND SERVICEACCOUNT <> "NT 
AUTHORITY\NETWORK SERVICE"]]></Condition>

         <CreateFolder></CreateFolder>

         <util:User Id="UpdateUserLogonAsService" UpdateIfExists="yes" 
CreateUser="no" Name="[SERVICEACCOUNT]" LogonAsService="yes">

         </util:User>

</Component>



<!--Register the User to allow access to RSA Key to be able to decrypt the 
encrypted the service's configuration file -->

<SetProperty Id="RegisterForRSAKey"

         Before="RegisterForRSAKey"

         Sequence="execute"

         
Value="&quot;[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe&quot;
 -pa &quot;NetFrameworkConfigurationKey&quot; &quot;[SERVICEACCOUNT]&quot;" />

         <CustomAction

                 Id="RegisterForRSAKey"

                 BinaryKey="WixCA"

                 DllEntry="CAQuietExec"

                 Execute="deferred"

                 Impersonate="yes"

                 Return='check'>

         </CustomAction>





The service gets installed using a custom local windows account not 
LocalSystem, The logon as service does get set. But...



If I try to start the service after installation the, service starts and stops 
automatically.

If I then add the custom local account to the local administrators group and 
then remove it again and then start the service the service starts.



Also what I tried after installing the service, is to change the service 
account to local system,

start the service which start fine, and then change the service account back to 
the local system account, the service starts.



I'm baffled on what can cause the service not to start right after it being 
installed.



My next option was to lose the wix service installer, and use installutil 
custom actions to install the service, which I tested using the exact same 
parameters with no problem,

but I don't really want to go that route if wix has the option for installing 
services.



Please help to get this service started.



Thanks in advance.

Christoffel





This information is intended only for the person or entity to which it is 
addressed and may contain private, confidential, proprietary and/or privileged 
material and may be subject to confidentiality agreements. Any review, 
retransmission, dissemination, or any other use of or taking of any action in 
reliance upon this information, by persons or entities other than the intended 
recipient, is prohibited. If you received this in error, please contact the 
sender and delete the material from all storage media. FlowCentric is neither 
liable for proper, complete transmission of the information contained in this 
communication, any delay in its receipt or that the mail is virus-free.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics Get end-to-end 
visibility with application monitoring from AppDynamics Isolate bottlenecks and 
diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
This information is intended only for the person or entity to which it is 
addressed and may contain private, confidential, proprietary and/or privileged 
material and may be subject to confidentiality agreements. Any review, 
retransmission, dissemination, or any other use of or taking of any action in 
reliance upon this information, by persons or entities other than the intended 
recipient, is prohibited. If you received this in error, please contact the 
sender and delete the material from all storage media. FlowCentric is neither 
liable for proper, complete transmission of the information contained in this 
communication, any delay in its receipt or that the mail is virus-free.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics Get end-to-end 
visibility with application monitoring from AppDynamics Isolate bottlenecks and 
diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
This information is intended only for the person or entity to which it is 
addressed and may contain private, confidential, proprietary and/or privileged 
material and may be subject to confidentiality agreements. Any review, 
retransmission, dissemination, or any other use of or taking of any action in 
reliance upon this information, by persons or entities other than the intended 
recipient, is prohibited. If you received this in error, please contact the 
sender and delete the material from all storage media. FlowCentric is neither 
liable for proper, complete transmission of the information contained in this 
communication, any delay in its receipt or that the mail is virus-free.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to