Advanced Installer
more / weitere

InstallShield und AdminStudio Schulungen

weitere Infos

InstallShield InstallScript: Operating System

Note regarding InstallScript versions: The samples on this page have been developed with various versions of InstallShield. Some of them require a minimum InstallShield version or may only work in the one version they have been created for. Often it will be possible to make them compatible with other InstallShield versions.

Change NT Bootup Delay

Windows NT has a bootup countdown that defaults to 30 seconds. With this function you can set the bootup counter value.

prototype at_FixBootTimeout (BYVAL NUMBER);

ZIP   Written by Tom LaRoche
File size: 676 bytes   Last update: 2000-03-22

Create and Validate User Accounts

Whether you need to verify an existing user account and password, or need to create a new user, this package shows you how to do it. Included is the InstallScript code and the required support DLL. It was tested on Windows NT 4 with SP5 or above - it will not work on Windows 9x. The sample script is written for IS6, and uses InstallDialogue for some dialogs. Before you can run the sample code, you will have to install InstallDialogue (free download).

ZIP   Written by Colin Leath
File size: 180.608 bytes   Last update: 2001-04-07

Create Icon on Quick Launch Bar

This function works similar to AddFolderIcon, but creates the shortcut on the Quick Launch Bar.

ZIP   Written by Torsten Brannolte
File size: 655 bytes   Last update: 2000-11-11

Create GUID as String

This is an InstallShield function that calls OLE32.DLL functions to create a new GUID and returns it in a STRING variable.

prototype CreateStringGUID (BYREF STRING);

ZIP   Written by Bruce Wakefield
File size: 1.269 bytes   Last update: 09/28/1999

Customize Event Log Settings in Windows NT

