WiX is a tool for making MSI installation files, and looking at a half-day document, it feels like nothing is more straightforward than an example.
<?XML version= "1.0" encoding= "UTF-8"?><Wixxmlns= "Http://schemas.microsoft.com/wix/2006/wi"> <ProductId="*"Name= "Hellomsi"Language= "1033"Version= "1.0.0.0"manufacturer= "LEH"UpgradeCode= "1de12ee7-2e94-42ac-979f-06245a0ade31"> < Packageinstallerversion= "$"Compressed= "Yes"Installscope= "Permachine" /> <MediaId= "1"Cabinet= "Media1.cab"Embedcab= "Yes" /> <DirectoryId= "TARGETDIR"Name= "SourceDir"> <DirectoryId= "ProgramFilesFolder"> <DirectoryId= "Installfolder"Name= "HelloWorld"> <ComponentId= "Productcomponent"Guid= "b5f0c012-49d6-4c63-afca-0ce6c24c6d7e"> <FileId= "HelloWorld"Source= "HelloWorld.exe" /> </Component> </Directory> </Directory> </Directory> <FeatureId= "Productfeature"Title= "HelloWorld" Level= "1"> <ComponentrefId= "Productcomponent" /> </Feature> < PropertyId= "Wixshellexectarget"Value= "[#HelloWorld]" /> <CustomActionId= "LaunchFile"Binarykey= "Wixca"Dllentry= "Wixshellexec"impersonate= "Yes"/> <InstallExecuteSequence> <CustomAction= ' LaunchFile ' After= ' InstallFinalize '>Not installed</Custom> </InstallExecuteSequence> </Product></Wix>
Save this piece of XML as PRODUCT.WXS, remember that it is UTF-8 encoded, and then execute it under the command line:
- out Helloworld.msi-/I helloworld.msi/qn
Forget to say the premise of the operation:
- Install WiX and add it to path
- command line needs to be opened with administrator privileges
- Change the GUID in the example.
What you just did, is actually:
- Wrap the Helloworld.exe into the MSI installation file Product.msi
- Then install Product.msi silently
- Run the Helloworld.exe file immediately after installation is complete
[References]
A flat "WiX Learning to Organize"
"How to:run the installed application after Setup" on the WiX website
StackOverflow "Open readme.txt at end of Installatin failed in WiX"
Notes WiX making an MSI installation package example