[wix-users] Windows service main executable repair

Phil Wilson phil.wilson at mvps.org
Wed Aug 24 14:10:05 PDT 2016


The default behavior wouldn't do this as far as I can determine. The normal
sequence is the execute sequence, and that has an action order where
StopServices is before DeleteServices (which you won't have) followed by
InstallFiles, InstallServices, StartServices.  

Is the service running when you remove the executable?  Was the service
configured with an account post-installation? 

Phil W 

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Jason Stephenson
Sent: Tuesday, August 23, 2016 3:06 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Windows service main executable repair

Hi all,

I've been testing the repair functionality within my installer and have came
across an issue.
Given the following code:

<DirectoryRef Id="INSTALLDIR">
    <Component Id="UsermodeComponent"
Guid="3627707A-5873-481C-B770-D44253384622">
        <File Id="MainExe" Name="MyExe.exe"
Source="$(var.MyProject.TargetPath)"/>

        <ServiceInstall Id='InstallService'
                        Name='MyService'
                        DisplayName="MyService"
                        Description="MyService"
                        Type='ownProcess'
                        Start='auto'
                        ErrorControl='normal'>

            <ServiceDependency Id="A depdendency" />

            <ServiceConfig xmlns="
http://schemas.microsoft.com/wix/UtilExtension"
                           FirstFailureActionType='restart'
                           SecondFailureActionType='restart'
                           ThirdFailureActionType='restart'
                           RestartServiceDelayInSeconds='60'/>
        </ServiceInstall>

        <ServiceControl Id='DAServiceController'
                        Name='MyService'
                        Remove='uninstall'
                        Start='install'
                        Stop='both'
                        Wait='yes' />
    </Component>
</DirectoryRef>

Deleting MyExe.exe from disk and then performing a repair fails because the
installer engine is trying to start the service before copying the exe back.
Surely this is not expected behavior? Is this a "one resource per component"
issue? I was under the impression that services required the install &
config sections to be in the same component as the service exe.

Thanks
J

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





More information about the wix-users mailing list