PDA

View Full Version : How to query registry service given key but UID could be anything?



srikanth
07-15-2002, 12:52 PM
Hello,

I am using ISMP 4.01

I have a product family with version numbers like 1.0.034, 1.1.006, 1.2.002, and 2.0.004 - they all belong to same product but with different features. And I have a single InstallShield XML project file to build any of these product versions.

Now how do I query registry service to find install location of any of the product version exists on the target machine?

I want to query registry service given key information but UIDs could be anything. I do set UIDs of every product bean while building installs through XSL sheet.

Basically, I am looking for something like a wildcard for version information of SoftwareObjectKey. The software key is same but the UIDs (version number) are different.

Or do I have to do this through a nested loops :)

I mean, by supplying major, minor, and build number to the query operation each time?

Please reply,

-- Srikanth

CharlesW
07-15-2002, 02:01 PM
At the very least, you will have to know the UID for the individual SoftwareObjects. By default, the UID is the 32 character identifier which is assigned automatically to each SoftwareObject when you create a new project. If you have this UID, but have multiple possible versions, then you can check each possible version for this UID. Unfortunately, there is no wildcard value which can be used. Both the UID and the version for the SoftwareObject must match exactly.

srikanth
07-15-2002, 02:21 PM
I am sorry that I mentioned UID in subject line, it should be read as version, Thanks. Here's corrected subject line:

How to query registry service given key (UID) but version could be anything?

I am using same UID but version is different. And version matches with that of product release number like 1.0.036, 1.1.006 etc

Major, Minor and Maintenance number changes (for every product bean) each time when product releases were made. I have to lookup registry given UID but apparently version Object differs.

I may have to do this through a nested loops like:

for (i=1, i<2; i++) {
for (j=0; j<3; j++) {
for (k=0; k<1000; k++) {
// set version
// loop through all possible instance number - query registry
// process install location
}
}
}

This will search for possible software versions 1.0.001, 1.0.002, ..., 1.0.999, 1.1.001, ... , 1.1.999, 1.2.001, ..., 1.2. 999

-- Srikanth

CharlesW
07-15-2002, 02:34 PM
Yes, this would work, but the process would likely be somewhat time consuming.

Actually, you might try to use RegistryService.getSoftwareObjects(). This method accepts a UID as an argument, and returns a SoftwareObject [] which contains all SoftwareObjects with a matching UID, regardless of the SoftwareVersion. To determine the install Location for each, you could then call getInstallLocation() on each element of the array.

srikanth
07-15-2002, 02:41 PM
I do not see getSoftwareObjects, I only see getSoftwareObject API from JavaDoc of RegistryService

public SoftwareObject getSoftwareObject( SoftwareObjectKey key )
throws ServiceException

In which version of ISMP 'getSoftwareObjects' is available?

CharlesW
07-15-2002, 02:43 PM
Sorry, it looks like this method was added with the release of Multi-Platform 4.5.

srikanth
07-15-2002, 02:54 PM
Oops... i can't upgrade my ISMP for now :( sorry.

I still like to change the version of every product bean, but when it comes to loopup of previous install, let me deal with nested loops for now.

Thank you, Charles, for your message.

-- Srikanth