[wix-users] Custom action fails to create (& start) eclipse mosquitto broker service during Upgrade but works well on initial install and uninstall of the parent application
Rob Mensching
rob at firegiant.com
Tue May 14 09:47:09 PDT 2024
FYI: The wix-users mailing list is deprecated. Use the GitHub Discussions (https://github.com/orgs/wixtoolset/discussions) instead now.
-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Om Sharma via wix-users
Sent: Tuesday, May 14, 2024 9:29 AM
To: wix-users at lists.wixtoolset.org
Cc: Om Sharma <Om.Sharma at domino-uk.com>
Subject: [wix-users] Custom action fails to create (& start) eclipse mosquitto broker service during Upgrade but works well on initial install and uninstall of the parent application
Hi,
Following is the code segment that I have for wix 4 installer
<!-- The parent application. windows 10 desktop x64 --> Product.wsx :
<!-- the parent (main) product that wiil be installed --> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?define SourceFolder="$(var.SolutionDir)bin"?>
<Package --- >
<ComponentGroup Directory="INSTALLFOLDER" Id="UniqueId">
<Component Id="CompId1" Guid="uniqueGuid">
<File Id="IdFile1" Source="$(var.SourceFolder)\file1" KeyPath="yes" Checksum="yes" />
</Component>
<Component Id="CompId2" Guid="uniqueGuid">
<File Id="IdFile1" Source="$(var.SourceFolder)\file2" KeyPath="yes" Checksum="yes" />
</Component>
:
</ComponentGroup>
<Feature Id="FeatureuniqueId" Title="the title" Level="1" AllowAdvertise="no" AllowAbsent="no">
<ComponentGroupRef Id="CompId1" />
<!-- include the eclipse mosquitto as a separate feature defined in EclipseMosquitto.wsx-->
<FeatureRef Id = "EclipseMosquittoFeature" />
<ComponentGroupRef Id="CompId2" />
:
</Feature>
:
:
</Package>
</Wix>
----------------------
<!-- Optional install of eclipse mosquitto broker files--> EclipseMosquitto.wsx :
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
:
<Property Id="SCEXEFILE">
<DirectorySearch Id="FolderPathForScFile" Path="[System64Folder]">
<FileSearch Name="sc.exe" />
</DirectorySearch>
</Property>
<CustomAction Id="StartMosquitto"
Execute="immediate"
Impersonate="no"
Property="SCEXEFILE"
ExeCommand="start mosquitto" />
<CustomAction Id="StopMosquitto"
Execute="immediate"
Impersonate="no"
Property="SCEXEFILE"
ExeCommand="stop mosquitto" />
<CustomAction Id="InstallMosquitto"
Execute="immediate"
Impersonate="no"
FileRef="mosquitto_exe"
ExeCommand="install" />
<CustomAction Id="UnInstallMosquitto"
Execute="immediate"
Impersonate="no"
FileRef="mosquitto_exe"
ExeCommand="uninstall" />
<InstallExecuteSequence>
<Custom Action="InstallMosquitto" After="StartServices" Condition="(INSTALLECLIPSEMOSQUITTO=1) AND (NOT Installed)" />
<Custom Action="StartMosquitto" After="StartServices" Condition="(INSTALLECLIPSEMOSQUITTO=1) AND (NOT Installed)" /> </InstallExecuteSequence>
<InstallExecuteSequence>
<Custom Action="StopMosquitto" Before="InstallInitialize" Condition="(INSTALLECLIPSEMOSQUITTO=1) AND (Installed) AND (REMOVE~="ALL")" />
<Custom Action="UnInstallMosquitto" Before="InstallInitialize" Condition="(INSTALLECLIPSEMOSQUITTO=1) AND (Installed) AND (REMOVE~="ALL")" /> </InstallExecuteSequence>
<ComponentGroup Directory="INSTALLFOLDER" Id="EclipseMosquittoGrp">
:
<Component Id="mosquitto_exe" Guid="DF631CDC-7EC5-4E8F-958B-AD2BE078251F" >
<File Id="mosquitto_exe" Source="$(var.mosquittoResources)\mosquitto.exe" KeyPath="yes" Checksum="yes" />
</Component>
:
:
</ComponentGroup>
:
:
<!-- Include eclipse mosquitto files defined in this feature only when user has ticked the checkbox -->
<Feature Id="EclipseMosquittoFeature" Title="Eclipse Mosquitto Broker" Level="0" AllowAdvertise="no" AllowAbsent="no">
<ComponentGroupRef Id="EclipseMosquittoGrp" />
<Level Condition="(INSTALLECLIPSEMOSQUITTO=1)" Value="1"/>
</Feature>
</Fragment>
</Wix>
-------------------------------
Notes :
======
1) Running on windows 10 : x64
2) INSTALLECLIPSEMOSQUITTO property is set to 1 if the user ticks the checkbox in the UI
3) On install eclipse mosquitto service gets created & started. Also the application installed correctly
4) On uninstall mosquitto service get stopped and service deleted and the application uninstall correctly
Problem :
========
To test the major upgrade
I increement the version number in the Package element in product.wsx and in the Bundle element in Bundle.wsx
The upgrade fails at StartMosquitto Custom Action
If I test this with Commented line
<Custom Action="StartMosquitto" ..../>
in the InstallExecuteSequence the upgrade is successful
This ment Action="InstallMosquitto" is failing.
So after the successful upgrade I manually ran the following command
mosquitto.exe install
to install the mosquitto service and then
sc start mosquitto
to start the mosquitto service
and all works good
Any idea why is the InstallMosquitto and the StartMosquitto acions failing
how to should I configure the custom action properly?
Thanks
Om
This Email and any files transmitted with it are intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any reading, redistribution, disclosure or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient please contact the sender immediately and delete the material from your computer. E-mail may be susceptible to data corruption, interception, viruses and unauthorised amendment and Domino UK Limited<http://www.domino-printing.com/Channels/UK/eng/Home.aspx> does not accept liability for any such corruption, interception, viruses or amendment or their consequences.
Domino UK Limited<http://www.domino-printing.com/Channels/UK/eng/Home.aspx> Registered in England. Registered Number:1750201. Registered Office Address: Trafalgar Way, Bar Hill, Cambridge, CB23 8TU.
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list