Check for Online Update in WIX - wix

I work on WIX installer, I want the auto-update system that ClickOnce provide. I upload the new version on server and the end client can check online to see if there is a newer version available.
Can WIX do this?
Thanks.

You need to write something yourself to check for updates and download the new installer. Once you have the new installer, WiX can handle upgrading the version installed on the end user machine. Typically people have a secondary executable embedded within the main program which is responsible for launching the downloaded installer, so that the main program can close during the update process.
In the past, I've handled checking for and downloading updates with NAppUpdate, which is easily extensible for however you want it to behave. I'm sure there are plenty of other open source alternatives to handle this as well.

Wix does not have the capability to do so.
You can read the diffrences between ClickOnce and Wix (Windows installer) from:
https://msdn.microsoft.com/en-us/library/ms973805.aspx
I think you can wrap MSI in ClickOnce and use both.
Also you have Squirrel (Like clickonce) that is based on PowerShell but may not work on all target machines.

Related

How to uninstall a non-msi InstallShield setup in Wix toolset

I have an old installer that is made with InstallShield 2015, its non-MSI based (I tried opening it with 7zip and could not --> non-MSI based, am I right?).
In general, I need to stop using InstallShield and migrate to Wix.
Is it possible some how to convert InstallShield it to Wix?
Using Wix, I need to detect if a previous version (the InstallShield version) is currently installed and automatically uninstall it and then continue with the normal Wix process. Is such a thing possible?
Thank You :-)
I'll add a quick answer for reference, though the problem appears solved already.
If the old Installshield setup is an MSI, you can use dark.exe from the WiX toolkit to "disassemble" an MSI into WiX source code (dark.exe can also decompile WiX setup.exe bundles - there is a somewhat messy description of this here: How can I compare the content of two (or more) MSI files?).
After some cleanup you can compile the WiX source to a new WiX-built MSI. A bit of knowledge and experience is needed for the cleanup to be successful (eliminating GUI sections, add a WiX GUI, realign source paths, clean up binary stream tables, etc... - not trivial, but not rocket science :-).
If the old setup was a legacy installer (not MSI), you can convert it to MSI by using a repackager tool to capture changes done to the system during installation and convert them to an MSI. A lot of knowledge is required to clean up such a capture. If you know the product it is often better to code a new setup "by hand". Or if you are in a large corporation chances are you will have a "repackaging team" available somewhere who will have the expertise to do this job for you.
Yes, old setups can be uninstalled as part of your new MSI.
As you discovered if the old setup was an MSI you can simply use a major upgrade to remove it during the new WiX install.
If the old version was a legacy setup things can get considerably more involved often requiring you to "record" a dialog response file to feed to the uninstaller function of the old setup.exe file. Not at all trivial, and quite error prone. Incidentally one of the major benefits of MSI is the completely suppressible GUI.
For reference, here is an old answer with information on dealing with the infamous setup.exe files that we frequently have to uninstall and upgrade:
How can I use powershell to run through an installer? The setup.exe can be many different things: Installshield Setup, Advanced Installer Setup, Inno Setup, Self-Extracting Zip-Archive, a proprietary setup format, the list goes on...

how to download custom software and install using WIX

I am writing managed bootstrapper application and would like to make it work like Web-based installer (force it to download msi from webserver).
Where will product be downloaded by default? Why SourceFile is mandatory for download of package?
please share sample code.
Separating the concerns:
Managed bootstrapper application
Great. The standard application is very basic. The managed bootstrapper application for WiX itself shows how creative you can get.
Work like Web-based installer
From the following questions, it seems you know about the DownloadUrl attribute.
Where will product be downloaded by default?
It would be a special case to have to know this. The bootstrapper engine (burn) is a package manager and takes care of performing operations with the downloaded package.
Why SourceFile is mandatory for download of package?
SourceFile indicates the location on your build machine. WiX creates a checksum from it so burn can tell if the download is corrupted or different than what was planned.

How to call a custom action from a UI in Wix

I am trying to add a delay to an installer. The reason for this is the installer must run a third party driver, but windows does not give "the device is ready to use" notification in time.
This leads to issues for the software as the version to be installed is determined by the device the driver is used for.
What I would like to do is generate a UI that will count down from say 10 to 1 before allowing the user to then proceed.
I have searched through documentation but haven't found anything in Wix that is capable of dong this.
Is this possible in Wix or how can I implement this?
The general answer is that you do a publish event from the dialog, as in this tutorial:
http://wix.tramontana.co.hu/tutorial/events-and-actions/control-your-controls
It sounds like this driver package is a prerequisite to installing your MSI. Therefore I'd create a burn bootstrapper bundle to install it before installing your MSI. I'd have to know more about this package but I suspect the thing to do is create a custom EXE to encapsulate the process and then wait up to 10 seconds while confirming the package is fully committed. Then it can return and burn will carry on to your MSI installation.
You shouldn't be installing drivers (or making any configuration changes to the machine) during the UI phase of your MSI.

Auto self updating application installer with WIX?

