- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: ExistsDir is always affirmative regardless of the path ?
- 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
ExistsDir is always affirmative regardless of the path ?
I am calling the SdAskDestPath dialog box to allow the application user to enter or select a directory path.
In the msi script I need to check if the path /Directory entered already exists. So I am using the ExistsDir function. The problem I am having is that ExistsDir always returns true, even if a path was entered which does not exists? Why is that?
For example I entered the path "C:\NOT_REAL" and all of the lines of code below are executed. So,
strPathName = "C:\NOT_REAL";
if (ExistsDir (strPathName) = EXISTS) then
boolDirectoryExists = TRUE;
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thy syntax should be:
strPathName ="c:\\NOT_REAL";
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Still it fails under this specific use case, can anyone explain why?
1. Display the SdAskDestPath dialog box which prompts for the directory path.
2. When the dialog box displays enter a directory name that does not exists. Example:
C:\\TestDoesNotExists or C:\TestDoesNotExists
3. When the dialog box closes the code below always indicates that the directory exists.
if( ExistsDir (pathEntered) = EXISTS) then
targetExists= TRUE; // Always executed for steps 1 thru 3 above.
endif;