安装合并模块以及“消耗”模块
我有几个解决方案,它们代表了我在工作中构建的代码框架。 一种解决方案称为“框架”,另一种称为“扩展”。
我拆分它们的原因是“扩展”解决方案包含由扩展方法组成的项目,并且这些项目的组织方式使得生成的程序集镜像 .NET 程序集。
我为“扩展”创建了一个合并模块项目,以及一个使用它的安装程序。 一切都很好 - 但现在我想为“框架”创建一个安装程序,它也使用相同的合并模块。 因此,我想修改“扩展”安装程序,将“扩展”合并模块文件复制到 C:\Program Files\Common Files\Merge Modules
,以便“框架”安装程序将具有一个众所周知的路径,通过它引用“扩展”的合并模块,而不是引用我的 VS 解决方案所在的任何模糊路径(原因是框架有时会构建在不同的机器上,在这些机器上 VS 项目的路径可能会不同)各不相同)。
MSDN 文档只是简单地解决了这个问题,并且只是说合并模块不能安装到文件系统中,而只能被“使用”。
失败。
有谁知道解决这个问题的方法吗? 自定义操作? Visual Studio 安装程序如何安装其合并模块?
I've got a couple of solutions that represent a framework of code that I've built up at work. One solution called 'Framework' and another called 'Extensions'.
The reason I split them is that the 'Extensions' solution contain projects that consist of extension methods, and the projects are organized so that the resulting assemblies mirror the .NET assemblies.
I created a merge module project for 'Extensions', and an installer that uses it. It's all fine and dandy - but now I want to create an installer for 'Framework' that also uses that same merge module. Consequently, I'd like to modify the 'Extensions' installer to copy the 'Extensions' merge module file to C:\Program Files\Common Files\Merge Modules
so that the 'Framework' installer will have a well-known path by which to reference the merge module for 'Extensions', rather than referencing whatever obscure path my VS solution lives in (the reason being that the Framework will at times be built on different machines on which paths to VS projects may vary).
The MSDN documentation addresses this only briefly, and merely says that merge modules cannot be installed to the file system, but can only be "consumed".
Fail.
Does anyone know a way around this? Custom actions? How does the Visual Studio installer install it's merge modules?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您创建 MergeModule 安装程序作为文件系统编辑器的一部分时,会出现一个名为“Module Retargetable Folder”的文件夹(这是默认名称,可以更改,也可以添加其他名称)。
构建 .msm 后,如果您转到主安装项目并向其中添加合并模块,您可以在解决方案资源管理器中选择 .msm,然后查看属性窗口,应该有一个名为“MergeModuleProperties”的条目,展开此条目您应该会看到列出的所有可重定向文件夹,然后您可以将它们指向正确的位置。
When you create the MergeModule installer as part of the file system editor there is a folder called "Module Retargetable Folder" (this is the default name and can be changed, also additional ones can be added).
Once the .msm has been built if you go to the main setup project and add the merge module to it you can select the .msm in the solution explorer and looking at the properties window there should be an entry called "MergeModuleProperties", expand this and you should see all the retargetable folders listed and you can then point them to the correct place.
简短的回答是:没有办法做到这一点,除非编写自己的安装框架。
Short answer is: there is no way to do this, short of writing your own installation framework.
虽然晚了,但
我通过重命名合并模块(更改文件扩展名),将其作为普通文件安装到文件系统,然后重命名已安装的文件来完成了一次。
Late to the party, but
I did this once by renaming the merge module (changed the file extension), installing it to the file system as a normal file, then renaming the installed file.