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 to get partial dir structure specified in INSTALLDIR
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
‎Jul 17, 2024
06:54 PM
Hi,
Say user specified c:\app\foo\bar as the INSTALLDIR to install the product.
In InstallScript, how do I extract c:\app from this ?
thanks.
(1) Solution
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 19, 2024
07:58 AM
agshah,
You could write a custom function to accomplish this using StrGetTokens:
//example usage:
svResult = GetRootFolder( svFolderPath );
//--------------------------------------
prototype STRING GetRootFolder( STRING );
function STRING GetRootFolder( szPath )
LIST lstPathParts;
STRING svDrive, svFolder;
begin
lstPathParts = ListCreate( STRINGLIST );
StrGetTokens( lstPathParts, szPath, "\\" );
ListGetFirstString( lstPathParts, svDrive ); // gets the drive
ListGetNextString (lstPathParts, svFolder); // gets the root folder
return svDrive ^ svFolder; // returns the path
end;
HTH
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2024
08:59 AM
Would the ParsePath function help?
https://docs.revenera.com/installshield/LangRef/LangrefParsePath.htm#langref_appendixc_75657681_1025440
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 18, 2024
03:46 PM
thanks but ParsePath function does not seem to help with my situation.
None of the 'nOperation' options, for example, will return c:\app from c:\app\foo\bar.
Is there anything else that can help with this?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 19, 2024
07:58 AM
agshah,
You could write a custom function to accomplish this using StrGetTokens:
//example usage:
svResult = GetRootFolder( svFolderPath );
//--------------------------------------
prototype STRING GetRootFolder( STRING );
function STRING GetRootFolder( szPath )
LIST lstPathParts;
STRING svDrive, svFolder;
begin
lstPathParts = ListCreate( STRINGLIST );
StrGetTokens( lstPathParts, szPath, "\\" );
ListGetFirstString( lstPathParts, svDrive ); // gets the drive
ListGetNextString (lstPathParts, svFolder); // gets the root folder
return svDrive ^ svFolder; // returns the path
end;
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 19, 2024
06:47 PM
thanks very much.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)