[wix-users] Quiet Execution CA Documentation Issue

Joel McBeth Joel.McBeth at zuerchertech.com
Fri Mar 30 12:50:09 PDT 2018

I don’t know where I got InstallExecute from, I thought it was a built in action. The point I am at now is I have the SetProperty action scheduled after InstallInitialize. Also the command action is only intended to run on an update so the file should already exist. I’ve added a condition on WIX_UPGRADE_DETECTED for that. Although I think it would make sense to do it on an uninstall instead since I only do major upgrades, unfortunately I already have installs out in the wild that won’t do this on uninstall.

This is what I am at now:
    <SetProperty Id="StopSolr" Value=""[INSTALLDIR]bin\solr.cmd" stop -all" Before="StopSolr" Sequence="execute">
    <CustomAction Id="StopSolr" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="deferred" Return="check" Impersonate="no" />

      <Custom Action="StopSolr" After="InstallInitialize">

Which seems to run where I want it, I think. Unfortunately, I can’t get it to run the custom action as 64-bit even with the platform set to x64. But that’s an entirely different issue I’m still looking into.

The bit about [#solr.cmd.file.id<http://solr.cmd.file.id>] is a good idea, I will have to try that. I was trying to find a better way to get that path, to make sure the file actually exists and I was unable so I just used INSTALLDIR.

From: Edwin Castro [mailto:egcastr at gmail.com]
Sent: Friday, March 30, 2018 13:00
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Joel McBeth <Joel.McBeth at zuerchertech.com>
Subject: Re: [wix-users] Quiet Execution CA Documentation Issue

The scheduling for //SetProperty/@Id="StopSolr" must happen after CostFinalize since that is when directory and file paths are completely resolved. I don't have a lot of experience with InstallUISequence because I build only MSI packages without UI but if the StopSolr property is not used beyond the StopSolr custom deferred action then scheduling it only in InstallExecuteSequence makes sense.

The scheduling for //Custom/@Action="StopSolr" doesn't seem right... InstallExecute is not a standard action... Is it a custom action you defined? For it to run deferred it must be scheduled between InstallInitialize and InstallFinalize. For the solr.cmd file to be available, this custom action must be scheduled after InstallFiles. Is the perhaps meant to run during uninstall instead of installs? If so, you'll want to condition this appropriately and schedule before RemoveFiles.

Side note: if solr.cmd is installed by your MSI, then consider using [#solr.cmd.file.id<http://solr.cmd.file.id>] instead of [INSTALLDIR]\bin\solr.cmd where solr.cmd.file.id<http://solr.cmd.file.id> is the file id for solr.cmd. [#solr.cmd.file.id<http://solr.cmd.file.id>] will resolve to the full path of the file given by solr.cmd.file.id<http://solr.cmd.file.id>. For details see:


Edwin G. Castro

On Fri, Mar 30, 2018 at 8:05 AM, Joel McBeth via wix-users <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>> wrote:
I was following the document for Quiet Execution Custom Action, found here: http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html

I'm trying to run a batch file stored in the [INSTALLDIR] for my application and the Deferred section it covers this. It documents how to use a property. However with the example provided I am finding that it gives me the error:

                Found an ActionRow with a non-existent Before action: <action name>.

The document says that the SetProperty must run immediate while the custom action runs deferred. The default sequence for SetProperty is 'both' and the command line custom action is only defined in the InstallExecuteSequence. To fix this error I set the sequence for SetProperty to execute.

So I end up with:

    <SetProperty Id="StopSolr" Value=""[INSTALLDIR]\bin\solr.cmd" stop -all" Before="StopSolr" Sequence="execute" />
    <CustomAction Id="StopSolr" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />

      <Custom Action="StopSolr" Before="InstallExecute"/>

Am I doing this correctly? Is that just something missing from the example in the document?

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

More information about the wix-users mailing list