简体   繁体   English

在Visual Studio 2017中使用构建事件时的msi安装程序

[英]msi installer when using build events in Visual Studio 2017

I installed the Visual Studio 2017 Installer and added an installer project to my solution. 我安装了Visual Studio 2017 Installer ,并将installer项目添加到了我的解决方案中。

When I'm building my main project, I'm using post build events to create a Production directory (in which all files are nicely sorted into directories) - for the sake of the example, let's say that this is the new path: C:\\workspace\\NewProject\\bin\\release\\Production 在构建主项目时,我使用构建后的事件来创建Production目录(其中所有文件都很好地分类到了目录中)-为了示例起见,我们说这是新路径: C:\\workspace\\NewProject\\bin\\release\\Production

I saw that the installer takes the build files (located under the debug/release folder under C:\\workspace\\NewProject\\bin\\ ) and those are the files which will be installed when running the msi . 我看到安装程序获取了生成文件(位于C:\\workspace\\NewProject\\bin\\下的debug/release文件夹下),这些是运行msi时将要安装的文件。

However, what I wish is that the installer will ignore all files under C:\\workspace\\NewProject\\bin\\release and use the files under C:\\workspace\\NewProject\\bin\\release\\Production 但是,我希望安装程序将忽略C:\\workspace\\NewProject\\bin\\release下的所有文件,并使用C:\\workspace\\NewProject\\bin\\release\\Production

Is that possible? 那可能吗? Or should I somehow configure the output folder's files from the installer's properties? 还是应该通过安装程序的属性以某种方式配置输出文件夹的文件?

Although the "project output" option is popular as input to setup projects it's often better to just use the Add File of option in the File System view in the setup project, adding it into the target folder. 尽管“项目输出”选项通常作为安装项目的输入,但通常最好只使用安装项目的“文件系统”视图中的“添加文件”选项,然后将其添加到目标文件夹中。 It's better because you see exactly what you're adding, and the destination locations that may be scattered anywhere on the target system (Program Files, Common Files, GAC and so on). 这样会更好,因为您可以准确地看到要添加的内容,以及目标位置(可能分散在目标系统上的任何位置)(程序文件,通用文件,GAC等)。

There's no advantage to organizing files into nicely sorted folders on the build system because the setup project doesn't care. 将文件组织到构建系统上排序良好的文件夹中没有任何好处,因为安装项目无关紧要。 If you want the files nicely sorted on the target system you need to create those folders in the File System view on Target machine and add each file to its destination. 如果要在目标系统上对文件进行良好排序,则需要在目标计算机上的“文件系统”视图中创建这些文件夹,并将每个文件添加到其目标位置。

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

相关问题 WiX 安装程序 msi 未安装使用 Visual Studio 2017 创建的 Winform 应用程序 - WiX installer msi not installing the Winform app created with Visual Studio 2017 使用Microsoft Visual Studio安装程序项目构建MSI时如何扩展user.config设置 - How to extend user.config settings when building an MSI using Microsoft Visual Studio Installer Projects 如何在 Visual Studio 中创建 MSI 安装程序? - How to Create an MSI Installer in Visual Studio? Visual Studio安装程序未创建.msi文件 - Visual Studio Installer not creating .msi file 如何从jenkins构建Visual Studio安装程序项目(.vdproj)以生成.exe和.msi文件? - How to build visual studio installer project (.vdproj) from jenkins to generate .exe and .msi files? Visual Studio 2017中的工具箱控件安装程序(TCI) - Toolbox Control Installer (TCI) in Visual Studio 2017 Visual Studio 2017安装程序桌面快捷方式图标 - Visual Studio 2017 Installer Desktop Shortcut Icon Visual Studio 2017 中的 Windows 安装程序项目 - Windows Installer Project in Visual Studio 2017 使用Visual Studio 2017安装项目为C#Windows窗体创建Exe / MSI - Creating Exe/MSI for C# Windows Forms using Visual Studio 2017 Setup Project 更改目标版本时 Visual Studio 2017 dotnet 崩溃 - Visual Studio 2017 dotnet crash when changing target build
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM