问题
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