With this function you can modify the default settings of the event log. It will change the Maximum Log Size and the Overwrite period of the selected log ("Application", Security", or "System"). This is usually done from the Event Viewer menu Log/Log Settings.

prototype at_CustomizeEventLog(STRING, NUMBER, NUMBER);

ZIP   Written by Tom LaRoche
File size: 1.161 bytes   Last update: 2000-01-31

DCOM Support

Configure DCOM

See Versatile Setup Extension DLL below.

Detect DCOM Version

This script detects the existence and current version of DCOM on Windows 95.

prototype GetDCOMVersion( BYREF BOOL, BYREF STRING );

To install DCOM as silently as possible call dcom95.exe /r:n /q:u

ZIP (638 Bytes)    Provided by Ken McKinney

See also: InstallShield Object to install MDAC and DCOM

Delete .GID When Corresponding .HLP is Updated

The first time you use the Search function in Windows Help, an index (.gid) file for the help (.hlp) file you are using is generated automatically. If you later update the .hlp file, this index is out of sync. Therefore you should delete the corresponding .gid file. On the other hand, you should not delete .gid files for help files that are not updated, because generating the index is a time consuming process. This function detects which help files have been updated by your setup, and deletes the corresponding .gid files.

This function requires IS6 or above.

ZIP   Written by David Osborne
File size: 2.863 bytes   Last update: 2000-05-23

Detect and Install HTML Help

These functions detect whether HTML Help is installed, retrieve the version number and can launch the HTML Help setup. The HTML Help installer is not included in this package. See the Windows Updates and Add-Ons page for information where to obtain it.

See also: Book about authoring HTML Help

prototype _GetHTMLHelpVersion( BYREF STRING );
prototype _VerifyHTMLHelpInstalled( BOOL, STRING, STRING, STRING );

ZIP   Written by Chris Dufour
File size: 8.213 bytes   Last update: 06/29/1999

Detect and Install Internet Explorer

This package includes functions to retrieve information about the installed version of Internet Explorer and to launch the IE setup program. It works for all 32 bit Windows versions of IE. The detection part is based on article Q164539 in the Microsoft Knowledge Base.

prototype _GetIEVersionNameX( STRING, STRING, BYREF STRING );
prototype _VerifyIEInstalled( BOOL, STRING, STRING, STRING );

(This package supersedes by adding the capability to install IE.)

ZIP   Written by Chris Dufour and Stefan Krüger
File size: 10.112 bytes   Last update: 06/29/1999

Detect NT Service Pack

This function retrieves the version of the installed Windows NT service pack, and returns it as string and as numerical value.


ZIP   Written by Stefan Krüger
File size: 1.608 bytes   Last update: 2000-11-10

The above function requires InstallShield5 or above. Following is an older version of the function that is compatible with InstallShield3, but does not support Windows 2000:

ZIP   Written by David Penner
File size: 744 bytes

Determining NT 4.0 SP6 versus SP6a

Shortly after SP6 had been released, Microsoft replaced it wth SP6a. Unfortunately the service pack version number has not been updated, so the GetNTServicePack function can't be used to distinguish between SP6 and SP6a. To detect whether Service Pack 6a is installed if SP6 is detected, you can check to see if the following registry value is set to 1:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix\Q246009\Installed

Determine if Active Desktop is Installed

Call this function to find out whether active desktop is installed and whether it is displayed as web page. This function is compatible with Windows 95, 98 and NT 4.0 and Microsoft Internet Explorer 4.x and 5.x. It is based on information from article Q216840 in the Microsoft Knowledge Base.

prototype _IsActiveDesktop();

ZIP   Written by Stefan Krüger
File size: 1577 bytes   Last update: 04/06/1999

Distinguish Between NT Server and Workstation

This function tells you whether setup is running on Windows NT Server or Windows NT Workstation.

prototype BOOL _IsNTServer();

ZIP   Written by Bill MacEachern
File size: 467 bytes   Last update: 03/04/1999

Extended Information in Add/Remove Program Control Panel

In Windows 2000 the Add/Remove control panel applet can display much more information than just the program name. For instance, it displays an icon for your program, and can optionally show your home page URL etc. Most Windows Installer based setups store this information automatically, but it setups created with IS5 or IS6 can do this, too.

Recommended place to call this function:

ZIP   Written by Blake Miller
File size: 1.599 bytes   Last update: 2001-06-29

Find All Shortcuts in a Folder and its Subfolders

This function searches a given Icon folder, e.g. "Programs", "n" levels deep and returns all resulting icons.

prototype GetAllIconsFromFolders(STRING);

ZIP   Written by Chris C Robsahm
File size: 1.172 bytes   Last update: 2000-02-08

Font Installation

Use this function to install true type fonts automatically. Package includes rul file, sample, usage instructions and the required dll (source and compiled for both 16 and 32 bit). This script is compatible with IS5 and IS6.

Some of the features:

Note: Article Q100057 in the InstallShield Knowledge Base has informations about font installation, too.

ZIP   Written by Troy Engel
File size: 141.289 bytes   Last update: 2000-04-08

Get System Information

The functions in this package are not only extensive samples for using the GetSytemInfo function. They also show how to detect OS/2 Warp version and how to find out whether Windows is using small or large fonts.

ZIP (4.860 Bytes)    Provided by Rainer Feuerstein

See also: How to Identify Windows 2000 and Window Me in a Setup Program

Handle Files and Registry Entries in User Profiles

The functions in this package enable your setup to install/uninstall files and registry entries across multiple local profiles on NT/2000/XP target workstations. All this is done entirely within InstallScript and API calls, and does not use a custom DLL. It was developed for InstallShield Professional 6.3 and will not work with lower InstallScript versions.

ZIP   Written by Voltaire Toledo
File size: 6.732 bytes   Last update: 2002-07-31

See also: Load a User Hive Under the HKEY_USERS Key

Handle PATH Environment on NT

Here is a set of functions that will modify the existing path and add a new entry as well as removing that entry when uninstalling.

It only works on Windows NT/2000 and requires IS6.

prototype SetEnvPath(STRING, BOOL);
prototype RemoveFromPath(STRING);

Update: now uses SendMessageTimeout instead of SendMessage to avoid hang if some program doesn't process the message.

ZIP   Written by Geoffrey Faivre-Malloy, updated by Ronny Lipshitz
File size: 1.508 bytes   Last update: 2003-06-12

Install Printer Driver

This DLL includes functions to install printer drivers on Windows 9x, NT and 2000. See myprinter.h for usage information.

You can use this software under the terms of the GNU General Public License.

ZIP   Written by Jan Becker
File size: 31.076 bytes   Last update: 2001-08-29

Installing an Internet (URL) Shortcut

This function creates an internet shortcut in on the desktop, in a program folder or in the user's Favorites folder.

prototype CreateUrlShortcut(STRING, STRING, STRING, STRING, NUMBER);

To create a link to InstallSite on the start menu, using the default URL icon, you would call:

CreateUrlShortcut(FOLDER_STARTMENU, "InstallSite", "", "", 0);

ZIP   Written by Stefan Krueger
File size: 1.552 bytes   Last update: 05/04/1999

Microsoft Message Queue (MSMQ)Administration

For InstallShield 6

This package uses IS6 COM support to find, delete and create a public queue in Microsoft Message Queue. To, create the queue, you send the queue name and computer name to the MSMQCreate function (MSMQCreate will delete a queue with the same name, if it exist, before creating the new queue. The create function will return the newly created queue's GUID in the BYREF STRING. To delete or find a queue, you only need to send the queue name or queue GUID.

prototype MSMQFindExisting(STRING, STRING);
prototype MSMQDeleteExisting(STRING, STRING);
prototype MSMQDetect();

ZIP   Written by Bruce Wakefield
File size: 2.113 bytes   Last update: 2000-07-31

For InstallShield 5

This package calls a VBS file to find, delete and create a public queue in Microsoft Message Queue. The MSMQvbs.rul shows examples of how to call the functions in msmq.vbs. This will write entries to the registry, instead of a log file, so that IS can read the output from msmq.vbs.

This function requires that Windows Script Host is installed on the target machine.

prototype TestMSMQvbs();

ZIP   Written by Bruce Wakefield
File size: 3.896 bytes   Last update: 2000-07-31

MTS Administration

This package uses IS6 COM support to create and delete an MTS package and detect MTS on the current machine. It uses an Mtscom.ini file along with the MTS.rul to create a package. The InstallPath=, LoginName= and Password= portions are updated by one of the functions in the MTS.rul. The rest of the information is entered prior to build. This should work with NT4 and Win2000.

prototype MTSCreatePackage(STRING, STRING, STRING, STRING);
prototype MTSDeletePackage(STRING);
prototype MTSDetect();

ZIP   Written by Bruce Wakefield
File size: 4.118 bytes   Last update: 2000-07-31

Register Type Library

This multi-purpose setup extension DLL exports three functions:

Included is the C source code, the compiled DLL (for Windows 95 and NT) and a .rul file that shows how to call the functions.

ZIP (22.697 Bytes)  Provided by Peter Moser

Replacement for QueryProgItem

InstallShield's QueryProgItem() function doesn't work for start menu entries with paths containing environment variables. There is a DLL available at that covers this problem. Unfortunately this DLL doesn't provide as many information as QueryProgItem() does. More disadvantageous is, that the returned paths are in the 8.3-format. This DLL is a replacement for QueryProgItem(). It returns as many information as QueryProgItem() does and it works for paths containing environment variables.

ZIP   Written by Martin Golm
File size: 28.970 bytes   Last update: 2000-05-06

Retrieving Name of StartUp Folder On All Platforms

The system variable FOLDER_STARTUP is only valid in 32 bit installs. If your setup runs on a localized version of Windows 3.1x it is a bit more complex to get the name of the startup folder. This function works on 16 bit and 32 bit Windows in all languages.

prototype GetStartupFolder(BYREF STRING);

ZIP (634 Bytes)   Provided by Stefan Krueger

Setting Access Permissions

The following samples can be used to set user permissions on files, directories and registry keys.

Note: In InstallShield 2010 a new SetObjectPermissions function was introduced for this purpose, so you might not need the samples below. However, SetObjectPermissions doesn't work on 64-bit registry and file locations (workorder# IOA-000056378). Thanks to Kevin Mackey for this information

Set Permissions on Files, Registry Keys and Printers

This function sets permissions not only on files but also on registry keys and printers. It doesn't use the cacls tool but instead calls Windows Security API functions directly. It uses Universal SIDs and therefore works language independent. If the target object doesn't have an ACL (e.g. a FAT32 file system) the functions returns an error code.
The script was tested with InstallSield Professional 6 and Developer 8.

ZIP   Written by Klaus Ewinger
File size: 2.903 bytes   Last update: 2003-07-17

Set NTFS File and Directory Permissions

This sample shows how to call the cacls tools in Windows NT 4 and 2000 to set access rights for directories on NTFS. You don't need to test to find out if the partition is NTFS or FAT - the command executes without doing anything on a FAT partition (since there are no NTFS permissions) - no error is returned (it hasn't been tested on a FAT32 partition). Of course you need to have Administrator rights.
Note: Some special user names are localized on different language versions of Windows, e.g. instead of "Everyone" you have to use "Jeder" in a German version of Windows, else this function will fail.

ZIP   Written by Jeff Meyer
File size: 1.181 bytes   Last update: 2000-05-02

Set User Rights on NT

This DLL allows you to grant or revoke a specified right under NT for the specified user.

ZIP (45.883 Bytes)   Provided by Artur Valitov

Setting Locale Info

Need to change regional setting like currency symbol, date or number format? Here is the function you need. It works for both, Windows95 and Windows NT.

prototype NUMBER winSetLocaleInfo ( LONG , STRING );

ZIP (2.813 Bytes)    Provided by Kurt Petteloot

Versatile Setup Extension DLL

This DLL provides so many functions that it can't be filed under one specific topic. Here is an overview of the features:

Included is the DLL source code, compiled DLL and InstallShield header file and sample code.

InstallDialogue Some of the dialogs included in this package have been created with InstallDialogue. If you want to use them, you have to download the InstallDialogue Free Edition from Moonsea Software


ZIP   Written by Mike Brown
File size: 123.868 bytes   Last update: 08/17/1999




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.
Impressum/Imprint Datenschutzerklärung/Privacy Policy
By using this site you agree to the license agreement. Webmaster contact