Archive: Exclude UNC paths?


Exclude UNC paths?
Hi. Thanks to HotButteredSoul's UNC path function I can't decide whether to exclude only non-mapped locations beginning with a backward slash, or whether to block mapped locations also, that begin with a backward slash in UNC format. From my point of view, mapped locations aren't ideal, because they put the uninstaller on one machine and the uninstall registry entries on another. I'd just as soon exclude network installations, and if, as experienced by HotButteredSoul, mapped drives "can cause issues", what choice do I have? Some users might have good reasons to install onto a remote computer, however since UNC path names break the installer the way some networks are configured (like mine - mapped paths converted to UNC send the installer into a loop), it seems inevitable that you snub them. No network installations. I'm posting this in case someone knows another way to detect mapped drives. The get_universal_name function is good stuff, but it could be useless on older Windows. I'll check.


You can call GetDriveType using the System plug-in and compare the result to DRIVE_REMOTE.

!include LogicLib.nsh
#...
!define DRIVE_REMOTE 4
System::Call 'kernel32::GetDriveType(t "J:\") i.r0'
${If} $0 == ${DRIVE_REMOTE}
# bad installation directory
${EndIf}