Hi Francesco,
the setup sometimes has problems with the function "Does File/Folder Exist" if the file to be checked is on a network path (mapped drive).
On some systems it is working and on others not - although the file is always there.
Do you have an idea?
How could I solve it?
Thank you!
Is "Does File/Folder Exist" working with mapped folders?
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Is "Does File/Folder Exist" working with mapped folders?
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".
Regards
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
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Is "Does File/Folder Exist" working with mapped folders?
Hi Francesco,
thank you for the tip with the user mappings, that could be the reason.
But if I understood right, the administrator user will not be able to see the mapping, so the function WNetGetConnectionW will also fail to get the path because it is running as administrator. Right?
thank you for the tip with the user mappings, that could be the reason.
But if I understood right, the administrator user will not be able to see the mapping, so the function WNetGetConnectionW will also fail to get the path because it is running as administrator. Right?
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Is "Does File/Folder Exist" working with mapped folders?
Dear Alibaba,
instead for what I have personally verified, the "WNetGetConnection" (Windows networking API) is able to retrieve the UNC path of the given mapped drive anyway.
I can only suppose this is due the fact that the Windows networking APIs are expressly designed for administrative use.
Hope this helps you.
Regards
instead for what I have personally verified, the "WNetGetConnection" (Windows networking API) is able to retrieve the UNC path of the given mapped drive anyway.
I can only suppose this is due the fact that the Windows networking APIs are expressly designed for administrative use.
Hope this helps you.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Who is online
Users browsing this forum: No registered users and 184 guests