View Full Version : Typical versus custom install

08-16-2005, 10:12 AM
Well, this should be a pretty easy and common thing to do in an installation. I have done it in InstallShield before (version 7). But I am really lost in this version.

Background: I have a product that has typical workstation features that will always be installed (Typical). It also has Administrative features that are optionally installed. The typical install should be the default with all those features selected. The Administrative features shoule be initially deselected and only available if the Custom installation is selected. Furthermore, there are optional features in the typical (non-administrative) section of the installation which may be selected using the Custom installation option.

At first, everything was selected, and I saw no obvious way to deselect the feature. Then someone suggested setting the INSTALLLEVEL of the features and a package INSTALLLEVEL lower than that to deselect those features. Well, that appeared to work, except that when you try to do a custom install, the features you select do not get installed. I assume because the INSTALLLEVEL for the package has not changed. So now I am stuck.

I did see something about conditional installs, but the properties to select have nothing to do with this situation. Even though the features indicate "Administration", this has nothing to do with whether the person doing the installation is an administrator or not. So the Condition builder doesn't seem to be the answer. If I could check to see if the setup type was Custom, I could probably swing it in this manner, but that is not one of the listed properties.

I looked around for a place to put some code, and I can see how I can trigger events, but don't see where to put code for the event itself. I presume that is what I am supposed to do, but again, there is nothing in the tutorial for this type of install that gives me the slightest clue. A situation I feel I share with many judging by some of the posts here.

So here I am with a last minute things I have to get done. An upgrade to a client machine breaks a third party piece of software that I need to upgrade to fix, which requires an upgrade of InstallShield to install the newer version, and I am stuck and by extension my client is stuck because I cannot figure this thing out right away.

I promise I will try to RTFM in more detail later (although there isn't one, just help), but I need to break through on this point right now, so I would appreciate any help I can get, but make no assumptions about me knowing anything about how to navigate around this version of IS.

Then if anyone could recommend the best way to get up to speed on this version of IS and MSI would be appreciated. That is, excluding training classes which are not going to get approved. Is the $175 book the only way to "get" this stuff outside of a classroom? That is extortion :(

08-17-2005, 08:23 AM
Can't do anything about your book.

The best thing I always refer to is the MS Platform SDK Help for Windows Installer.

Now, about your selections. Addressing whether or not you can determine it is Custom or not is available to you. Create a new default Basic MSI project.
Go to the SetupType dialog. Select Behaviors. You will notice how there is a Property set for Custom and Typical. This is done at the Radio Button Group level. So, if you test a condition beyond this dialog for _IsSetupTypeMin = "Custom" you will know it is Custom.

Now in regards to your first attempt using InstallLevels. This is the better course. It's a balance of the InstallLevel values. You have to set value appropriately. It is used to say 'this feature is not installed by default'. If you set a condition on the feature to set the InstallLevel for that feature you want to install will get the desired behavior.
For example, say instead of Custom you called the button Administrative Install and go directly to Ready To Install on Next. You could set the InstallLevels of all the Administrative features to 200 and then add the Condition _IsSetupTypeMin = "Custom" (you don't change the property to Administrative) to each feature and set the InstallLevel to 100.

There is another technique I have used. In the Next button of your Custom Setup dialog. Set the Condition to see if a Feature has been selected (or some other property). You will need to reference Condition examples in the MS WI Help. Then if it is True use AddLocal (a way to force selection of a feature) for the Feature. Remember to user Remove if they deselect it.

Set properties and query Feature and Component conditions. Refer to the MS WI Help.

08-17-2005, 09:22 AM
Thanks so much for the information. The old way was just so much easier and straight forward. It seems like MS picks only one paradigm to use in a situation where there are many, and you have to bend over backwards to make the other scenarios work.

In any event, I will try looking at the MS doc on MSI to see if I get any better understanding.

I did finally figure out a way to adjust the level of the install. I adjusted the package level rather than the individual feature. I did it in the Pushbutton behavior where it was already checking for the Custom or Typical selections. I used the SetInstallLevel function. The undesired side effect was that this caused the features to all get selected. Next I tried the Favor Source option in anticipation of using the AddLocal technique. This had the desired effect of deselecting the feature, but the undesired affect of adding the source or network install selection items to the list of things you could do when clicking on the feature in the customization tree.

A simple thing like this just should not take this much effort to accomplish. I am just frustrated at the problem. But I think with your pointer at alternative documentation and what my experimentation has produced to this point, I can at least get something that will work, if not exactly work the way I want it to.

I appreciate you taking the time to help.