1

I am working on a WPF project. I have created a Wix project which runs along with the main project and has a program.cs component as well as the XML file.

Although I can see it creates the installer upon re-building the project, what is not clear to me is that why don't I have the actual WPF project inside it or as part of it. So really I don't install anything when I run it. Simply a shell program.cs file which is part of the Wix project.

I don't get the actual project at all. So how do I effectively "add" the WPF project to the WiX project so it generates the .exe or .msi file.

When I used the Windows native build project, I was able to get this however it is really tedious.

Thanks, Ibrahim

MADIM
  • 11
  • 1
  • This YT video helped me a lot, when I wanted to include a WiX installer to my VS Solution... I hope it helps you too... https://www.youtube.com/watch?v=-wyUxQux7xY – tombobadil Jan 20 '21 at 12:27
  • I would suggest reading https://github.com/iswix-llc/iswix-tutorials and watching https://www.youtube.com/watch?v=nnV_OU6fk8c. I am the author of IsWiX. If you can find your way to my email address hit me up. I offer complimentary 1 hour MSI/WIX tutorial sessions and can help you get started. If you'd rather someone else do the work I offer consulting also. – Christopher Painter Jan 20 '21 at 20:33
  • [WiX Quick Start Short Version](https://stackoverflow.com/a/63308043/129130) and [WiX Quick Start link collection](https://stackoverflow.com/a/25005864/129130). You compile your binaries and then include them in the WiX source file as finished binaries, not source files. [Random sample from Github.com](https://github.com/CascadesCarnivoreProject/Carnassial/blob/956ef071e59d6f771b598586d6f4ea8e69a78c88/Installer/Product.wxs) – Stein Åsmul Jan 21 '21 at 03:00
  • You can include your code and your setup projects in the same solution. Add a reference to your code project from the WiX project and you can use build variables such as these: $(var.ProjectName.TargetFileName) to resolve output location based on debug and release builds and bitness, etc... – Stein Åsmul Jan 21 '21 at 03:05

2 Answers2

0

Most of understanding how WiX works is understanding how Windows Installer works. WiX is mainly a language and compiler to author and build Windows Installer (.MSI) database files. It does have some additional extensions and the ability to create a bootstrappper / chainer (.EXE) and that is additional tech to understand.

MSI and therefore WiX should be thought of in terms of declarative programming rather then imperative. You describe the product, the UI experience, the feature/component/resources relationships or the "what" needs to be installed and MSI handles the "how" to install it.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

WiX newbie here too. I found that this tutorial to be helpful to get started: Create a simple setup. It walks you through creating a new WiX project in the Visual Studio. It creates a really simple installer (e.g. doesn't even add a shortcut to the Start Menu), but I think it will help with your understanding of how WiX works.

After you get the above example working, I'd suggest reading through this tutorial: How To: Create a Shortcut on the Start Menu. Note: I found that it was easier to copy/paste the entire code sample at the bottom of the page, replace everything in the default Product.wxs file in the WiX Visual Studio Project, and then replace references to your own files as needed.

sparks
  • 1,264
  • 1
  • 15
  • 29