Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create .msi installer with WiX

Can someone help me understand how WiX works? I have a directory structure which I would like to create an installer for. I have generated the for the directory structure with heat.exe and when I build the setup project it generates an .msi file but I don't think it installs anything.

Maybe someone can walk me through the steps of generating a .msi installer.

Any advise is appreciated, Thank you

like image 968
Alin Avatar asked Feb 09 '15 16:02

Alin


3 Answers

If you're using Visual Studio:

  1. Install the WiX Toolset V3 Visual Studio plugin.
  2. Install the Wax interactive editor.
  3. Build your project if you haven't already.
  4. Add a new project to the solution containing the project you want to create an installer for.
  5. Choose the template Setup Project for WiX v3.
  6. Name the installer. A personal convention is the name of the project plus ".Setup"
  7. A Product.wxs file will open up. Change the Manufacturer="" value to something like your company name or your name. Keep the file open.
  8. Go to Tools -> WiX Setup Editor
  9. On the left under Root Directory choose InstallFolder
  10. Under Projects to install, choose the project you want to install.
  11. In the red area to the right, you'll see a list of files. These are the output results of your build from step 3.
  12. Click the plus sign next to files you want to copy. They should turn white and change to a Resolved state.
  13. This might look daunting, but you're just telling it what to copy--which would be your project's executable, configs, dll libraries, and images it's dependent upon.
  14. You typically want to copy everything. If there are dll's you know you don't need, it's better to remove them as a dependency from the Visual Studio.
  15. Notice the Product.wxs has changed. It now has the files you checked off in the Setup Editor GUI added to the <Wix><Fragment><ComponentGroup> section. Save that file.
  16. Close the Setup Editor.
  17. Build the setup project you just configured.
  18. Open Windows explorer and go to that project's bin/Debug or bin/Release folder, depending on what mode you built in. There you'll see the .msi that you can copy to where you need.

To make an update, make the necessary changes and then change the version number in that project's Properties -> Application -> Assembly Information. Then also change it in Product.wxs <Wix><Product.Version>. Then just build your setup project again.

like image 66
Chad Hedgcock Avatar answered Oct 18 '22 08:10

Chad Hedgcock


Good tutorial here:

http://wix.tramontana.co.hu/

http://www.codeproject.com/Tips/105638/A-quick-introduction-Create-an-MSI-installer-with

They should get you started.

If you learn something about the MSI log that will also help - install the MSI with a command line that includes /L*vx

And "doesn't install anything" should be easy to check - are there are any files installed, or did it create an entry in Programs&Features?

like image 10
PhilDW Avatar answered Oct 18 '22 09:10

PhilDW


WiX is a language (XML/XSD) that serves as a way of authoring (compiling) Windows Installer (.MSI) databases. WiX doesn't install anything, MSI does.

I maintain an open source project called IsWiX. The concept is simple. IsWiX provides additional WiX project templates (scaffolding) and graphical designers to assist you in creating installer. Then as you gain knowledge of WiX and MSI you can make additional tweaks of the WiX XML by hand and go beyond what IsWiX currently knows how to author.

Here's a video showing how to author, build and test an MSI to deploy an IIS website in a mere 3 minutes.

Update: IsWiX has tutorials now.

like image 7
Christopher Painter Avatar answered Oct 18 '22 09:10

Christopher Painter