Tuesday, February 26, 2008

ASCII update problem with shell scripts in IA

InstallAnywhere supports ASCII update of files as its predecessor ISMP. But the interesting feature with InstallAnywhere is it substitutes everything between "$" sign. The reason behind this being IA resolves its variable which are in between two $ sign like $USER_INSTALL_DIR$ or $PRODUCT_NAME$
 
Here is the most interesting part which is going to attract your attention
 
A Shell script resolves its variable the same way IA does i.e the string starting with $ sign is considered to be a shell variable. Now here's the tweak if your shell script has multiple $ sign in a single line and if you are trying to update this file using IA ASCII update you will end up corrupting your file.
 
A very weired solution to this problem is to replace all the $ sign with "DOLLAR" 
Although tough to belief the Advanced designer has the feature where you can mention do not substitute IA variables but it actually does not respect your input.
 
So if you are trying to update a file that contains multiple $ sign in a file file use DOLLAR, once the IDE update the file as per your instruction it will automatically replace the DOLLAR with $
 
:) Keep reading many more to come....

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

Thursday, December 20, 2007

Creating and running Custom code for installation

InstallAnywhere provides support to run Custom Java code during installation of product. Although IA has added many custom features which saves lot of your development time but some times it becomes a necessity to write a custom code.
 
The Java code can be written in any development environment, the class has to extend from CustomCodeAction of InstallAnywhere. The use then has to override the install and un-install methods of the base class. Please find the snippet of the sample code below.
 
public class code extends CustomCodeAction
{
 public void install(InstallerProxy proxy) throws InstallException
 {
 }
 public void uninstall(UninstallerProxy Uproxy) throws InstallException
 {
 }
}
 
Its very simple to write custom for IA.
 
Once the Java file is compiled using the IAClasses.zip in the class path, create a .jar or .zip file for the class file.
 
Now go to the advance designer right click on Run Custom Code in the Install section. This will allow you to add a custom action to you installation project. In the properties of the run custom code action browse the .zip file and for the class name provide the fully qualified class file name like com.company.product.ClassFileName
 
Make sure that you are bundling the same VM pack with the installer that you have used to compile your Java code, other wise you might get errors during installation like could not find class com.company.product.ClassFileName
 
Happy developing your custom actions, if you have any questions on custom code feel free to put comments on the post or write to mailto:jha.yogi@gmail.com
 

Tuesday, December 18, 2007

InstallAnywhere collaboration for Eclipse

InstallAnywhere 2008 Enterprise and standard edition provides support for collaboration with Eclipse IDE for creating developer installation manifests(DIM). DIM's play a key role while authoring huge installation projects. It allows a team of developers to work separately and independently. InstallAnywhere provides a plugin for Eclipse which can be added during InstallAnywehere's installation or it can be copied from directly to the plugins folder of Eclipse.
 
To start using InstallAnywhere collaboration project in Eclipse follow the steps mentioned below. 
1. Click New project in Eclipse IDE and select IsntallaAnywhere collaboration project from the options.
2. This launches a new project creation wizard,  enter the name of the project and click next.
3. The wizard then asks for DIM details, see the snapshot and fill the relevant details.
4. Now you are ready to author the DIM, double click on the DIM  it will open it in the work space.
5. You will find various properties like General, Content, Variables and Dependencies tab at the bottom of the DIM descriptor inside workspace.
6. Click over the contents tab which will show contents of the DIM like File System, Environment Variable, Windows Registry and Database Servers. Right click on individual subsets to populate them individually with file sets, environment variables, registry entry etc.
 
I will be writing much more about DIM for InstallAnywhere collaboration with Eclipse, so stay tuned and keep visiting.
 
 

Migrating ISMP 11.5 project to InstallAnywhere 8

Sicne the time ISMP has been called off from market and started promoting IA. It has been a cumpulsion for the enterprises to migrate their installation project from ISMP to IA 8. Since IA has roots from ZeroG and ISMP has roots from InstallShield basic architecture and logic for installer deployment is diffrent. Although Macrovison supports project migration but all the operations are not possible.
 
I will be describing all the ways the project can be migrated but before that, I will specify all the unsupported elements that can be migrated
 
1. All the custom code written for ISMP project cannnot be migrated as the basic classes are differert. viz ISMP uses Custom Beans (Wizard and Product) for running installation while IA uses installation proxies and uninstallation proxies. Refere the Java Doc for developing custom code
2. All the shorcuts and lnk cannnot be migrated successfully (although can be used for partial reference) ISMP uses reference file paths for lnk and file components whereas IA uses actual isntall path for already installed file or new file. 
3. Custom panels developed with ISMP cannot be migrated to IA.
 
Steps to migrate ISMP project to IA
 
 Downlod the plugin for IA migration for ISMP which is available at support site of Macrovison. use this link to download plugin and doccumentation from Macrovison  http://support.installshield.com/kb/files/Q112375/install.htm
 
 
Follow all the steps listed in the doccument to end up into a successful partial migration from ISMP to InstallAnywhere.
 
Need addtional help in migrating your old installation project to InstallAnyhwere ? keep posting comments to the article and continue reading. A lot is due to come...