This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- How to read the IA registry from custom code
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 10, 2008
01:07 PM
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
I am trying to find the version number in the preinstall staging so I can determine if it's upgradeable/patchable.
thanks
(9) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
11:49 AM
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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2008
08:48 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 20, 2009
12:09 PM
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());
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());
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2009
05:18 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2009
06:29 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2009
09:27 AM
Thank you for your answer.
But I'm still waiting for an answer about how reading the IA registry file from custom code ...
But I'm still waiting for an answer about how reading the IA registry file from custom code ...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 22, 2009
07:11 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 23, 2009
08:06 AM
Thank you.
Yes, but where I can get a list with the locations of the IA Registry file by platform?
Thanks again.
Yes, but where I can get a list with the locations of the IA Registry file by platform?
Thanks again.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 23, 2009
10:14 AM
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.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)