Testing and Debugging an Object

InstallShield 2018

Testing your object is similar to testing a standard installation. The main difference lies in the fact that you must include your object in a standard installation in order to test it. This means you must first build your object, include it in an installation project, and then build and run the installation project. The following methods of debugging are available to you when developing your object.

Note • If you have the object project and its associated installation project open in separate instances of InstallShield and you modify and rebuild your object, you must close and reopen the associated installation project to incorporate those modifications.

Script Debugger

The Script Debugger enables you to step through the code of your installation as it runs. To debug an object with the Script Debugger, you must include that object in a standard installation project, compile, and debug. Alternatively, you could design your object as a standard installation, test and debug it, and then convert it to an object through the following procedure.

To convert an object:

1. On the File menu, click Save As. The Save As dialog box opens.
2. Select a folder in which to create a copy of the project. Note that you cannot save the new object project in the same folder as the original project.
3. In the File name box, type a name for the new project.
4. In the Save as type list, select InstallScript Object Project (*.ism).
5. Click Save.

An object project file (.ism file) with the name that you specified, and all project subfolders, are created in the location that you specified. That project opens in InstallShield.

For additional information, see InstallScript Debugger.

Note • When you are designing your object as a standard installation with the intent to later convert it to an object, be aware of the following restrictions:

An object cannot contain setup types; any setup types that you define or setup type functions that you call in the project are ignored when it is converted to an object project.
There are a number of functions and events that are not supported in objects.
All information on built media will be lost when the project is converted; you will need to rebuild the project.

Debugging an Object on Another Machine

Generate inline debugging information is an option on the Build Settings dialog box’s Compile/Link tab. It enables you to debug your object on a machine other than the machine on which the object was created. If you do not use this option, debugging information is placed in a file named Setup.dbg, and its location is stored in the header of Setup.inx. This scheme works fine if you debug the script on the same machine on which you did the compilation. However, on a different machine, the .dbg file may not be stored in the same location. The Generate inline debugging information option was designed to alleviate this problem. If you use this option, all debugging information is stored in Setup.inx. This way, the installation never needs to search for the debugging information.

It is recommended, for two reasons, that you clear the Generate inline debugging information option before compiling the Setup.inx file that you ship with your final product. First, the debugging information increases the size of Setup.inx and may cause the installation to run more slowly. Second, inline debugging information will make it easier for others to reverse engineer your code.

Using the InstallShield Cabinet and Log File Viewer

Use the InstallShield Cabinet and Log File Viewer to do the following:

View an InstallScript cabinet file (.cab) or InstallScript header file (.hdr), as well as their compressed files, registry entries, components, features, and other data. This tool also lets you extract files from the .cab file.
View InstallScript log files (.ilg) that are created by InstallScript installations. This tool enables you to see what your installation has recorded in the log file, which contains important uninstallation information in a binary format.

To learn more, see InstallShield Cabinet and Log File Viewer.

Debugging a Custom Design-Time Wizard

If you have created a custom design-time wizard for your object, you may need to debug that wizard.

To debug the wizard, do the following:

1. From within your development environment, launch a debug version of the wizard, setting breakpoints as desired.
2. In the InstallShield interface, insert the object in a feature of another project to launch the object’s wizard.
3. If your development environment is Microsoft Visual Basic, you must also do the following:
a. Minimize the interface. A Server Busy message box opens. (You may need to click the title bar’s minimize button a few times before the message box opens.)
b. In the Server Busy message box, click the Switch To button or press ENTER.