PDA

View Full Version : Query if another program is installed



igel.de
04-22-2003, 09:04 AM
Hi!

I'm trying to check if another program (which I also created using ISMP 5) is installed.

Because when the uninstaller of program A is called it should only uninstall program A when program B first is uninstalled.

I tried the "AlreadyInstalledCondition", but I don't get it to work, I don't exactly know what to tell the bean...

I hope you can help me a bit...

Thanks!

Christian

RobertDickau
04-22-2003, 12:06 PM
Perhaps see this variant: http://community.installshield.com/showthread.php?s=&threadid=109606...

igel.de
04-23-2003, 02:21 AM
Thank you, but:
How do I install this variant?
I copied the .java-Files to the other downloaded custom beans (which are recognized in the Bean Gallery), but they don't work...
I copied ObjectAlreadyInstalledBeanInfo.java and ObjectAlreadyInstalled.java
to classes\com\installshield\extras\wizard\condition
and the .html-Files to the subdirectory beanhelp.

I'm not a Java-programmer and the file lacks documentation...

Thanks!
Christian

William
04-23-2003, 01:27 PM
Basically, a product is a SoftwareObject. The way to tell if a SoftwareObject is installed on a target machine or not is to use the RegistryService to do so. There's documentation about the RegistryService methods in the help docs, but the "RegistryService.getSoftwareObjects()" method will return all SoftwareObjects on the machine that have the uid provided to the method. In other words, if you were to call that method with the uid for the product you are looking for (ie. the uid associated with the product's key property), it would return an array of SoftwareObjects representing all installed instances of that product on the target machine. The custom bean referred to previously used that method in this same manner, but also provided additional functionality to verify version information on the returned SoftwareObjects by verifying the various fields within that SoftwareObjectVersion associated with each SoftwareObject (accesible by calling "SoftwareObject.getKey.getVersion()" on a SoftwareObject).

Does this help any?

igel.de
04-24-2003, 04:49 AM
Originally posted by William
Does this help any?

Not so much, because I'm not a real programmer...
I just want to use one of the "AlreadyInstalled" beans and need to know which values I have to fill in the forms to know if another program is installed.

Thanks anyway!

Christian

RobertDickau
04-24-2003, 08:26 AM
The code you saw (the .java files) needs to be compiled into Java classes (.class files) before placing them in the classes directory and registering them. You might find section 6, "Custom Beans", in the online help useful...

igel.de
04-24-2003, 09:45 AM
Thanks, using compile.bat one of the files compiled (ObjectAlreadyInstalled.java is now a .class file).
But the other one (*BeanInfo.java) just gives me the following error:
ObjectAlreadyInstalledBeanInfo.java:9: cannot resolve symbol
symbol : class ObjectAlreadyInstalled
location: class imp4beans.wizardactions.ObjectAlreadyInstalledBeanInfo
Class beanClass = ObjectAlreadyInstalled.class;

When I finally one day get both compiled, where do I have to place them? In the classes/ subdirectory of ISMP? Or there down in another subdir? Where do the beanhelp/* files go?
The file that contained ObjectAlreadyInstalled.* has absolutely no readme file or sth. like that...

Bye,
Christian