[wix-users] Major Upgrade of Service

Brian Enderle brianke at gmail.com
Wed Nov 4 10:33:03 PST 2015


I have the following in a Product.wxs to setup a service and start it
(SERVICE_USERNAM & SERVICE_PASSWORD are entered during the installation
process, entered by the user):

   <ComponentGroup Id="ProductComponents" Directory="INSTALLBINFOLDER">
      <Component Id="ProductComponent">
        <!--<File Id="Insert dll name" Name="Insert dll name again"
Source="Insert path to dll" Vital="yes" KeyPath="no" DiskId="1"/>-->
        <File Id="MyServiceEXE"
              Name="$(var.MyService.TargetFileName)"
              Source="$(var.MyService.TargetDir)\MyService.exe"
              Vital="yes"
              KeyPath="yes"
              DiskId="1" />


        <ServiceInstall Id="ServiceInstaller"
                        Type="ownProcess"
                        Vital="yes"
                        Name="My Service"
                        DisplayName="My Service"
                        Description="My Service is cool"
                        Start="auto"
                        Account="[SERVICE_USERNAME]"
                        Password="[SERVICE_PASSWORD]"
                        ErrorControl="normal"
                        Interactive="no" />

        <ServiceControl Id="StartService"
                        Start="install"
                        Stop="both"
                        Remove="uninstall"
                        Name="My Service"
                        Wait="yes" />

        <!-- Clean up Program Files -->
        <RemoveFile Id="RemoveInstallBinFiles" Name="*.*"
Directory="INSTALLBINFOLDER" On="uninstall"/>
        <RemoveFolder Id="RemoveInstallBinFolder"
Directory="INSTALLBINFOLDER" On="uninstall"/>
        <RemoveFolder Id="RemoveInstallFolder" Directory="INSTALLFOLDER"
On="uninstall"/>

      </Component>

The above works if the service does not currently exist on the machine to
create and start the service.


I am now trying to make an upgrade to this service and am running into an
issue during upgrading of (using the same credentials as before that I know
should have the required privileges):

Executing op: ServiceInstall(Name=My Service,DisplayName=My
Service,ImagePath="C:\Program Files (x86)\My Company\My
Service\bin\MyService.exe",ServiceType=16,StartType=2,ErrorControl=32769,,Dependencies=[~],,StartName=MyUserName,Password=**********,Description=My
Service is cool,,)
InstallServices: Service:
Error 1923. Service 'My Service' (My Service) could not be installed.
Verify that you have sufficient privileges to install system services.



Is there something special needed for an upgrade to a service?


Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


More information about the wix-users mailing list