2

Is it possible to include C++ code inside a Wix Project. For example either
1. Have C++ inside a file with extension ".wxs" (Wix source file)
2. Or Create ".cpp" file inside the Wix project and run it from Wix. ( I tried this, but Visual Studio doesn't allow me to create .cpp file in the project ... but only wxs & wsi files )

Mouhcine
  • 276
  • 1
  • 2
  • 12

1 Answers1

1

No, you cannot directly include C++ Code/File in WIX project.
You can write your own C++ Custom Action and then call it from your wix project.
NOTE
You should not use a custom action to do things that the installer itself can do.

For Your Reading
http://bonemanblog.blogspot.in/2005/10/custom-action-tutorial-part-i-custom.html
http://blogs.technet.com/b/alexshev/archive/2009/05/15/from-msi-to-wix-part-22-dll-custom-actions-introduction.aspx

Nimish
  • 709
  • 3
  • 16
  • Hello and thank you for the very useful hints ! "C++ custom action" is the keyword I'm looking for. – Mouhcine Dec 20 '13 at 13:49
  • _Updated Further Reading_: A useful [guide](https://www.firegiant.com/wix/tutorial/events-and-actions/whats-not-in-the-book/) to implement custom C++ action and an [example](https://github.com/rstropek/Samples/tree/master/WiXSamples/VisualStudioSnippetInstaller). – m7913d Jan 23 '20 at 10:00