2017-04-08

Transitioning from InstallShield LE to the WiX Toolset

I am making the transition from using InstallShield LE (Limited Edition) to using the WiX toolset for the installation of the Xoc Maya Calendar program that I developed. Both InstallShield and WiX use the Microsoft Windows Installer to do the heavy lifting. The Microsoft Windows Installer is a database with the extension .msi that has all of the information to install a program inside it. It cannot do a few things, though, such as install the .NET Framework before it runs. For that it needs a bootstrapper program that does the install of the framework, extracts the MSI file, then uses the Microsoft Installer exec (msiexec.exe) program to actually do the main install.

InstallShield provides an interface for creating both the MSI file and the bootstrapper. However, it has some limitations that have caused me to move to using WiX. These are the reasons I have moved:
  • The full version of InstallShield is expensive. It is $699 to $4999 depending on the version you get. There is a Limited Edition version, however, that was less, and that was what I was using.
  • The Limited Edition came with Visual Studio 2015 Professional. However, it did not work with the Community Edition. The Community Edition is the free version of Visual Studio for very small companies (like mine) and educational purposes. As a Microsoft Alumni, I can get Professional Edition at a steep discount, but it gives me no benefit over the Community Edition, except providing the license to use InstallShield LE.
  • InstallShield LE is just that, limited. There are many kinds of installs that it won't create. WiX can create anything that the MSI files support.
  • However, this is the killer: InstallShield LE is not out for Visual Studio 2017. It's not just that it isn't out now, and might be out in a month, it's that there might be significant periods in the future where it is unavailable when there is a lag between a Visual Studio release and an InstallShield release.

WiX is free and open source. The main drawback is that the learning curve to using it is steep. It is configured entirely by XML files; there is no user interface other than some minimal integration with Visual Studio. There are some attempts at providing a UI to creating the XML files, but none of them is as slick as InstallShield. It's not that XML configuration is difficult. I actually prefer XML to a UI, it's that there are a lot of options, and in some cases, it is not entirely clear how they interact. The UI can provide a list of Windows releases or .NET Framework releases rather than knowing exactly what value that needs to be entered into the XML.

After a few days of working with WiX, I broke down and essentially bought the documentation, which is the book WiX 3.6: A Developer's Guide to Windows Installer XML. (WiX is on 3.11 with 4.x in beta at this point, but the book is still the best there is.) This book is really essential for creating WiX installs. The documentation of each of the entries in the XML file is on the WiX web site, but the way to tie them together to make an install is found in the book. With a few days of working my way through the book, I am well on my way to having a new install process.

There is one tip that you may find useful if you make the transition from InstallShield to WiX. (I, of course, found this out after I had done most of the work by hand!) You can actually use some tools to create an equivalent WiX WXS file from the InstallShield executable. You will need the InstallShield setup file and the dark.exe tool that comes with the WiX toolset. Assuming that the setup program is setup.exe, that the MSI file that it extracts is setup.msi, and that the dark program is on the path, from an elevated command prompt execute the following commands:

setup.exe /x /b"." /v"/qn"
dark -x . "setup.msi" "setup.wxs"

The first line extracts the MSI file from the InstallShield executable into the current directory. The second line extracts the binary resources from the MSI file into sub-directories and creates a file called setup.wxs that has the WiX XML necessary for producing that MSI file. The WXS file will have a lot of cruft in it created by InstallShield that should be cleaned up, but it will save you a lot of work on trying to create an equivalent WiX file for the InstallShield setup.

No comments :

Post a Comment