WiX Setup project referencing two Wixlib having same File/#Id - wix

I am new to WiX, but need a complicated scenario!
I manage a modular web application containing multiple WCF Library (i.e. module), and need to put every module as a feature in the final setup.
So I managed a WiX Setup Library for every module which genrates .wixlib files, and a single WiX Setup who references the .wixlib projects, and also will be a one-to-one relation between modules (i.e. .wixlib) and features in the final setup.
The problem arises when there is same files shared among .wixlibs, due to similar File/#Id and Componend/#Id which will be there for those shared files.
P.S: I have used WaX as engine to build .wxs files, which simply uses file name as File/#Id and Component/#Id in the .wxs files.
I beleive there could be two possible workarounds (I could achevei non of them!)
Some way to force WaX generate randome File/#Id and Component/#Id for every file.
The could be a way in Lit.exe (who builds .wixlib) to append a random id to File/#Id and Component/#Id while compiling and generating final .wixlib files.
Any sort of help will be appreciated.

Related

How to get a list of source path/destination path pairs from a wix project

I would like to create a script that will update files in the (default) install location with files from the source location where needed, based on the .wxs files that I have. I need to get this info from the wxs files, because the installation dir structure differs from the source location dir structure.
This would speed up my development cycle by not requiring a complete MSI uninstall/install when I have only recompiled one DLL for instance.
Is there functionality available in the Wix toolset that can give me a list of corresponding source and destination paths or would I have to implement everything including parsing of the Wix XML files myself?
I did not see anything relevant in the List of Tools section of the Wix documentation.
Alternative Approach: I would suggest using the commercial file and directory syncing and comparison tool Beyond Compare to copy files to the destination directory with ease if this is just for QA. I guess you can use post build steps too, but Beyond Compare is very nice and reliable. It has the features you need for just about anything related to comparison of files and folders (not affiliated). You can let the application just sit there and you can do a full comparison on the fly whenever needed. Essential software for deployment people. Alternatives exist of course (list).

vb.net auto detect dependency files for wix 3.7

I am in the process of learning WIX all thanks to MS for removing such a nice tool (vdproj) from the latest versions of visual studio.
I have come to know that I can add my files (and dlls) to distribute in WIX using that tag. It is OK. But in vdproj it was very easy to add all files. I just need to right click in file view, and select 'add project output'. This was enough to add dozen of files that were required for my application. In visual studio 2012, and using WIX 3.7, what options do I have to automatically list all those dlls that are required by my application?
There is no automatic method that could be written that wouldn't require you to remove some items and redirect some items to other folders. In the simple case, you wouldn't need an automatic method anyway.
In your WiX Setup project, add a reference to each project you want to include the output from. In the properties for a reference, set Harvest to True and Project Output Groups as desired.
Because project harvesting doesn't work in some corner cases, it is disabled by default. You must enable it in your project file. (See the references.)
Build and you will have ComponentGroups generated for your harvested projects. The script file is in the obj folder (since it's not a file you want to keep in source control).
For example, for the project ConsoleApplication1, add a ConsoleApplication1.Binaries ComponentGroupRef to a Feature. By default, all such components are placed into INSTALLFOLDER. If you want them elsewhere, you can change the ItemGroup metatdata or one of the properties that affect the HavestProjects target.
Unless you have many project references that change often, there is no need to automate this.
References: WiX.chm
HarvestProjects Target
Using Project References and Variables

Including many files in WiX without listing each one.

I’m writing an MSI for using WiX 3.0 and I’m trying to figure out how to make it include all but some files from a directory without having to manually specify each and every attribute. Similar to a dynamic pickup in installshield.
An old installer I’m looking at for reference (which uses WiX 2.0) does the following:
A makefile to call a script that will copy all the necessary files to a separate directory structure that emulates how the final product should be installed.
another script to insert the attributes for each of the files in this temp folder to a partially completed wxs file.
WiX runs
I want to avoid this step and was wondering if there were some commands or pre-processor directives to achieve this WiX itself?
Also the 1st step above spits out some generated files (from a tool) which is then included into the wxs file. Is there a way I can emulate that as well?
You need to specify each file.
However, you can use Heat.exe to automatically generate a wxs file you can include as part of your build process.
I cheaped out with a non-solution, and zipped up the directory and it's files in the build script. The advantage of your current method is that MSI is aware of the files and they could potentially be key files (and thus patched/upgraded and/or repaired).
I'd look into saschabeaumont's suggestion about using heat. clearly a better solution

WIX: installing fragments to the same directory, same file names

In my wix installer I need to install some kind of addon dlls to a directory. There could be many addons, all are installed to the same directory. Each addon is a feature which could be chosen or not. Each addon is installed together with referenced dlls. The referenced dlls can be the same (both: name and contents) for two or more components. So it could be something like this:
Addon1:
Addon1.dll
Reference1.dll
Reference2.dll
Addon2:
Addon2.dll
Reference2.dll
Reference3.dll
If both features are selected, the installation result is:
Addon1.dll
Addon2.dll
Reference1.dll
Reference2.dll
Reference3.dll
I would like to make a separate fragment for each addon so that I can manage features properly. I can harvest files for each addon but the problem here are the same file names. A wix project containing such fragments doesn't compile.
I would like to avoid placing shared reference dlls to another common fragment because there could be many addons with very different dependencies between references.
Is there any way to dial with it differently?
This is something I would do manually without automatic harvesting. Unless you have hundreds of AddOns this really isn't going to be much extra work and if you harvest them using heat and then embed the resulting wxs files into your project with some modification, it won't be too difficult at all. I suppose this will add more overhead if the AddOns change frequently but I would imagine that this won't happen all that often.

heat.exe autogenerating file fragments - every build?

I'm using heat.exe to generate WiX file fragments.
I've done this via adding a post build step to my web site project in visual studio, such that every time a build is done, any new files in the web project are picked up and new wxs file fragments are created. These file fragments are copied directly into the wix setup project, such that when the setup project is built, it will include all the newly added content files into the msi.
I noted last time I looked that every time heat.exe regenerates the wxs file fragments, it creates new guids (but apparently not new component ids).
At any rate, I'm very new to WiX/heat, so the question is - should I be autogenerating the wxs files every time, e.g. how will this effect things in production when new versions of the website are released and installed/uninstalled? are there any reasons why I should not be autogenerating and including these file fragments on every build?
There are two main lines of thought on this sort of scenario; which one you follow depends on which risk freaks you out more. Do you worry more that you may not include some changes which become necessary in the future because nobody tells you and you didn't update your one-time generation, or do you worry more that two .msi files created with results from autogeneration will not upgrade well not let you know if important files go missing?
Personally I tend towards believing that autogeneration results in harder-to-fix problems, so I would suggest generating these only when you know something has changed, and then verifying the differences are what you expect.