1

I am trying to execute my.exe using your.exe. It's not working as expected.

Here is the code snippet:

   <?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="my_name" Language="1033" Version="1.11.5164" 
             Manufacturer="company" UpgradeCode="PUT-GUID-HERE">
       <Package Description="Test file in a Product" Comments="Simple test" 
                InstallerVersion="200" Compressed="yes" />
       <Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
         <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Name="my_folder" Id="MY_FOLDER">
                  <Component Id="your.EXE" DiskId="1" Guid="*">
                    <File KeyPath="yes" Id="your.exe" Name="your.exe" 
                          Source="your.exe" />
                  </Component>  
                </Directory>
            </Directory>
        </Directory>
        <Feature Id="MainFeature" Title="Main Feature" Level="1">
                   <ComponentRef Id="your.EXE" />
        </Feature>
        <CustomAction Id="StartAppOnExit" Property="StartAppOnExit" ExeCommand="[SystemFolder]cmd.exe /C your.exe my.exe " Execute="immediate" Return="asyncNoWait" /> 
    <InstallExecuteSequence>
      <Custom Action="StartAppOnExit" After="InstallFinalize">NOT Installed</Custom> 

     </InstallExecuteSequence>
    </Product>
    </Wix>
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
coder
  • 11
  • 1

1 Answers1

0

The custom action StartAppOnExit can't find your.exe. Try using a Directory attribute instead of a Property attribute:

<CustomAction Id="StartAppOnExit" Directory="MY_FOLDER" ExeCommand="[SystemFolder]cmd.exe /C your.exe my.exe " Execute="immediate" Return="asyncNoWait" />
<InstallExecuteSequence>
  <Custom Action="StartAppOnExit" After="InstallFinalize">NOT Installed</Custom>

</InstallExecuteSequence>

This should run your.exe passing the argument my.exe.

See also Start application after installation.

Community
  • 1
  • 1
bradfordrg
  • 1,863
  • 2
  • 21
  • 34