I have been having problems creating an installer that will install and
start a Windows Service.

This is on a Windows 8 64 bit PC VS 2012 WiX 3.8

I have created a very simple windows service that writes to a text file
when it is running as a test.

This is almost a direct copy from the WiX 3.6 Developers Guide

My Product.wxs looks like

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"; >
  <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0"
Manufacturer="TFS" UpgradeCode="9063f4e7-dc28-40a3-9b0f-e3457ec52b31">
    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName]
is already installed." />
    <MediaTemplate />
    <PropertyRef Id="WIX_ACCOUNT_LOCALSERVICE"/>
    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
      <ComponentRef Id="CMP_WindowsService1" />
    </Feature>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
      </Directory>
    </Directory>
    <DirectoryRef Id="INSTALLFOLDER">
      <Component Id="CMP_WindowsService1"
Guid="{D1ED0ABA-4384-4F10-B7EE-14A8E2BA8C89}">
        <File Id="WindowsService1.exe" Name="WindowsService1.exe"
KeyPath="yes" Source="..\WindowsService1\bin\Release\WindowsService1.exe" />
        <ServiceInstall Id="InstallWindowsService1" Name="testcsv"
DisplayName="Test Service" Start="auto" ErrorControl="normal"
Type="ownProcess"
                        Account="[WIX_ACCOUNT_LOCALSYSTEM]" />
        <ServiceControl Id="sc_WindowsService1" Name="testscv"
Start="install" Stop="both" Remove="uninstall" Wait="yes" />
      </Component>
    </DirectoryRef>
  </Product>
</Wix>

When I run the install I get a message saying "Service 'Test Service'
(testscv) failed to start. Verify that you have sufficient privileges to
start system service.". If I retry I get the same message and only option
is then to Cancel and the install cancels.

If I remove the ServiceControl line the install runs through with no errors
and I am able to manually start the service from either the task manager or
the service manager.

What if anything am I doing wrong or should I just put up with the fact
that I will have my service installed but not running.

excerpt from the log file showing error

MSI (s) (30:30) [15:34:11:009]: File: C:\Program Files
(x86)\SetupProject1\WindowsService1.exe;    To be installed;    Won't
patch;    No existing file
MSI (s) (30:30) [15:34:11:009]: Source for file 'WindowsService1.exe' is
compressed
MSI (s) (30:30) [15:34:11:024]: Executing op: CacheSizeFlush(,)
MSI (s) (30:30) [15:34:11:024]: Executing op:
ActionStart(Name=InstallServices,Description=Installing new
services,Template=Service: [2])
MSI (s) (30:30) [15:34:11:032]: Executing op:
ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (30:30) [15:34:11:032]: Executing op:
ServiceInstall(Name=testcsv,DisplayName=Test Service,ImagePath="C:\Program
Files
(x86)\SetupProject1\WindowsService1.exe",ServiceType=16,StartType=2,ErrorControl=1,,Dependencies=[~],,StartName=NT
AUTHORITY\SYSTEM,,,,)
MSI (s) (30:30) [15:34:11:040]: Executing op:
ActionStart(Name=StartServices,Description=Starting
services,Template=Service: [1])
MSI (s) (30:30) [15:34:11:040]: Executing op:
ProgressTotal(Total=1,Type=1,ByteEquivalent=1300000)
MSI (s) (30:30) [15:34:11:040]: Executing op:
ServiceControl(,Name=testscv,Action=1,Wait=1,)
MSI (s) (30:30) [15:34:26:095]: Note: 1: 2205 2:  3: Error
MSI (s) (30:30) [15:34:26:095]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1920
MSI (c) (E4:AC) [15:34:26:103]: Font created.  Charset: Req=0, Ret=0, Font:
Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 1920. Service 'testscv' (testscv) failed to start.  Verify that you
have sufficient privileges to start system services.
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 4316 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 3708 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 2564 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 772 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 384 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 1584 could not be cancelled.
Error: 1168
MSI (s) (30:F0) [15:34:28:290]: I/O on thread 1016 could not be cancelled.
Error: 1168
MSI (s) (30:30) [15:34:28:290]: Note: 1: 2205 2:  3: Error
MSI (s) (30:30) [15:34:28:290]: Note: 1: 2228 2:  3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (30:30) [15:34:28:290]: Product: SetupProject1 -- Error 1920.
Service 'testscv' (testscv) failed to start.  Verify that you have
sufficient privileges to start system services.

John
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&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