Shop

AdminStudio
InstallShield
Advanced Installer
other products

InstallShield

InstallShield 2016
Windows 10 Kacheln anpassen, Universal Windows Platform (UWP) und Nano Server, u.a.
Details hier

 

InstallShield und AdminStudio Schulungen

Offizielle Kurse mit Zertifikat

weitere Infos


 

This is an updated version of an article that was originally published in the February 2001 issue of the InstallShield Newsletter

More Windows Installer articles

Custom Setup Options in Windows Installer

Abstract: Most Windows Installer based setups offer you to perform a Custom setup type, where you are presented a tree view of all features. Attached to each feature is a drop down menu with options as shown in the screen shot below:

Feature options

It's not very obvious how Windows Installer decides which choices will be displayed, what their effect is in your setup at runtime, how they relate to the settings in the feature and component properties of your project, and what you can do to remove undesired options. This article tries to shed some light on all these secrets. It is mainly based on observations and experiments, since I didn't find most of this documented in the Windows Installer SDK.

Preface: Remote Installation Settings for Features and Components

Before we get lost in the various combinations of remote installation and advertisement options, I'd like to address one major source of confusion: The Remote Installation property for components is very different from the property of the same name for features.

For a feature, the Remote Installation property is merely a default value that defines how the feature comes up when the Custom Setup dialog is displayed for the first time, or how the feature will be installed if the Custom Setup dialog is not invoked. The end user can change the remote installation state of the feature by making a selection from the said drop down menu in the feature tree. Therefore the options in the feature properties pane are called Favor Local, Favor Source etc.

For a component however the Remote Installation property actually defines how the component will be installed. Only a component that is set to Optional will be installed in the way that the end user selected for the feature that includes the component. If a component's Remote Installation property is set to Favor Local, the files of this component will be copied to the local hard drive, even if the user selects "run from network" for the feature. And if a component's Remote Installation property is set to Favor Source, it's files will never be copied to the user's hard disk, no matter what is selected for the feature. So the options in the component properties pane would've better been called Force Local and Force Source.

In the following sections I'll discuss each of the possible feature installation options in the CustomSetup dialog.

Install Local

Install Local

This option is equivalent to the Favor Local setting in the feature properties. All components with "optional" remote installation setting will be copied to the directory specified in the Destination property of the component. Typically this will be INSTALLDIR (but could be WinSysDir or anything else). If the end user selects a network share as INSTALLDIR, this option will still say "will be installed on local hard drive". The text is stored in the string table, so you could change it to something like "will be installed in the folder selected below" if you want.

This option is not available if all components of this feature (and those of its sub features) are set to Favor Source. If you want to remove this option, make sure that the feature (and all of its sub features) have a component attached, and they are all set to Favor Source. If a feature has no components, but only sub features, the install local option will appear in the menu. To avoid this add an invisible dummy component to the feature.

There's no way to suppress only the second option, and keep the first. Even if the feature has no sub features, Windows Installer displays the variant "this feature, and all sub features" of the install local option.

Run From CD

Run fromCD

This option is equivalent to the Favor Source setting in the feature properties. All components with "optional" remote installation setting are not copied to the local hard disk. The application will access them from the installation media. This option is used for removable media like CD-ROMs or diskettes. If setup is running from network or hard disk, the "run from network" option described below is used instead. This option will always say "run from CD" even if setup is running from another type of removable media, like diskette or DVD. The text is stored in the string table, so you could change it to something like "run from installation media" if you want.

This option is only displayed for uncompressed media. If your data files are compressed into CAB files or included inside the MSI file your application would not be able to access the required files, so Windows Installer does not offer this option in these cases. An exception from this rule are features that don't install files (e.g. any components attached to the feature include only registry entries, but no files).

This option is not available if all components of this feature (and those of its sub features) are set to Favor Local. If you want to remove this option, make sure that the feature (and all of its sub features) have a component attached, and they are all set to Favor Local. If a feature has no components, but only sub features, the run from CD option will appear in the menu. You can add an invisible dummy component to avoid this.

