Thursday, January 24, 2008

Advanced dubugging during installer builds

You might have encountered many instances where you need to turn on advanced debugging options to get proper and detailed debugging information. The usual build log does not provide detailed information. Some time you struggle through a Java I/O error or your custom code or your source code management system is behaving improper.
 
There have been instances when I noticed a build success but the installation operation failing, even after trying various options with my Install Anywhere IDE nothing was useful. Finally playing with the InstallAnywhere lax properties file worked for me.
 
These were the steps I took to get things working..
 

1.) Close the IDE.

2.) Open the file <IAHOME>/InstallAnywhere.lax in a text editor.

3.) Modify the following properties in the file so they read as follows:

lax.stderr.redirect=console

lax.stdout.redirect=console

4.) Add the following line to the top of the file:

lax.nl.java.option.additional=-Dlax.debug.level=3 -Dlax.debug.all=true

5.) Save the .lax file and close it.

6.) Start the IDE with the following command:

./InstallAnywhere 1>buildConsole.txt 2>&1

7.) Run the build.

Once you are done with these steps you will notice a launch anywhere window opening during the build, when your build finishes all the stderr that you were able to see in the console windows is written into a console.txt file at your <IA_HOME> directory.

A tweak here is that, if you keep this option on-ever you will always see a debug console opening whenever you launch a InstallAnywhere application, so it depends on you discretion to turn on this feature or to turn it off as it gives you a detailed report of your operations performed at the cost of few extra CPU cycles and additional memory usage.

Keep reading there are more to come.... :)

Friday, January 4, 2008

InstallAnywhere 2008 Released

Macrovision released InstallAnywhere 2008 Enterprise and standard edition late 2007, it contains many fixes and new features.
The most important was removal of support for JRE 1.4, it came in support for Java 1.6. Other promising features that came in was support for MSI installers and Windows VISTA.

To download the latest version of InstallAnywhere browse the site

Download

Release notes for InstallAnwhere are located at

Release Notes

So old InstallAnywhere and InstallShield users start migrating your project to latest InstallAnywhere 2008 edition.

Thursday, January 3, 2008

File Service in Custom Codes

Many of the installer user use FileService and Win32RegistrySerives in their custom codes. Although InstallAnywhere provides support for putting and retriving Registry entries at the software install location but some times it becomes a complsion for the installer auother to use these services in their custom code.

In order to use FileService in you custom code you need to activate support for File Service in your project. This can be checking the property in Project-->>Java-->> Check the radio button saying "Add File Service support"

This would enable your project to over take File Service of the operating system. While developing the project add IAClasses.zip, services.jar, win32ppk.jar file to your project. IAClasses.jar file is present in the resources folder of your $IA_HOME services.jar will be found inside servises folder of Resources folder. Win32ppk.jar present in the OS specific folder under services.

FileServices interface and Win32RegistryService interface is present in Services.jar and win32ppk.jar respectively which are hidden for new InstallAnywhere users as they are aquinted of using IAClasses.zip files in their project.

When developing the custom code implement the FileService and Win32RegistryService interfaces in your project. I am putting an example below on how to implement the custom code, it will help the new users for using Registry and FileService

package com.mycompany.project

import com.zerog.IAClasses.*;
import com.installshield.FileServices.*;
import com.installsheild.RegistryService.*;

public myClass extends CustomCodeAction
{
public void install(InstallerProxy proxy) throws InstallException
{
String install_path = proxy.substitute("$USER_INSTALL_DIR$");
FileService fs = (FileService)proxy.getService(FileService.class);
// Now you will be able to use all the methods in FileService
fs.mkdir(install_path+"\\bin");
win32RegistryService reg = (win32RegistryService)proxy.getService(win32RegistryService.class);
/* Now you can use the methods exposed by Win32RegistryServices */
}
public void uninstall(UninstallerProxy Uproxy) throws InstallException
{
// @@TBD
}
}

The above code snippet will explain the basic usage of FileService and Win32RegistryService in Custom code.

As a matter of practice it is always advisable to use the actions provided inside the Advanced designer of InstallAnywhere, as the custom code maintenance and writing is costlier. Always refer to your installer design before deciding on the usage of InstallAnywhere Custom Code.

If you require any clarification on the topic feel free to write mailto:jha.yogi@gmail.com