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

How do find if file is in the PATH?

I want to step through each directory in PATH and see if 3rd party dll exist in any one of the directories mentioned in PATH? I am using Search File System but it asks to specify search directories manually. How do I specify PATH variable?
Labels (1)
0 Kudos
(1) Reply
enanrum
Level 9

I do not know if you can use the Dir Search action! You can write a custom action to do it!

[HTML]
public void onExecutingSearchPath(com.installshield.event.wizard.WizardActionContext arg0)
{
try {
String path = arg0.resolveString("$N($E(PATH))");

String[] paths = path.split(";");
for(int y=0; y < paths.length; y++ ){
String inFile = paths + "\\file.dll";
File f = new File(inFile);
if(f.exists()){
arg0.getServices().getISDatabase().setVariableValue("DLLFOUND", "true");
}
} catch () {
}
}
[/HTML]
Then for whatever your doing with the dll component or feature just put in the condition 'String Comparison' see if $V(DLLFOUND) = true

Regards,
Tom
0 Kudos