[英]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.