Shop

InstallShield
Advanced Installer
AdminStudio
more / weitere

InstallShield und AdminStudio Schulungen

weitere Infos

InstallShield Tools & Tips: Documentation

Note: This page contains additional documentation for InstallShield Professional 6. The articles here are not applicable to pervious versions.

Avoid Maintenance Mode in IS6

InstallShield enters maintenance mode if an uninstall entry already exists for the project GUID. There are situations where you don't want your setup to display the Modify/Repair/Remove dialog, e.g. to install an update. Depending on your requirements, this document discusses some options to handle this situation:

HTML AvoidMaint.htm   Written by Stefan Krueger and Jim Harding
File size: 6.741 bytes   Last update: 2000-03-14

Custom Script Include Paths

This article describes undocumented functionality of InstallShield Professional 6.

Often it would be useful to have a set of generic script files that are used by several installations in a common location. Problem is that you have to specify an absolute path in the #include statement for these scripts (which would be a big problem if you change this location), or you always have to copy the files to the Script folder of each installation.

When you use the command line compiler (compile.exe) it is possible to add your own include paths, but it is not possible when you compile it in the IDE. But we there is a file called "compile.ini" (in the "Program" directory of your IS product) where you can add your own include paths easily! Just add it to the [Include Folders] section.

Discovered by ChunKit Lam
Last update: 2001-01-13

Debugging the OnRebooted Event Handler

Here is how you can debug the OnRebooted event handler with ISPE 6.3:

If you add -reboot in the IDE build settings / command line args, when you debug the setup (Press F5) the setup starts silently and brings up the debugger in the OnRebooted event. You can then step through your code.

Also note that if you have any objects that include debug info, they also can be debugged.

If the setup has to self register files then the -rebooted flag takes a parameter that is the path to an ini file. The ini file contains the names of the files to be self registered and is stored in the setup cache directory i.e. DISK1TARGET.

Written by Richard Pointon

Event Map for InstallShield 6

These four graphics show the order in which events are fired in an InstallShield 6 setup. They describe First Time Install, Modify, Repair and Remove modes.

Note about One-Click Installs: If you build your setup for "Internet media", any user selections should be made on the web page. Therefore the UI events will not be called in One-Click-Installs (except if you set ether.LegacyMode = true).

ZIP is6events.zip   Created Stefan Krüger
File size: 80.775 bytes   Last update: 2000-07-18

GIF You can also view these graphics online: First Time (Part 1)  First Time (Part 2)  Modify  Repair  Remove

The First Time Installation map references the undocumented function ComponentSaveTarget. This function allows the setup to store the target directory of all file groups in the setup to be retrieved later during a maintenance setup. This function when called will store the current value of all text substitutions used by the setup into the installation log file. This includes the current target directory of all file groups and the value of all target directory related system variables, as well as all other text substitution values. When the setup initializes and a valid log file is found, any values previously stored with this function will be automatically restored allowing a maintenance install to update previously installed components and install new components to the appropriate location.

Using multiple NULL terminated strings in the same string variable

For some windows DLL functions (example ODBCCP32.SQLConfigDataSource ) it is necessary to have a string variable with more than one NULL terminated string. According to the IS documentation, this is not supported, and sure enough, if you specify szString="first\0second", szString will get the value "first".

Here is a way to create a string variable with more than one NULL terminated string inside by using Sprintf.

function CreateODBCDSN()
  STRING svProperties;
  CHAR nullChar;
begin
  nullChar = 0;

  Sprintf(svProperties,
          "DSN=myDSN%c"+
          "Description=Test%c"+
          "ServerName=CEA%c"
         ,nullChar,nullChar,nullChar);

  nvError = SQLConfigDataSource
               ( NULL
               , ODBC_ADD_SYS_DSN
               , svDriverName
               , svProperties);
end;

The trick is that the formatstring in Sprintf defines the size of the STRING variable. Even though there are NULL bytes substituted in the string, IS still thinks the length of the variable is that of the formatstring, thus creating a string variable with multiple NULL terminated strings. Note that such a string variable can only be used for parsing in DLL functions; as soon as you read it in IS itself, you will only receive the part before the first NULL byte.

This has been tested only in IS6 yet.

Written by Ide Nentjes
Last update: 2002-02-02

Functions with Variable Number of Arguments

This article describes undocumented functionality in InstallShield Professional 6.

Warning: functions with variable number of arguments will not work properly if setup is executed in the debugger.

InstallScript functions can be defined to take a variable number of arguments, similar to built in functions like Sprintf. Take a look at the following script to understand how to do variable arguments in InstallScript:

/***********************************************/
#include "ifx.h"

#define DOMATH_SUM 1
#define DOMATH_AVERAGE 2

prototype NUMBER DoMath(NUMBER, ...);

function NUMBER DoMath(nDoWhat, nos)
    NUMBER t, i;
begin
    for i = 0 to SizeOf(nos) - 1
    t = t + nos(i);
    endfor;

    switch(nDoWhat)
        case DOMATH_SUM:
            return t;
        case DOMATH_AVERAGE:
            return t / SizeOf(nos);
    endswitch;