I have standalone setup project created with wix. And I need some solution for auto update my application.My application should check for new version on start up and automatically download and install new version if available.What's the best solution to do this? Can anyone give me some examples?Thanks.
If you use Burn as your bootstrapper/chainer (something I definitely recommend when distributing MSI files over the internet) then you can create a custom bootstrapper application that implements the update mechanism. This is how the WiX toolset updates itself. You can see the code in WiX v3.7 (or later) branch in src\Setup\WixBA\UpdateViewModel.cs.

Automatic updating and upgrade management for Windows Installer XML (WiX)

I have been using InstallShield LE in Visual Studio 2010, but it is heavily limited and sometimes buggy. I looked at paid InstallShield versions, but these also have too many limitations for that price tag.
So I decided to switch to WiX. I have had some experience with it some years ago. It was pretty easy to build a simple installer using SharpDevelop with WiX tools.
Now I am trying to collect solutions and tools for WiX. Basically, I need to get the following functionality (requested by my client):
when I launch the installer, it should check a text file on the server and see if a newer version is available. If it's the case, then the installer should be able to download the updated installer package and launch it (are there any downloader utilities in WiX?)
solving dependencies. Major dependency of my app is .NET 4 (which itself depends on Windows Installer 3). The installer should offer the user to download and install them automatically
logging the installation process, also collecting the log file of the dependencies' installation process. I don't want the user to hunt various .log files in case .NET4 or WindowsInstaller3 installation fails. All the information should be collected in one place and if something fails, I should show the user a custom popup dialog with an option to save the complete install log file and send it to me
installer should be able to detect if there is a newer version of my app already installed, and show a meaningful customized error message before it exits
installer should be able to detect if there is an older version of my app already installed. and offer the user to exit installation or uninstall the previous version and install the new version. BTW, there are no minor component upgrades planned, I prefer to reinstall everything fresh (I guess, this is a major upgrade in the terms of WindowsInstaller). Installshield LE failed on me for this, it just showed an error box with the message about another product, but did not offer to uninstall it
in case of an upgrade, installer should be able to detect if some of application components are in use (running application processes) and show a custom error message and not just some cryptic "Installation failed"
I have read that it may be a bit painful to manage upgrades even if I keep my UpgradeCode intact, because this code is stored in the Windows Registry in a compressed way and also if the user renames the downloaded file, it might get detected as a completely new product by WindowsInstaller ... or maybe this is only the case with WindowsInstaller .msi files and WiX has some trick to avoid this issue?
About update downloading - I need this functionality also in my application itself. I am not sure how to implement it efficiently, so I can reuse the same update downloader code/utility in both WiX installer and in my app.
Is it possible to satisfy all these requirements using currently existing WiX tools, or maybe I'll need to code some components from scratch?
WiX is definitely the way to go in my opinion.
when I launch the installer, it should check a text file on the server and see if a newer version is available. If it's the case,
then the installer should be able to download the updated installer
package and launch it (are there any downloader utilities in WiX?)
In my opinion, this type of functionality is best handled by the application. However you can implement such functionality in a custom bootstrapper. The latest development of WiX includes a bootstrapper engine Burn that allows you to write your own custom bootstrapper on top of it.
solving dependencies. Major dependency of my app is .NET 4 (which itself depends on Windows Installer 3). The installer should offer
the user to download and install them automatically
You can use the standard WiX bootstrapper to install .NET as a prereq. Or if you create your own custom managed bootstrapper application, you can install .NET a prereq to your bootstrapper as in this example
logging the installation process, also collecting the log file of the dependencies' installation process. I don't want the user to
hunt various .log files in case .NET4 or WindowsInstaller3
installation fails. All the information should be collected in one
place and if something fails, I should show the user a custom popup
dialog with an option to save the complete install log file and send
it to me
Using the two bootstrapping methods above, when you launch your msi you can specify parameters for logging. In my own custom managed bootstrapper I created a button to open the log files created during installation.
installer should be able to detect if there is a newer version of my app already installed, and show a meaningful customized error
message before it exits
You can do this using launch conditions
installer should be able to detect if there is an older version of my app already installed. and offer the user to exit installation or
uninstall the previous version and install the new version. BTW,
there are no minor component upgrades planned, I prefer to reinstall
everything fresh (I guess, this is a major upgrade in the terms of
WindowsInstaller). Installshield LE failed on me for this, it just
showed an error box with the message about another product, but did
not offer to uninstall it
In my experience this major upgrades are the least complicated
approach.
in case of an upgrade, installer should be able to detect if some of
application components are in use (running application processes) and
show a custom error message and not just some cryptic "Installation
failed"
I think WiX/Windows Installer are generally good at handling these
scenarios and automatically notifying the user that
files/applications need shutdown without you having to author
anything extra in your installer.
All that said, you may want to look into creating your own custom managed bootstrapper using WiX and Burn. That is not trivial however. The best place to go is to download the source code to the WiX Weekly Releases and checkout the project src\Setup\WixBA. It is the custom BA that they wrote to install WiX. There isn't much documentation out there yet because WiX 3.6 is not released (although it is pretty stable). However you don't have to create your own BA to make a solid WiX installer that can handle upgrades and logging.