WiX Installer - Run an MSI multiple times with different properties?

Deadly 提交于 2020-01-15 09:44:51

问题


I am building a bootstrapper using WiX toolset (my first). It is for an add-on package for the Microsoft Flight Sim family. There are several versions of MFSF and customers often want to install our add-on package into multiple simulators. This naturally means installing many of the same files into multiple different root directories. I know I can easily choose ONE root folder by passing a property from the bootstrapper to the MsiPackage. But is there a way to get the package to install to multiple root folders?

My title is perhaps slightly misleading - running the same MSI twice may well be a massive no-no. I'm really asking what is the best direction I can take to install a group of files to multiple user-selected locations, without including them multiple times in my bootstrapper?

Thanks Farley


回答1:


This sounds like what I have to do in my IsWiX installer to integrate with Visual Studio. I have a bunch of files that need to be installed into every detected version of VS. To do this I:

1) Author AppSearch to set properties with destinations.

2) Create components and install to my directory. These aren't ever actually used by anything but it's harmless.

3) Use CopyFile elements to duplicate the files to the destinations. If AppSearch didn't find a destination then the duplication is implicitly skipped by MSI.

https://github.com/iswix-llc/iswix/blob/master/Source/Installer/IsWiX/Code/Product.wxs

https://github.com/iswix-llc/iswix/blob/master/Source/Installer/IsWiXNewAddInMM/IsWiXNewAddInMM.wxs



来源:https://stackoverflow.com/questions/49740739/wix-installer-run-an-msi-multiple-times-with-different-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!