Is it possible to run custom actions during uninstall using InstallShield 2009 - installation

I need to run a custom action during uninstallation of a ManagedCode which is a part of the installation (Before it is removed in the uninstall process)
Is it possible in Install Shield 2009?

Yes. You can run a ManagedCode custom action as part of the uninstall. You just need to sequences it in the Install Exec Sequence with a condition of REMOVE="ALL". InstallShield is just a wrapper around Microsoft's MSI technology, so many times it is best to go the MSDN for help understanding what you want to do. For example this entry should help you schedule your action, http://msdn.microsoft.com/en-us/library/aa371626(VS.85).aspx

At least in my IntallShield Express 11 I can have Custom Actions in Uninstall in several different places.

Related

How to prevent running multiple instances of setup.exe created in installshield basic msi project?

I have created my application's setup in installshield - basic MSI project...
Now when i am installing it, it allows me to run .exe multiple times simultanious...
Please let me know, how can i stop it.....
There is already a safe guard automatically built-into Windows Installer. If two or more of your installs actually try to install only the first one will install. The others will throw a message saying another install is already in progress. This is enforced by the _msiexecute mutex.
If you want to gate the situation earlier, you'll have to write your own custom actions to create your own custom mutex, tear it down when the install is complete and check for it when starting the install. However, I'd mark this problem as Functions as Designed and move on.

HOWTO and best working installation (MSI) chainer +/ bootstrapper

Our product has several products that customer can install created as separate installation packages (MSI).
We have a requirement to have single package for the installation that will:
Show one UI with progress
Allow user to choose which features/packages to install
Have ability to constrain one feature to another (e.g removing or adding effect other)
Support single elevation (UAC)
nice to have ability to auto update (not must)
support command line + silent installation
the package should be built out of the isolated installations (chain them)
raise error / messages for missing prerequisites
Support patches over time and major upgrades
Today we do almost all of the above using MSI with nested installations which is bad practice and we face too many issues in our solution.
i know that there are several bootstrappers out there (m$ generic bootstrapper which i think is not good, BURN is the WIX version which is not mature enough)
Do you know of other? that work and tested already ?
What is the best method to do (without unification of the MSI into a single MSI)
dotNetInstaller looks promising. I was experimenting with it to install java as a prerequisite. It comes with a GUI editor so you don't have to sort out the xml to create a project. The config file is in xml, and the InstallerLinker can be run from the command line. It could be integrated with a build server, though some msbuild tasks would be nice.
project home:
http://dotnetinstaller.codeplex.com/
tutorial:
http://www.codeproject.com/KB/install/dotNetInstaller.aspx
Create an InstallShield InstallScript package. Use the InstallScript package kick off the .MSIs with "-qn" one by one. I do this and am successful with it. I believe it meets your all the requirements you listed.
Until Wix's Burn is ready we really don't have much of a choice when it comes to bootstrappers.
If you are using InstallShield as your msi designer, one thing you could try is making an InstallScript project that contains all the different msi packages. You could then silently install only the desired packages. InstallShield is pretty expensive though, so if you don't already have it, you'll probably have to end up rolling your own bootstrapper.

Pre-requisite and Launch condition

I am having a small problem regarding pre-requisites and launch condition for setup.
For example, my setup is having one launch condition requiring "Software1" and one prerequisite installing "Software2".
So, if a system does not have both requirements "Software1" and "Software2" on installing the setup:
Is it shows the prerequiste dialog for "Software2"
Is it shows the launch codnition for "Software1".
I am observing the behaviour that I am getting a prerequiste dialog box using my setup.
Is there any way to set the order or to show the launch condition as first dialog while installing the setup?
If you are using InstallShield prerequisites in your installation, they will be installed by the setup.exe, not the MSI. Launch conditions are handled by the MSI, which will not be run until after the prerequisites are installed. Basically, this means that you can't show launch conditions until after prerequisites have been installed.
That being said, you may be able to configure the conditions on the prerequisites in such a way that the prerequisites would not be installed if you know in advance if a launch condition cannot be satisfied. The net effect of this is that the launch conditions are shown without installing prerequisites, but this isn't a really simple way to achieve this.
In InstallShield 2009, you can configure "feature prerequisites" that will not be installed until after features have been selected. In this case, prerequisites associated with selected features will be installed at the end of the Install UI sequence, or, if the installation is being run without a UI, just before the Install Execute sequence.
without more detail on what sort of installer system you're using, it is going to be hard to help. Assuming you're using the built-in stuff in visual studio, look on google for visual studio msi custom actions. I believe one of the allowable actions is to start another executable.
Assuming you're using MSI launch conditions, you cannot tell which order launch conditions will be evaluated.
If you do need to check something in a specific order, you'll need to use a Custom Action rather than a launch condition.

MSI Bootstrapping: External URLs

Much searching has lead me to find several descriptions of how to create a bootstrapping msi, but these solutions all assume the msi is local or a standard Windows component. Is there a way to make an msi that downloads an installer (which is also an msi) with normal MSI or Wix code rather than by having the bootstrapper execute some non-native program to do so?
My experience with msi's has been it's not possible to run 2 at the same time. (could be wrong though)
What I ended up doing was to instead make an installer exe using Inno Setup (http://www.jrsoftware.org) and ISTool (http://www.istool.org) which downloads and installs the various msi's. With ISTool it's very easy to do.
I know it's not as chic or sexy as Wix, but it worked for me very well.
I would create a custom action that runs in the InstallUISequence. This would download the MSI if necessary (to the source folder), and then try to launch it as a nested installation.
Windows prevents two installs from being in the InstallExecuteSequence at the same time, so if you're looking for a silent install solution with a bootstrapper, you're SOL.
However you can start another install from the UI sequence, which is probably an OK solution as long as you advise your customers that certain other dependencies must be installed first if they're going to deploy via group policy or some other 'silent' method.
If it helps, I'm pretty sure you can also call MSIEXEC with a URL, eg. msiexec.exe /i http://some.domain/blah.msi /passive
I would suggest that you write a native app and have it run the first msi and then run the seccons msi. I wrote a blog on how to do this. Here is a link (http://blog.foldertrack.com/?p=45)

VS Setup Project: Uninstall other component on install

I am creating a Visual Studio Setup project. I want to un-install another component from the system from the install of my component. The other component is installed from my own setup created using Visual Studio.
Currently when I am calling the un-install of the other component from the install action of the component I get the error code: 1618 (another MSI already running).
Could anyone suggest me an alternative way to solve this problem?
If you don't need to actually run the uninstall of the other component, you could use a Custom Action to remove files/folders you intend to replace.
Using a Custom Action will force you to do all the clean up actions the Uninstaller would do for you.
Is it that you're replacing something or are you just trying to uninstall something as a result of installing something entirely different?
MSDN Custom Action Walkthrough
I have also read a few articles from Phil Wilson that have been helpful with Custom Actions:
Phil Wilson on Custom Actions
I ran into a similar problem that required several installs to run together and could find no way to run MsiExec recursively. The solution I used was to bundle the installer with a script that would run MsiExec once to install/uninstall the old package, then again to run the new installer. Clients had to run the script to install.
If you find a better way, let me know.
I think you can run uninst.exe of that program through the shell command while setup starts.....

Resources