cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

Check for directory on mapped network drive

I have an InstallScript function that checks if a directory exists in a location relative to the MSI file. When I run the installer from a location on a network drive I have mapped to my local machine, it fails to find the directory.

I have tried using both
ExistsDir(SourceDir^myDirectory)


and

Is(PATH_EXISTS, SourceDir^myDirectory)


and both return false if the directory it's looking for is located on a mapped network drive (located off the target machine). The directory exists, I can copy the path that is passed into the function and access it myself. The MSI I'm launching is also located on the same mapped drive when this occurs.

Is there a way to check if a directory exists or not in InstallScript even if it's located outside the target machine?
Labels (1)
0 Kudos
(2) Replies
Cary_R
Level 11

Hi There,

This sort of thing gets messy not from InstallScript specifically, but in general from custom actions. There's 2 things that complicate this:

1. In Vista and newer, drives mapped or shares with a session opened from a non-admin token aren't accessible to Elevated processes, which have a separate set of sessions and mappings by default. There's a system policy that (after a restart) will link the two sets:

http://support.microsoft.com/kb/937624

2. Custom actions running Deferred in System Context will fail to access network shares because they are running under the SYSTEM account, or in SMB terminology a 'NULL User' which has been disallowed for some time in windows. You have to do this with regular Deferred custom actions (with Terminal Server Aware set), or with an Immediate action.
0 Kudos
anom217
Level 8

Thanks.

After doing some research I came across both of these points and realized they both will cause problems with my install 😞
0 Kudos