cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
eddie3721
Level 3

upgrade -Get the version number of the existing installs

Is there a way to get version number of the product installed if given the productId or install location in windows or unix?

I am trying to find the version number in the preinstall staging so I can determine if it's upgradeable/patchable.

thanks
Labels (1)
0 Kudos
(9) Replies
khansen
Level 5

If you have structured your installer to use components and they have the same version as your product, you can use the "Find Component in Registry" action. One trick would be to version the uninstaller component with the same version as your product. Then look for the uninstall component, since it is likely there if the product is installed.

Another option is to write custom code to read the IA registry file which has the product information in it, including the version. I don't know why there isn't a "Find Product in Registry" action provided. :confused: It seems kind of short sighted not having one.
0 Kudos
RobertDickau
Flexera Alumni

As an aside, InstallAnywhere 2009 provides a ProductRegistryService interface (in com.zerog.ia.api.pub.registry), which gives you read access to the IA registry for this kind of information.
0 Kudos
eddie3721
Level 3

I was able to get the installed product version by location. However I had to do a lot of other logics to compare the versions . e.g. currentVersion < installedVersion, whether the base installer for the patch exist in the custom code. Is there a better way to do this?


ProductRegistryService productRegistryService = (ProductRegistryService) ip.getService(ProductRegistryService.class);
String productLoc = (String) ip.getVariable($USER_INSTALL_DIR$);
String productId = (String) ip.getVariable($PRODUCT_ID$);
//
//set the search criteria with location and Unique product id
SoftwareObjectSearchCriteria sc = new SoftwareObjectSearchCriteria();
sc.setLocation(productLoc);
sc.setUniqueID(productId);

Product product = null;

ip.setVariable("$INSTALLED_PRODUCT_VERSION$", product.getVersion());
0 Kudos
cristian
Level 3

Hello,

I have a similar issue with getting the product information for an installed product.

>If you have structured your installer to use components and they have the >same version as your product, you can use the "Find Component in >Registry" action. One trick would be to version the uninstaller component >with the same version as your product. Then look for the uninstall >component, since it is likely there if the product is installed.

Unfortunately, the installer is already out and no component indicates the product version. So "Find Component in Registry" is of no help to find out the information on the installed product (version, location, etc.).

>Another option is to write custom code to read the IA registry file which >has the product information in it, including the version. I don't know why >there isn't a "Find Product in Registry" action provided. It seems kind of >short sighted not having one.

"Find Product in Registry" is a real miss, because getting the product information for installed products is a basic need for upgrades!

How the IA registry file can be read in custom mode? Is there any way to get to that file in custom mode? I know its location depends on the system: Windows - Program Files/Zero G Registry/.com.zerog.registry.xml; Linux - $UserHome/.com.zerog.registry.xml; other unix platforms - /var/.com.zerog.registry.xml; etc.)

>As an aside, InstallAnywhere 2009 provides a ProductRegistryService >interface (in com.zerog.ia.api.pub.registry), which gives you read access to >the IA registry for this kind of information.

With the Silver Maintenance Plan is it possible to upgrade the InstallAnywhere 2008 to InstallAnywhere 2009?

Thank you for your answers,

Cristian
0 Kudos
pv7721
Level 20

cristian wrote:


With the Silver Maintenance Plan is it possible to upgrade the InstallAnywhere 2008 to InstallAnywhere 2009?

Thank you for your answers,

Cristian


AFAIK, yes. If you had registered your maintenance number when instructed, you should have received an email announcing the availability of IA 2009.
0 Kudos
cristian
Level 3

Thank you for your answer.

But I'm still waiting for an answer about how reading the IA registry file from custom code ...
0 Kudos
khansen
Level 5

You'll have to write a CustomCodeAction that does this. In the code you'll need to check the platform and look for the registry file in the correct path. Then you'll need to parse the xml in the registry file looking for products. Once you get a list of products, you'll need to look for the name or id attribute that matches what you are looking for. Then you can get the attributes for the version, location, etc.
0 Kudos
cristian
Level 3

Thank you.

Yes, but where I can get a list with the locations of the IA Registry file by platform?

Thanks again.
0 Kudos
khansen
Level 5

I think you'll just have to hard code the paths in your code. For Windows the registry file is in C:\Program Files\Zero G Registry. On 64-bit Windows it is in C:\Program Files (x86)\Zero G Registry. You could use a combination of IA variables like $PROGRAMS_DIR$, $PROGRAMS_DIR_32$, or $PROGRAMS_DIR_64$ to get the first part of the path. On Linux the registry file is in /var. I think it is the same for Unix. I'm not sure where it is on other platforms. You can install on those platforms and do a search for .com.zerog.registry.xml.
0 Kudos