[wix-users] Major Upgrade of Service

Phill Hogland phill.hogland at rimage.com
Wed Nov 4 11:36:49 PST 2015


I install several services in different bundles.  My ServiceInstall and ServiceControl are similar to your authoring, and I do not have any issues with doing an upgrade.  I have never used RemoveFile or RemoveFolder and am not sure why you would need them.  Are they contributing to your problem?

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Brian Enderle
Sent: Wednesday, November 04, 2015 12:33 PM
To: WiX Users <wix-users at lists.wixtoolset.org>
Subject: [wix-users] Major Upgrade of Service

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

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/



More information about the wix-users mailing list