cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DronidZe
Level 4

List of already installed files

Hi!

How I can get installed files list for some bean by beanId which was installed on previous installation? May be who is did it? I know that this information is contain in uninstaller.dat but I don't know how can get access to this archive via ISMP API.
Labels (1)
0 Kudos
(3) Replies
DronidZe
Level 4

I tried to use "Uninstall Product Action" for this but it doesn't work of me:( May be someone used it and can help me how to use right this action?
0 Kudos
enanrum
Level 9

I have a function that I run to check if a feature is installed. BTW - I'm not very efficient with java - I believe I got the code from Customer Support!!

I added a Custom Action in the Sequence and loop through the features I want to check if installed:

boolean INSTALLED = false;
INSTALLED = IsInstalled(arg0, beanID);
if ( INSTALLED ){
blah
blah
}

[CODE]
import com.installshield.wizard.service.system.*;
import com.installshield.product.service.registry.*;

public boolean IsInstalled(com.installshield.event.wizard.WizardActionContext arg0, String Bean)
{
boolean INSTALLED = false;
try{
WizardServices ws = arg0.getWizard().getServices();
RegistryService regService = (RegistryService)arg0.getService(RegistryService.NAME);

String FeatureUID = ws.resolveString("$P(" + Bean +".key.UID)");
SoftwareObject[] softObj = regService.getSoftwareObjects(FeatureUID);
int FeatureLength = softObj.length;
if (FeatureLength > 0 ){ // Feature is installed!
// The feature is installed - is the install location different?
String installLocation = arg0.getServices().getISDatabase().getVariableValue("IS_DESTINATION");
for(int i = 0; i < softObj.length; i++){
if (installLocation.equalsIgnoreCase(softObj.getInstallLocation())){
INSTALLED = true;
i = softObj.length;
} else { // already installed but in a different directory
INSTALLED = false;
}
}
}
return INSTALLED;
} catch (ServiceException se) {
arg0.logEvent(this,Log.ERROR, se.getMessage());
return INSTALLED;
}
}
[/CODE]

Hope this helps!

Regards,
Tom
0 Kudos
DronidZe
Level 4

Thanks enanrum for your help!
We found how to use right "Uninstall Product Action" and using this way. "Uninstall Product Action" works with "Files" action only. Now all works fine.
More thanks!
0 Kudos