end;

function OnBegin()
    VARIANT v;
begin
    v = DoMath(DOMATH_SUM, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

    MessageBox(v, INFORMATION);
    abort;
end;
/*********************************************/

Things to look for in the above script are:

  1. The prototype has ellipsis(...) for the variable arguments
  2. The function declaration names the variable arguments list. 'nos' was used here but you can call it anything. The type of this argument is 'VARIANT array'.
  3. You can use the SizeOf operator to find out the number of elements in an array. In this example it was used to find out the no. of numbers that was passed to the function.
  4. The use of VARIANT v in the OnBegin function to hold the result of the DoMath function. This is not related to variable arguments at all but is a convenient way to convert numbers to strings.

From newsgroup installshield.is6.installscript

Migrating from InstallShield 5 to InstallShield 6

InstallShield has published white paper about Moving from InstallShield 5.x Professional to InstallShield Professional 6.x. Although that paper is helpful and fairly accurate as far as it goes, it is incomplete. Here are some additional changes that you may need to look out for:

WWW Additional Migration Steps   Written by Alan Frank

Modify Uninstall Log File

This sample uses undocumented features of InstallShield 6

In IS6 log is exposed through COM objects that are accessible from script. You can use the log object to modify an existing .ilg file.

Here are two small projects that demonstrate how to do this. (They were created with IS 6.2 - if you have an earlier version, you still can look at the .rul files with a text editor)

  1. LogRegistry has a registry set associated with a file group. All it does is create the registry set. If you uninstall it, it will remove all created keys/values.
  2. FixLog is a project that was created by coping LogRegistry (it has the same project GUID and the same component GUIDs). I removed the registry set from it. It modifies log from script removing entries for top level key created by LogRegistry project. After running FixLog and then uninstalling LogRegistry the top level key won't be uninstalled.

This is a sample. To change it to production project you would have to:

ZIP ModifyLog.zip   From newsgroup installshield.is6.general
File size: 121.964 bytes   Last update: 2000-06-24

Store Values in the Uninstall Log File

This is another sample that shows how custom values can be stored in and retrieved from the uninstall log file (.ilg) in IS6 in maintenance mode or with the log viewer. Supported data types include strings, numbers and arrays. This document gives some usage samples. Note that trying to get the value of a non-existant property will result in an unhandled exception error. If you can't be sure the the property exists, you should use the method shown in the ModifyLog sample above to enumerate the values.

HTML StoreLog.htm   From newsgroup installshield.is6.general
File size: 1.990 bytes   Last update: 2000-08-03

Retrieving Extended Error Information

In other programming languages you would call the GetLastError WinAPI function to get additional information if an API function failed. The same technique worked in IS5, but no longer in IS6. This is because IS6 does is quite a bit of post processing to marshall back the return value and out parameters after your WinAPI call returns. This requires calling several WinAPI functions that reset the last error information. However the Err object in IS6 has a supported, but not documented, property to get this error number: Err.LastDllError. Sample:

prototype short KERNEL.AddAtom(STRING);  // any WinAPI function
function foo()
begin
  if( AddAtom("bar") = 0 ) then
    MessageBox(FormatMessage(Err.LastDllError), WARNING);
  endif;
end;

From newsgroup installshield.is6.general
Last update: 2000-10-05

Setting Dialog Titles in IS6

Caption Bar

By default, InstallShield 6 doesn't use a background window. In this case, the caption bar on the Windows 2000 style dialogs reads "InstallShield Wizard". You can change the caption text by calling this function:

SetTitle("Your Application Name Setup", 0, BACKGROUNDCAPTION);

If your setup uses a main background window - i.e. you call Enable(BACKGROUND) - the above function will set the caption on the background window instead.

White Banner

To set the two lines of text on the white banner at the top border of a custom dialogs, call the function SdSetDlgTitle function inside the DLG_INIT case of your WaitOnDialog loop. SdSetDlgTitle is not officially documented.

HTML SdSetDlgTitle.htm   Written by Stefan Krueger
File size: 1.834 bytes   Last update: 2000-09-14

The Full Scoop on InstallScript Structures

In InstallShield 6, structures are implemented as COM objects. This opens up some interesting possibilities, but also introduces some potential problems. This document explains how structures work and also how to prevent some common structure pitfalls.

HTML IS6_Structures.htm   Written by Rajesh Ramachandran
File size: 19.797 bytes   Last update: 2000-07-16

Using the Setup Player Object in Visual Basic

IS 6.21 (and above) comes with a Setup Player object that you can use to programmatically run a web setup from within your application. In Visual Basic you would use code like this:

Private Sub Form_Load()
    Set player = CreateObject("Setup.Player")
    Set ether = player.Open("http://ftp.adobeactiveshare.com/pub/win/all/client/as15/")
    ether.Play
End Sub

This sample code will launch Adobe Active Share setup. You can use all the other properties/methods of ether object, as documented in IS6 docs.

From newsgroup installshield.is6.webinstalls
Last update: 2000-09-14

 

 

 

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