FeatureFilterOS

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The FeatureFilterOS function filters components that are flagged for specified operating systems and suites.

Note: This function cannot be used with script-created feature sets.

Any filtering that is done when the installation is first run must also be done during maintenance mode. Be sure to call this function in code that is executed during both initial and maintenance installations. Do not call this function from the following event handlers: OnAppSearch, OnCCPSearch, OnFirstUIBefore, OnFirstUIAfter, OnMaintUIBefore, or OnMaintUIAfter.

Project: Components are not filtered by default in an InstallScript MSI installation.

In an InstallScript installation, FeatureFilterOS is called by the default OnFilterComponents event handler during both initial and maintenance installations. This event handler filters components by default that are specific to operating systems and suites other than those on the target system. An installation that is run in maintenance mode has no information about the filtering that was done during the initial installation.

Syntax

FeatureFilterOS ( szMediaLibrary, nSuites, nOS, bFiltered );

Parameters

FeatureFilterOS Parameters

Parameter

Description

szMediaLibrary

Specifies the media name of the file media library.

nSuites

Specifies the operating system suite or suites that you want to filter. Choose from the following values. You can combine values using the bitwise OR operator ( | ).

Note: The suites listed here are those that can be specified in the Windows API's OSVERSIONINFOEX data structure.

ISOS_ST_ALL—All Windows suites
ISOS_ST_XP_PRO—Windows XP Professional
ISOS_ST_XP_HOME—Windows XP Home Edition
ISOS_ST_SERVER—Windows Server
ISOS_ST_WORKSTATION—Windows Workstation
ISOS_ST_BACKOFFICE—Microsoft BackOffice
ISOS_ST_DATACENTER—Windows Server Datacenter
ISOS_ST_ENTERPRISE—Windows Server Enterprise
ISOS_ST_SERVER2003_R2—Microsoft Windows Server 2003 R2
ISOS_ST_SMALLBUSINESS—Microsoft Small Business Server
ISOS_ST_SMALLBUSINESS_RESTRICED—Microsoft Small Business Server with the restrictive client license
ISOS_ST_TERMINAL—Microsoft Terminal Services
ISOS_ST_PROC_ARCH_32—32-bit Processors
ISOS_ST_PROC_ARCH_IA64—Intel Itanium 64-bit Processor
ISOS_ST_PROC_ARCH_AMD64—AMD Athalon 64-bit Processor
0 (zero)—Specifies that FeatureFilterOS ignores components' Platform Suite properties

Project: InstallScript MSI projects do not have support for platform suites. Therefore, in an InstallScript MSI project, you must specify the number 0 for nSuites. Otherwise, the function fails and the information that is specified in nOS is ignored.

nOS

Specifies the operating system or operating systems that you wish to filter. Choose from the following values. You can combine values using the bitwise OR operator ( | ).

ISOSL_ALL—All Windows systems
ISOSL_WINXP—Windows XP Edition
ISOSL_WINSERVER2003—Windows Server 2003
ISOSL_WINVISTA_SERVER2008 (or ISOSL_WINVISTA)—Windows Vista or Windows Server 2008
ISOSL_WIN7_SERVER2008R2—Windows 7 or Windows Server 2008 R2
ISOSL_WIN8—Windows 8 or Windows Server 2012
ISOSL_WIN81—Windows 8.1 or Windows Server 2012 R2

Note: Several client and server versions of Windows use the same major and minor version numbers:

Windows 8.1 and Windows Server 2012 R2 use the same major and minor version numbers.
Windows 8 and Windows Server 2012 use the same major and minor version numbers.
Windows 7 and Windows Server 2008 R2 use the same major and minor version numbers.
Windows Vista and Windows Server 2008 have the same major and minor version numbers.

Therefore, for these operating system versions, the installation considers the client versions to be the same as the equivalent server versions; thus, components that are marked for the client version are also installed on the server version. To distinguish between the client and server versions, you can check whether SYSINFO.nOSProductType is equal to VER_NT_WORKSTATION; on client versions, this is true. On server versions, this is false.

bFiltered

Specifies whether to filter (exclude) or unfilter (include) the operating systems specified in nOS. Pass one of the following predefined constants in this parameter:

TRUE—Filter the specified operating system—do not include them in the file transfer.
FALSE—Do not filter the specified operating system—include them in the file transfer.

Return Values

FeatureFilterOS Return Values

Return Value

Description

0

FeatureFilterOS was successful.

< 0

FeatureFilterOS failed. Call FeatureError for additional information.

Additional Information

While both ISOSL_ALL and ISOSL_SUPPORTED specify all Windows systems when passed as the third argument to FeatureFilterOS, they have different numeric values. ISOSL_ALL is zero (0) and ISOSL_SUPPORTED is the value obtained by combining every operating system constant using the bitwise OR operator, that is, ISOSL_WIN7_SERVER2008R2 | ISOSL_WINVISTA_SERVER2008 | ... . In some cases, you may find it useful to perform bitwise operations on ISOSL_SUPPORTED and other operating system constants.

See Also