I am trying to create a new installer (using Wix) which will going to substitute the current one (InstallShield). Problem is many clients already have the application installed using the current installer. I need my new Wix installer to detect currently installed application perform the update or force the user to uninstall current application before running the new Wix installer.
I am new with creating installers. I need to know which GUIDs (and version numbers) must be the same for the system to know this is actually the same application just a new version. I didn't create the old InstallSheeld installer but I do have access to its code.
Thank you very much.
To uninstall the old InstallShield package, you should find out your old upgrade code and use that within your new WiX installer and do a major upgrade (which will ensure that the old package is uninstalled and removed). Check this Wix Upgrade document for doing the major upgrade.
Since we are on the topic, you can also make use of the Dark.exe to convert the current MSI into WiX source files.
Related
I'm using WIX to create a new installer for an existing product. The installer is very simple - just drops a few dll's into a specified folder on disk.
In the field, my users already have that folder with old dll's in them (since they installed the old MSI - created using a *.vdproj project in VS).
My problem is that after I install the WIX, I have both the old MSI and the new Wix MSI appear in Add/Remove. Expected (? since these 2 are two different kind of MSI's?). I need some kind of an upgrade mechanism - so I was wondering if I can call the old MSI uninstaller from within the WIX one. Or alternately somehow take care of the old Add/Remove entry (a registry hack perhaps?)
Assuming the old install and the new install are installed using the same context ( per-user -> per-user or per-machine -> per-machine ) you can use a MajorUpgrade rule to find the old version and get rid of it. You can do this by syncing up the UpgradeCode property and using a higher ProductVersion or you can do it by authoring a second Upgrade rule using the legacy UpgradeCode GUID.
If the old install was per-user and you want the new install to be per-machine you are out of luck. This isn't supported by MSI. Typically I only support per-machine installs and hardcode the ALLUSERS property and remove the CustomerInformation dialog from the installer UI experience. This is not the default experience for VDPROJ based installers.
I have my application set up to only allow one install. If the application is already installed wix nicely pops up with this message
Is there a way to give the user the option to uninstall the application at this time? I don't want my users to then have to go to menu -> app -> uninstall or control panel. I would like to make it easy for them to remove the old version and install the new one.
That message is a feature of Windows Installer - it's just the way everything works, based on the fact that the product's ProductCode and PackageCode are present on the system. Since that message comes from Windows (not WiX) there is no tailoring it to install the MSI file that prompted it.
You can't have the same ProductCode installed more than once per-system install, so an option to install another MSI with the same ProductCode doesn't exist unless you make it a minor update by installing an updated version of the MSI file with an update command line.
The way you make it easy to upgrade is to use the WiX MajorUpgrade tag. You also need to increment ProductVersion in the first 3 fields, have a new ProductCode, keep the same UpgradeCode, and decide where you want the upgrade sequenced, and that depends on whether you increment file versions for updated files, and preserve component IDs for the same resources. This installs the new product while uninstalling the older one. This standard automatic major upgrade doesn't say "do you want to upgrade to this new product?". It just does it, the assumption being that people are in fact pretty smart and they are well aware that they have a new version of an installed product and that this will upgrade it. The upgrade is also a fresh install for people who don't have any old versions installed.
I have a custom installer based on WiX technology which is install several .vsix packages into Visual Studio.
If this packages are already installed, the installer offers to remove them. After the removal process is completed, the installer exits.
It's normal behaviour, but I need to offer the user re-install this packages (optionally) before exit. I mean optional mode to uninstall the previous version and install the new one (or the same) with a single run of the installer.
How to implement this in WiX ?
I suspect your custom installer could be made a little smarter. There are plenty of APIs (such as MsiQueryProductState) that will tell you if that exact ProductCode is installed, and ways to get the version (MsiGetProductInfo). My guess is that your custom installer is just firing off all the MSI installs without checking if they are already installed, hence the Remove prompts.
Your general plan should be to have some data available to your custom installer that it can use to find out what's already installed and what the versions are, and then compare these with what you are about to install. Use those APIs. If the product is already installed then skip the install. If you have a newer version (that you built with the WiX MajorUpgrade element) then just install it because it will replace the existing older one.
There's nothing I can think of in WiX that would automatically reinstall a product that your custom installer caused removal of by re-installing it and prompting the user to remove it, if that's what's going on.
I am having an MSI file which copies a set of dll from it source to destination folder. While running the MSI the dll are copied to the destination folder also the MSI is installed in the system. I can see that in ADD or REMOVE programs.
Whenever there is a change in dll, i copying the new dll and building the MSI again. When i tries to run MSI in the same system i am getting error "Another version is already. Uninstall that version and proceed" something like that.
What i am doing until now is uninstalling the old one (MSI) and installing the new one.
But i want the MSI to update the older dll with the latest dll from the MSI instead of uninstalling and installing again.
Thanks in advance.
You can't just rerun the MSI to do an update. There's some background here, even if you are not using Visual Studio setups, and it's still relevant after all this time:
https://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
To replace a single file, build a patch, an msp file. To upgrade the entire setup, including that Dll then use the WiX majorupgrade element, and that may be a lot easier than building a patch, especially if your setup is small and doesn't take long to install. Increase the file version of the Dll to make sure it gets replaced.
welcome to StackOverflow - it seems to be your first post. I would read this thread if I were you to get an overview of how to implement a WIX major upgrade: How to implement WiX installer upgrade?. Here is another thread (didn't read this one through): How to get WiX major upgrade working?
A major upgrade is essentially an automatic uninstall of the existing version and reinstall of a new version. This is the least error prone update mechanism in Windows Installer. It is the recommended approach to try at first - it works well. A minor upgrade - which is upgrading the existing install, is generally more difficult to get right in the beginning. A number of technical restrictions apply. Here is a very good summary of what is required for a minor upgrade to work (as well as other details): http://www.installsite.org/pages/en/msi/updates.htm
Check out this well known wix tutorial for upgrades and patches. And MSDN.
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.