Dear Alibaba,
the problem you are reporting I suppose is directly related to UAC restrictions and if you use Windows Vista or higher OS and need to access the network drive from an application that runs elevated (as administrator).
Unlike Windows Explorer that always runs as a standard user, in most of cases a setup package has to run as administrator, otherwise the UAC security will not allow the package installation.
That said and because the mapped drive is created under the user context, a package that runs in elevated mode will be not able to access to the mapped resource correctly and this due the fact that the UAC restrictions active with the system, do not permit such kind of access.
You may try to use the following workaround.
The code snippet supposes the existence of a mapped drive as "Z".
Code: Select all
~InstallAware Clipboard Data~
~MessageBox~
~{0FB07732-AA11-48ED-95CF-BE3C8C7113FE}~
~~
~$UNC_PATH$~
~0~
~1~
~~
~Call DLL Function~
~{8E69615C-D5B5-4C28-9C02-EBE3E21CD46A}~
~Mpr.dll,WNetGetConnectionW,void,,"pointer to UNICODE string",$MAPPED_DERIVE$,"allocated UNICODE string buffer (MAX_PATH)",$UNC_PATH$,"pointer to double word",$BUFFER_LEN$,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Set Variable~
~{245A4AE2-3AC1-4049-8C15-68DBFAFB7801}~
~MAPPED_DRIVE$MYAH$MYAH$FALSE~
~z:~
~Set Variable~
~{52655DE0-BF88-47E7-87E9-59916D9229F1}~
~BUFFER_LEN$MYAH$MYAH$FALSE~
~255~
~Set Variable~
~{1AB896FD-2D90-4EF8-9E4C-20E149185A3A}~
~UNC_PATH$MYAH$MYAH$FALSE~
~~
Regards