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
- :
- Thanks!
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
‎Dec 18, 2013
09:24 AM
ExistsDir with Wildcard?
Okay, after a fair amount of searching I've not found anything specifically illuminating about what I'm trying to accomplish.
I'm trying to determine through the course of my install script whether a folder exists at a particular location. The issue is the folder may be named differently for each client. Can ExistsDir work with a wild card? (c:\\Program Files\\folde*.*)
If so, what's the correct syntax?
If you couldn't tell... I'm a bit of a packaging noobie so any assistance is GREATLY appreciated.
Thanks guys!
I'm trying to determine through the course of my install script whether a folder exists at a particular location. The issue is the folder may be named differently for each client. Can ExistsDir work with a wild card? (c:\\Program Files\\folde*.*)
If so, what's the correct syntax?
If you couldn't tell... I'm a bit of a packaging noobie so any assistance is GREATLY appreciated.
Thanks guys!
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 20, 2013
08:25 AM
mjgarcia,
It doesn't look like ExistsDir supports wildcards in the parameters. You might have to do something with getting a list of folders and looping through the list and using the Find String Operator (%) until you find it.
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFindAllDirs.htm
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFind_string.htm
HTH
It doesn't look like ExistsDir supports wildcards in the parameters. You might have to do something with getting a list of folders and looping through the list and using the Find String Operator (%) until you find it.
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFindAllDirs.htm
http://helpnet.flexerasoftware.com/installshield18helplib/mergedProjects/installshield18langref/LangrefFind_string.htm
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 10, 2014
10:08 AM
That definitely did help!
Thought I'd give back and post what I came up with. Thanks again!
QueryFolders("Root directory, will search subdirectories",
"String to search for within folder names",
"Error to display if folder found");
function QueryFolders(szRootPath, szVariable, szErrorMsg)
NUMBER nResult;
LIST listItemsID, listFoldersID;
STRING szString;
begin
if (MODE=SILENTMODE) then
listItemsID = ListCreate (STRINGLIST);
listFoldersID = ListCreate (STRINGLIST);
if (ExistsDir(szRootPath) = EXISTS) then
if (listItemsID = LIST_NULL) || (listFoldersID = LIST_NULL) then
abort;
endif;
nResult = GetFolderNameList (szRootPath, listItemsID, listFoldersID);
nResult = ListGetFirstString (listFoldersID, szString);
while (nResult != END_OF_LIST)
if (szString % szVariable) then
abort;
endif;
nResult = ListGetNextString (listFoldersID, szString);
endwhile;
ListDestroy (listFoldersID);
ListDestroy (listItemsID);
endif;
else
listItemsID = ListCreate (STRINGLIST);
listFoldersID = ListCreate (STRINGLIST);
if (ExistsDir(szRootPath) = EXISTS) then
if (listItemsID = LIST_NULL) || (listFoldersID = LIST_NULL) then
MessageBox ("Unable to create lists.", SEVERE);
abort;
endif;
nResult = GetFolderNameList (szRootPath, listItemsID, listFoldersID);
nResult = ListGetFirstString (listFoldersID, szString);
while (nResult != END_OF_LIST)
if (szString % szVariable) then
MessageBox (szErrorMsg, SEVERE);
abort;
endif;
nResult = ListGetNextString (listFoldersID, szString);
endwhile;
ListDestroy (listFoldersID);
ListDestroy (listItemsID);
endif;
endif;
end;
Thought I'd give back and post what I came up with. Thanks again!
QueryFolders("Root directory, will search subdirectories",
"String to search for within folder names",
"Error to display if folder found");
function QueryFolders(szRootPath, szVariable, szErrorMsg)
NUMBER nResult;
LIST listItemsID, listFoldersID;
STRING szString;
begin
if (MODE=SILENTMODE) then
listItemsID = ListCreate (STRINGLIST);
listFoldersID = ListCreate (STRINGLIST);
if (ExistsDir(szRootPath) = EXISTS) then
if (listItemsID = LIST_NULL) || (listFoldersID = LIST_NULL) then
abort;
endif;
nResult = GetFolderNameList (szRootPath, listItemsID, listFoldersID);
nResult = ListGetFirstString (listFoldersID, szString);
while (nResult != END_OF_LIST)
if (szString % szVariable) then
abort;
endif;
nResult = ListGetNextString (listFoldersID, szString);
endwhile;
ListDestroy (listFoldersID);
ListDestroy (listItemsID);
endif;
else
listItemsID = ListCreate (STRINGLIST);
listFoldersID = ListCreate (STRINGLIST);
if (ExistsDir(szRootPath) = EXISTS) then
if (listItemsID = LIST_NULL) || (listFoldersID = LIST_NULL) then
MessageBox ("Unable to create lists.", SEVERE);
abort;
endif;
nResult = GetFolderNameList (szRootPath, listItemsID, listFoldersID);
nResult = ListGetFirstString (listFoldersID, szString);
while (nResult != END_OF_LIST)
if (szString % szVariable) then
MessageBox (szErrorMsg, SEVERE);
abort;
endif;
nResult = ListGetNextString (listFoldersID, szString);
endwhile;
ListDestroy (listFoldersID);
ListDestroy (listItemsID);
endif;
endif;
end;