[wix-users] Custom action sequencing and Apache prunsrv

Douglas, Keith (STATCAN/STATCAN) keith.douglas at canada.ca
Tue Nov 10 11:15:08 PST 2015


I know there have been previous discussions on this list (or its predecessor) and elsewhere on how to use the Apache prunsrv in Windows Installer/WiX based installs. I think I figured out the gist, though there is still more work to be done. What follows is my prototype (no other files installed, creates a "dummy" service). Comments welcome/solicited, particularly about the sequencing, which proved to be the real challenge:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Product Id="*" Name="PrototypeTomcatesqueInstall" Language="1033" Version="1.0.0" Manufacturer="Statistics Canada" UpgradeCode="908081b2-232b-4ab6-8a12-6fe572c4a46c">
                <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  />

                <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
                <Media Id="1" Cabinet="PrototypeTomcatesqueInstall.cab" EmbedCab="yes" />

                <Feature Id="ProductFeature" Title="PrototypeTomcatesqueInstall" Level="1">
                        <ComponentGroupRef Id="ProductComponents" />
                </Feature>
                <InstallExecuteSequence>
                        <Custom Action="StartService" After="PublishProduct">NOT REMOVE</Custom>
                        <Custom Action="RemoveService" After="CostFinalize">REMOVE</Custom>
                </InstallExecuteSequence>
        </Product>

        <Fragment>
                <Directory Id="TARGETDIR" Name="SourceDir">
                        <Directory Id="ProgramFilesFolder">
                                <Directory Id="INSTALLFOLDER" Name="PrototypeTomcatesqueInstall" />
                        </Directory>
                </Directory>
                <CustomAction Id="StartService" ExeCommand="install FakeService1" Execute="commit" FileKey="Daemon" Impersonate="no" Return="check"/>
                <CustomAction Id="RemoveService" ExeCommand="delete FakeService1" Execute="immediate" FileKey="Daemon" Impersonate="no" Return="check"/>
        </Fragment>

        <Fragment>
                <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
                        <Component Id="ProductComponent">
                         <File Id="Daemon" Source ="\\c211572\c$\Users\dougkei\Desktop\commons-daemon-1.0.15-src\src\native\windows\apps\prunsrv\WINXP_X86_EXE_RELEASE\prunsrv.exe" />
                        </Component>
                </ComponentGroup>
        </Fragment>
</Wix>

Keith Douglas
Programmer Analyst | Programmeur analyste
Questionnaire Development Services - CAI Social | Services de développement de questionnaires - IAO Social
Jean Talon Building | Immeuble Jean-Talon / Floor | Étage 4 A-3
Statistics Canada | 170 Tunney's Pasture Driveway, Ottawa ON K1A 0T6
Statistique Canada | 170, promenade Tunney's Pasture, Ottawa ON K1A 0T6
Keith.Douglas at canada.ca
Telephone | Téléphone 613-854-5589
Facsimile | Télécopieur 613-951-4674
Government of Canada | Gouvernement du Canada





More information about the wix-users mailing list