Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 6

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;

Labels (1)
0 Kudos
(2) Replies
Level 7

Thy syntax should be:

strPathName ="c:\\NOT_REAL";

0 Kudos

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.


0 Kudos