There's no way to suppress only the second option, and keep the first. Even if the feature has no sub features, Windows Installer displays the variant "this feature, and all sub features" of the run from cd option.

Run From Network

Run from Network

This option is equivalent to the Favor Source setting in the feature properties. All components with "optional" remote installation setting are not copied to the local hard disk. The application will access them from the network share or local directory from where the setup was started. This option is used for non-removable media. If setup is running from a removable media, the "run from CD" option described above is used instead. This option will always say "run from network" even if setup is running from the local hard disk. The text is stored in the string table, so you could change it if you want.

This option is only displayed for uncompressed media. If your data files are compressed into CAB files or included inside the MSI file your application would not be able to access the required files, so Windows Installer does not offer this option in these cases. An exception from this rule are features that don't install files (e.g. any components attached to the feature include only registry entries, but no files).

The run from network option is very useful if you're installing from an administrative image on a network server. If you perform an administrative installation, the application files are extracted from the CABs and stored uncompressed in the specified network folder. Unfortunately Windows Installer will not enable the Run From Network option after an administrative install of a compressed media. This appears to be a bug in the Windows Installer engine.

If you create an uncompressed media type, and then package it in a self extracting executable, the Run From Network option would be available (because the actual setup runs from the extraction directory on your local hard disk). However in this case your application would not be able to access the required files if the self extractor cleans up the extracted files after the installation is finished. Therefore your self extractor should leave the extracted setup files on the user's machine.

This option is not available if all components of this feature (and those of its sub features) are set to Favor Local. If you want to remove this option, make sure that the feature (and all of its sub features) have a component attached, and they are all set to Favor Local. If a feature has no components, but only sub features, the run from network option will appear in the menu. You can add an invisible dummy component to avoid this.

There's no way to suppress only the second option, and keep the first. Even if the feature has no sub features, Windows Installer displays the variant "this feature, and all sub features" of the run from network option.

Install On Demand

Install on Demand

This option will cause the feature to be "advertised". Windows Installer will install the files when the feature is invoked for the first time. This option is not available if you set the Advertisement property of the feature to Disallow Advertise. If you select Favor Advertise this option is the default selection for the feature.

Advertisement is not supported on older platforms (Windows 95 and NT 4 with a version of shell32.dll older than 4.72.3110.0). If you set the Advertisement property to Allow Advertise, this option will be shown on all platforms, even if they don't support it. To avoid this problem, select "Disallow Advertise if not supported". This is equivalent to Allow Advertise on newer operating systems, and will hide the option on older versions.

The "Disallow Advertise if not supported" setting is new in IPWI 2.0. If you are using ISWI 1.0 or 1.5 you have to post-process the created MSI file to set the flag that instructs Windows Installer to hide the advertise option on unsupported platforms. A tool for this purpose is available at http://www.installsite.org/iswi/tips.htm#NoUnsupportedAdvertise

Don't Install

Don't Install

This is probably the most straight forward option: if selected, the feature will not be installed or advertised. To remove this option from the menu, set the Required property of the feature to "yes".

About the Author

Stefan Krueger is working as freelance setup consultant. Besides his contract work, he answers questions in various newsgroups and maintains the InstallSite.org web site, a place where setup developers share resources and information among peers.

If you have any comments about this article, or want to suggest a topic that Stefan should discuss in a future article, please write to E-Mail. To read Stefan's articles from previous issues of the InstallShield Newsletter, please visit http://www.installsite.org/isnews.htm.

More Windows Installer articles

 

 

 

English News Discussions Windows Installer Related Tools More Help InstallScript About InstallSite Shop Site Search
deutsch Neuigkeiten Diskussionsgruppen Windows Installer MSI FAQ Artikel     Shop Suche

Copyright © by InstallSite Stefan Krueger. All rights reserved. Legal information.
GERMAN Impressum,Datenschutzerklärung, Haftungsausschluss
By using this site you agree to the license agreement. Webmaster contact