[英]How to configure .NET Setup project to copy files to network mapped drive?
I have created a Setup project in VS 2010 for a windows forms project. 我在VS 2010中为Windows窗体项目创建了一个安装项目。 The application installs to C:\\Program Files correctly. 该应用程序将正确安装到C:\\ Program Files。 I have some configuration files that needs to be copied to a network mapped drive (I:\\ drive). 我有一些配置文件需要复制到网络映射的驱动器(I:\\驱动器)。 How do I achieve this? 我该如何实现?
Below are the steps followed: 1. Setup project --> View --> File System 1. Add Special folder 2. Custom folder 3. Copied all the configuration files to the custom folder. 以下是执行的步骤:1.安装项目->视图->文件系统1.添加特殊文件夹2.自定义文件夹3.将所有配置文件复制到自定义文件夹。 4. Custom folder --> DefaultLocation (property) --> [I:]\\ 4.自定义文件夹-> DefaultLocation(属性)-> [I:] \\
Am I doing something wrong here? 我在这里做错什么了吗?
I don't believe you can do this for two reasons: 我不认为您可以这样做有两个原因:
The install runs with the system account which doesn't normally have access to the network. 安装使用通常无法访问网络的系统帐户运行。
Mapped drive letters are not system-wide. 映射的驱动器号不是系统范围的。 They are specific to the user context that created them, so the system account has no idea of an I: drive created by another user. 它们特定于创建它们的用户上下文,因此系统帐户不知道其他用户创建的I:驱动器。 A share mapping that doesn't use drives such as \\server\\share\\location might work if point 1 can be overcome. 如果可以克服第1点,则不使用\\ server \\ share \\ location等驱动器的共享映射可能会起作用。
In these case it's usually better to copy the files when your app first runs as part of a configuration step. 在这种情况下,通常最好在应用程序作为配置步骤的一部分运行时复制文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.