When installing a .MSI file using msiexec in silent mode, is it possible to automate it such that on installation failure it rollbacks to the previous version? Assuming that on installation an older application version is already installed.
Yes, restoring the old application version via rollback upon an installation failure is actually a built-in feature of Windows Installer, but you need to configure things correctly to get it to work as you require.
Windows Installer rollback will work as you request if you use: 1) a minor upgrade or 2) a properly sequenced major upgrade that uninstalls the older versions after successfully updating all files. If the major upgrade is set to uninstall the old version before installing the new, the rollback is not available since the uninstall is already over, and the new installer will hence leave nothing installed if it fails and rolls back.
Important: For minor upgrades and for late uninstall of old version in major upgrades to work correctly, all MSI component rules must be followed 100% accurately.
When thinking about a major upgrade that uninstalls the old version after updating, you can view it as a patching operation without having the update packaged as a patch. Windows Installer will actually run a diff on the old and new version and then implement only the required changes, leaving the rest of the application untouched. Depending on the application structure and number of files, this can be significantly faster to install as well.
Late-sequenced major upgrades are also a way to prevent configuration files from being reverted to their original installation status during upgrades. This is a classic issue where config files are changed after installation, uninstalled during a major upgrade and then being reinstalled giving the impression that they are reverted, when they are actually freshly reinstalled.
I have written about Windows Installer Rollback before. Might be worth a read.
No, this is not possible. A major upgrade uninstalls the old version before installing your new one. So when the new install fails, the old version is already removed.
There is a possibility but it involves changing the upgrade sequence which is not always an easy thing to achieve. You should move the RemoveExistingProducts after InstallExecute action
http://msdn.microsoft.com/en-us/library/windows/desktop/aa371197(v=vs.85).aspx
Related
Our installer installs a USB driver for some custom hardware. During development, we frequently uninstall one version and reinstall another (usually a newer version but sometimes older - the driver never changes.) Despite the InstallShield "Component" being marked "Uninstall No" on the component configuration page, the driver is in fact removed.
When the new version is installed, the driver is once again reinstalled, but since it has previously been removed, none of the USB devices are found. If we physically remove and reinstall the USB modules, the driver is loaded properly.
How do I tell InstallShield to leave the driver alone during uninstallation? Truthfully, it is, at worst, an inconvenience, but it is highly problematic that making an explicit configuration setting that says "Uninstall No" is ignored by InstallShield.
You could mark the component to which the driver is associated as permanent, but then there's no way to remove it.
It sounds like you need to structure things differently. Either you can use an approach that doesn't fully uninstall things during an upgrade (such as a major upgrade with RemoveExistingProducts scheduled late), or by splitting the driver into a separate package so that there's no need to try to uninstall the driver.
If you split the packages, you could either install the driver package as a prerequisite dependency that would be uninstalled manually from Programs and Features, or you could leverage the Suite project and just upgrade the non-driver package. With the either of those approaches you would not have to worry about the scheduling of RemoveExistingProducts in the non-driver package.
I'm trying to delete old versions of nuget packages from my solution. I go to the packages dir and I see a lot of old packages that have already been updated.
So I delete them. By app is running fine afterwards.
But when checking in the solution to TFS (Visual Studio Online) I get the old packages back (!)
Deleted them again and went to the Resolve Conflicts screen. There are the old packages. The concflict:
The local changes can not be applied to the target version because they are redundant
I only have the option 'Take Server Version" but that restores (!) the old package. Strangely the conflict window says
local version is 986, Server version is 1020.
Changes are: local(delete), server(delete).
I've try to deleted the packages in a earlier stage.
So why does TFS restores my old and useless Nuget packages and how to check in the solution without having this old packages restored again.
it sounds as though you have a pending, delete. run the Server side delete and then get latest. then update your packages. this should clear the issue.
NuGet Packages shouldn't be stored in TFS, you should restore them as part of the build process
I'm currently updating my installer (Basic MSI) for a program to v5.00.0000. I need InstallShield to check that if it's an upgrade, it must be on at least 4.00.0034.
So if it's not previously installed, it installs ok.
If it's on 4.00.0020, it must return a message to say please upgrade to v4.00.0034 first.
Thanks,
Ian.
Examine the ISPreventDowngrades action and the major upgrade item that finds newer versions, or read up on how to prevent downgrades. You can then copy this approach, tweaking it to instead find and error out on ones less than 4.0.34.
We have an application, in which we have series of releases. The current version of the application in production was V2.1
Now we have a set of new UI Screens to be added and related changes to the application. We are planning to release these changes as V3.0.
Do we need to go with Major Upgrade or Minor Upgrade? If we go with Major Upgrade, do we need to reinstall the application? or change the version to 2.2 and go with Minor Upgrade?
Please suggest me some best way to go about with these installers.
Note: We are using Install Shield Premium for building the installer.
If the only changes you are making are to the UI of your installation wizard, there is no fundamental reason to prefer either a minor or a major upgrade over the other. Typically the choice is driven by the changes you are making to the application itself, or the files that comprise it.
A Minor Upgrade will support first-time installations, as well as provide what should be a shorter update for the upgrade experience. A Major Upgrade will uninstall what's currently there before installing the new version. Either can be done with either sets of version numbers - the difference depends primarily on whether you change your ProductCode.
See Patching and Upgrades for details. Some people prefer creating Major Upgrades because they are easier to reason about.
I've followed the instructions outlined here, but it doesn't work exactly as I need.:
How to get InstallShield LE to uninstall the existing installation automatically? (apparently this has worked for other people, so it's worth having a look. If it does the trick, be sure upvote #JYelton's answer)
The result of these instructions are that I can install the application without having to uninstall, but now there are 2 separate instances of the application in my Add or Remove Programs window. It doesn't actually uninstall the previous version, it just installs the new version application along-side the previous one.
How can I make InstallShield uninstall previous versions of the application?
Configure the new project to remove the old one by using the Upgrade Paths view: Add a New Upgrade Path, and browse to your previous .msi file to ensure it uses the right Upgrade Code. Then tweak the settings that appear, if necessary; typically they should be correct.