[wix-users] Windows service main executable repair

Jason Stephenson jstkernel at gmail.com
Tue Aug 23 03:06:03 PDT 2016


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


More information about the wix-users mailing list