Hi Phil,
I am not an installer expert, but I suspect this problem is caused by the
Windows security architecture. The network drive mapping is a per logon
session information, which means that if a process runs under a different
account as the interactive user, this process can not see the network drive
mapping that is setup by the interactive user. For example, Asp.net process
runs under a service account, so Asp.net can not see any network drive
mapping of interactive user. So, my suspicion is that the OpenFileDialog is
launched by the Windows installer under a different user account.
To prove my concept, I created a sample Winform project with Installer
class; in the OnBeforeInstall () method, I show a messagebox for testing
purpose. , then I created a setup project with it. During the installation
process, I see my messagebox pops up. Then I use Process Explorer's "Find a
Window's Process" feature to find the process of this messagebox(whic h
should be the same process that runs your OpenFileDialog) . The testing
shows that it is the "MsiExec.ex e" process that runs the MessageBox code.
Also it runs under the "NT AUTHORITY\SYSTE M" account instead of my
interactive domain account. This is why your OpenFileDialog can not see the
network drive mapping.
Let's analyze why the "NT AUTHORITY\SYSTE M" account will result in "Access
Deny" while accessing the network path. The SYSTEM account is a super
priviledge account in the local machine, but it can not be recognized
across machines because every machine has its own SYSTEM account. So, when
the SYSTEM account is accessing the network, it is identified as the
machine account. So it is quite possible that the network path on the
remote machine does not grant access for your machine's machine acount. So
the SYSTEM account accessing fails with "Access Deny".
To resolve this problem, we can explicitly establish the network drive
mapping programmaticall y in the Installer code, so that SYSTEM account can
see it. I provided detailed C# code in the link below:
http://groups.google.com/group/micro...curity/msg/063
d7b08b29e5642?h l=zh-CN&
You may use the C# to VB.net converter below to translate the sample code:
http://authors.aspalliance.com/aldot...translate.aspx
Hope it helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.