简体   繁体   English

Visual Studio 2013安装程序项目扩展复制到根文件夹

[英]Visual Studio 2013 Installer Projects Extension copying to root folder

I have installed Microsoft Visual Studio 2013 Installer Projects to create a simple installer. 我已经安装了Microsoft Visual Studio 2013安装程序项目来创建一个简单的安装程序。 When I run the installer however it copies the files to c:\\ instead of the proper folder in Program Files (even though it asks for the path). 但是,当我运行安装程序时,它会将文件复制到c:\\而不是Program Files中的正确文件夹(即使它要求输入路径)。

This seems to be caused by the fact that the MSI (the only thing produced by the Installer project) is not run with elevated privileges. 这似乎是由于MSI(由Installer项目生成的唯一内容)没有以提升的特权运行的事实引起的。 The other thing is that you cannot say run as administrator for MSI file (unless you do some reg-hacks). 另一件事是您不能说以MSI文件的管理员身份运行(除非您进行了一些注册表修改)。

I have searched for a solution and there seem to be loads of more or less complicated ways how to tackle this. 我一直在寻找解决方案,似乎有很多或多或少复杂的方法来解决这个问题。

The question is - is there not a simple switch that would allow me just to copy the files to appropriate Program files folder? 问题是-是否有一个简单的开关可以让我将文件复制到适当的Program files文件夹? I do not want to create workarounds for something that seems to be the very basic functionality. 我不想为似乎非常基本的功能创建解决方法。

If adjusting the environment (UAC settings, Registry values) is totally not an option for you then maybe you could try one of the following: 如果完全不适合调整环境(UAC设置,注册表值),那么您可以尝试以下方法之一:

  1. The Visual Studio Setup Project produces both an MSI and a setup.exe file. Visual Studio安装项目会同时生成MSI和setup.exe文件。 The latter one you can run as administrator by right-clicking on it. 您可以通过右键单击后者来以管理员身份运行 No hacks. 没有黑客。
  2. Another way of starting a process with elevated privileges is opening a command prompt (cmd) as administrator and then launch your EXE or MSI from the command prompt window. 使用提升的特权启动进程的另一种方法是以管理员身份打开命令提示符(cmd) ,然后从命令提示符窗口启动EXE或MSI。

- --

Note: Even though it may not be related to your question, I would also pay attention to the Target Platform . 注意:尽管它可能与您的问题无关,但我还要注意Target Platform For instance, you cannot install a 64-bit project to the Program Files (x86) folder. 例如,您不能将64位项目安装到Program Files(x86)文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM