Detect if APPDIR is a network mapped drive - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

anupmistry
Posts: 52
Joined: Tue Jan 12, 2010 6:39 pm

Detect if APPDIR is a network mapped drive

We provide a screen to select the drive users want to install the software. Problem is users are mapping drives to another PC and using that mapped drive as the install folder. How do I change the Advanced Installer project to detect if the drive the user selected is a mapped drive. Basically need to only allow installing to the hard-drive.

Reason we do not want to filter the drop-down initially is this way they will know if before this new release they are using a mapped drive; but from this release onwards you cannot install it anymore.

Hope this is clear
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Detect if APPDIR is a network mapped drive

Hi,

I'm afraid we don't have a predefined support for detecting if APPDIR is set to a mapped drive. What you can try to do is to create an UI Custom Action and place it on the
"Next" button from the dialog where the install path is set.

The custom action will check the path and prompt the user to change if it is pointing to a mapped driver.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: Detect if APPDIR is a network mapped drive

I had a similar issue... services can't access data on mapped drives but it can access them via UNC. Here is some VBscript to get you started...you can't use WScript of course.

Code: Select all

Function ConvertToUnc(driveLetter)
	Dim network
	Dim drives
	Dim i
	
	Set network = CreateObject("WScript.Network")
	Set drives = network.EnumNetworkDrives
	
	WScript.Echo "Network drive mappings:"
	For i = 0 to oDrives.Count - 1 Step 2
		WScript.Echo "Drive " & oDrives.Item(i) & " = " & oDrives.Item(i+1)
	Next
End Function

Return to “Common Problems”