Automatic Updates and Updates for Windows Installer XML (WiX)

I use InstallShield LE in Visual Studio 2010, but it is very limited and sometimes erroneous. I watched paid versions of InstallShield, but they also have too many restrictions for this price tag.

So, I decided to switch to WiX. A few years ago I had some experience. It was pretty easy to create a simple installer using SharpDevelop using WiX tools.

Now I'm trying to build solutions and tools for WiX. Basically, I need to get the following functions (requested by my client):

  • when I run the installer, it should check the text file on the server and see if a newer version is available. If so, then the installer should be able to download the updated installer package and run it (are there any bootloader utilities in WiX?)

  • dependency resolution. The main dependency of my application is .NET 4 (which itself depends on the Windows 3 installer). The installer should prompt the user to automatically download and install them.

  • logging the installation process, as well as collecting the log file of the dependency installation process. I do not want the user to view various .log files in the event of a failure in the installation of .NET4 or WindowsInstaller3. All information should be collected in one place, and if something fails, I must show the user a custom pop-up dialog box with the ability to save the full installation log file and send it to me

  • The installer should be able to detect if there is a newer version of my application already installed and show a meaningful customized error message before it exits

  • The installer should be able to determine if an outdated version of my application is already installed. and prompt the user to exit the installation or uninstall the previous version and install the new version. BTW, no minor component updates are planned, I prefer to reinstall all fresh ones (I think this is a serious update in terms of WindowsInstaller). Installshield LE failed for me, it just showed a window with a message about another product, but did not offer to remove it.

  • in case of an update, the installer should be able to detect whether some of the application components are being used (application processes are running) and display its own error message, and not just some critical “Installation Error”

I read that it can be a little painful to manage updates, even if I keep my UpgradeCode code intact, because this code is stored in the Windows registry in a compressed way, and also if the user renames the downloaded file, it may get detected as a completely new WindowsInstaller product .. . Or maybe this only applies to MSI files WindowsInstaller and WiX to avoid this problem?

About downloading updates - I also need this functionality in my application. I'm not sure how to implement it effectively, so I can reuse the same code / update download utility in both the WiX installer and my application.

Is it possible to satisfy all these requirements using currently existing WiX tools, or maybe I will need to encode some components from scratch?

+7
source share
1 answer

WiX is definitely suitable for my opinion.

  • when I run the installer, it should check the text file on the server and see if a newer version is available. If so, then the installer should be able to download the updated installer package and run it (are there any bootloader utilities in WiX?)

    In my opinion, this type of functionality is best handled by the application. However, you can implement this functionality in a custom boot block. The latest WiX development includes a Burn boot mechanism that lets you write your own custom boot block on top of it.

  • dependency solutions. The main dependency of my application is .NET 4 (which itself depends on the Windows 3 installer). The installer should prompt the user to download and install them automatically

    You can use the standard WiX bootstrapper to install .NET as preereq. Or, if you create your own custom bootstrapper managed application, you can install .NET on prereq on your bootable media, as in this example

  • logging the installation process, as well as collecting the log file of the dependency installation process. I do not want the user to search for various .log files in the case of .NET4 or WindowsInstaller3 the installation fails. All information should be collected in one place, and if something fails, I must show the user a customizable pop-up dialog box with the ability to save the full installation log file and send it to me

    Using two boot methods, when you start your msi, you can specify options for logging. In my own managed bootloader, I created a button to open the log files created during installation.

  • The installer should be able to detect if there is a newer version of my application already installed and show a significant individual error message before it comes out

    You can do this using the launch conditions.

  • The installer should be able to determine if an outdated version of my application is already installed. and prompt the user to exit the installation or uninstall the previous version and install the new version. BTW, there are no planned minor component updates, I prefer to reinstall everything fresh (I think this is a serious update in the context of WindowsInstaller). Installshield LE failed for me, it just showed a window with a message about another product, but did not offer to remove it

    In my experience, these major updates are the least complicated approach.

  • in case of an update, the installer should be able to detect whether application components are being used (application processes are running) and show their own error message, and not just some of the cryptic "Installation failed"

    I think the WiX / Windows installer is usually good at handling these scenarios and automatically notify the user that the files / applications should be disabled without the need for anything extra in your installer.

All that being said, you may want to explore your own managed bootable media using WiX and Burn. However, this is not trivial. The best place to download is to download the source code in WiX Weekly Releases and check out the src \ Setup \ WixBA project. This is the custom BA they wrote to install WiX. There is still not much documentation, because WiX 3.6 has not been released (although it is pretty stable). However, you do not need to create your own BA to create a reliable WiX installer that can handle updates and logging.

+9
source

All Articles