Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix - How to run exe files after installation from installed directory?

Tags:

c#

.net

exe

wix

I'm using a program which is being installed using wix. (Don't know if it's relevant but it's a C# program)

I want to run an exe file which was installed by the msi file, but the location of the installation is unknown to me since the user chooses the installation path.

I wanted to ask for example of how to run an exe file from the location the user chooses.

Even though it's not a part of the question, I would also be glad to see some example of running an exe file from an absolute location since I'm a beginner to wix and doing it all for the first time.

like image 920
Yonatan Nir Avatar asked Oct 09 '13 12:10

Yonatan Nir


People also ask

How do I run a program after installing?

In Windows, to run a program, double-click the executable file or double-click the shortcut icon pointing to the executable file. If you have a hard time double-clicking an icon, you can click the icon once to highlight it and then press the Enter key on the keyboard.

How does WiX Installer work?

The WiX tools follow the traditional compile and link model used to create executables from source code. At build time, the WiX source files are validated against the core WiX schema, then processed by a preprocessor, compiler, and linker to create the final result.


1 Answers

The Isaiah4110 answer is not the best way if you don´t need a UI.

The simplest way to execute the exe file target you are installing through the MSI file produced by Wix is with a custom action type 18 (identifying the action by FileKey), here you are a complete example:

<Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">   <Component Id="TargetProgram" Guid="f757ff43-0266-483a-8749-ec796cba4b25" >     <File Id="EXE" Source="C:\SetupProject\Includes\TargetProgram.exe" />   </Component> </ComponentGroup>  <CustomAction Id="EXECUTE_AFTER_FINALIZE"                                 Execute="immediate"                Impersonate="no"               Return="asyncNoWait"               FileKey="EXE"               ExeCommand="" />  <InstallExecuteSequence>   <Custom Action="EXECUTE_AFTER_FINALIZE" After="InstallFinalize">NOT Installed</Custom> </InstallExecuteSequence> </Fragment> 
like image 119
Ibai Avatar answered Sep 22 '22 12:09

Ibai