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
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How do find if file is in the PATH?
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
Mar 24, 2006
02:06 PM
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?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 29, 2006
10:33 AM
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
[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 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
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)