[wix-users] Running a Batch File [P]

Steven Ogilvie Steven.Ogilvie at titus.com
Tue Sep 22 11:38:13 PDT 2015

Classification: Public
Here is an example:
I install an EXE and then run it later...

<Component Id="cmp_RestartExplorer" Guid="*">
            <File Id="file_RestartExplorer" KeyPath="yes" Source="$(var.resourcePath)\RestartExplorer.exe" />

Set up a custom action (you don't want the batch file to run with GUI so we use WiX quiet custom action method):

<CustomAction Id="CA_SetRESTARTEXPLORERONINSTALL" Property="CA_RESTARTEXPLORERONINSTALL" Value=""[#file_RestartExplorer]"" Execute="immediate" />
    <CustomAction Id="CA_RESTARTEXPLORERONINSTALL" BinaryKey="WixCA" DllEntry="CAQuietExec" Impersonate="yes" Execute="deferred" Return="ignore" />
      <ProgressText Action="CA_RESTARTEXPLORERONINSTALL">CA: Restarting Explorer</ProgressText>

Set the custom action to run at specific sequence <Custom Action="CA_SetRESTARTEXPLORERONINSTALL" After="InstallValidate">NOT Installed</Custom> <Custom Action="CA_RESTARTEXPLORERONINSTALL" Before="InstallFinalize">NOT Installed</Custom>

BTW you can turn on MSI logging via a property <Property Id="MsiLogging" Value="voicewarmupx"/>

MSI log files are created in %temp%


-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Kubilay Özisik
Sent: September-22-15 2:18 PM
To: WiX Toolset Users Mailing List
Subject: [wix-users] Running a Batch File

Hi there,

I'm trying to run a batch file after I install all the files during the installation. But it's not running the batch file and I can't figure out why. Can you please help?

<CustomAction Id="myBatchAction" Directory="MYWEBWEBSITE"
ExeCommand="[INSTALLDIR]MyBatch.bat" Return="check"/>

<Custom Action="myBatchAction" After="InstallFinalize">NOT Installed</Custom> </InstallExecuteSequence>

I'm shipping the MyBatch.bat file inside the INSTALLDIR, What am I doing wrong?

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


This message has been marked as Public by Steven Ogilvie on September-22-15 2:38:12 PM.

The above classification labels were added to the message by TITUS Message Classification. 
For more information visit www.titus.com.

More information about the wix-users mailing list