WIX Toolset is integrated into the problems of beginners VS 2012

My company recently forced us to use Wix Toolset (v.4.0.12) because we upgraded to Visual Studio 2012, which, unfortunately, no longer contains installer projects.

My problems are as follows. I have a great solution with many projects that eventually lead to an exe file and several dlls.

Then I create a Wix installation project in the solution and add a link to the project that creates the exe file. In the properties of this project link, I set Harvest: true and Project Output Groups: Binaries .

I would expect to build my WiX project to collect dependencies on the mentioned project, so I do not need to manually add links, as this will give me more service.

Also, if I run heat.exe in the referenced project file, I get only the exe output file, not the DLL the project depends on.

I assume the above is pretty standard and wix tools should be able to collect this information for me. And I really wonder why, after an extensive search on the net, I can’t find anyone with similar problems.

If anyone knows why above, please try sending me a basic WiX tutorial. It seems impossible to find the right one.

+7
source share
3 answers

WiX v3.6 and later support VS2012. WiX v4.0 almost does not start and is currently not recommended. Lots of faults coming into v4.0, so now stick to the v3.x line.

The auto-cleaning feature in Votive does not work fully. This is why it is disabled by default. Found many types of projects violated it. As you have discovered, harvesting does not go through numerous links to projects. Anything that needs more work before they work properly.

In the meantime, you can list the File elements in the Component elements.

+8
source

Not sure how you use v4.0.12 when it is not yet released! :) Wix v3.8 is the latest version: http://wixtoolset.org/releases .

The official documentation tutorial .

However, for your specific case, you need to manually include the outputs of each project and their dependencies in the installer, since automatic cleaning is not yet supported:

 <Component> <File Id="ProjectA.Output" Name="$(var.ProjectA.TargetFileName)" Source="$(var.ProjectA.TargetPath)" KeyPath="yes" /> </Component> <Component> <File Id="ProjectA.NlogDependancy" Name="NLog.dll" Source="$(var.ProjectA.TargetDir)\Nlog.dll" KeyPath="yes" /> </Component> <Component> <File Id="ProjectB.Output" Name="$(var.ProjectB.TargetFileName)" Source="$(var.ProjectB.TargetPath)" KeyPath="yes" /> </Component> <Component> <File Id="ProjectB.AutofacDependancy" Name="Autofac.dll" Source="$(var.ProjectB.TargetDir)\Autofac.dll" KeyPath="yes" /> </Component> 

In fact, it is not so difficult, and if you have several hundred binary files do not make you wait long.

+2
source

I had a similar problem when I tried to create a .msi installation of my solution.

To overcome this problem and make it durable over time, even when I insert new .dlls and other dependencies into my project and automatically do this, I did the following.

In my Product.wxs I have this "Reference"

 <!--Here We Install Our Main App--> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLFOLDER" Name="MyAppDir"/> </Directory> ... </Directory> 

and in my project project Wix-> properties β†’ Build events β†’ Pre build event, I added this command:

  "%wix%\bin\heat" dir "$(SolutionDir)MainProject\bin\Debug" -dr INSTALLFOLDER -scom -frag -srd -sreg -gg -cg Components -var var.MainProject.TargetDir -o $(SolutionDir)MainProject\Includedheat.wxs 

Once I build the wix project, it will create the Includedheat.wxs file in my MainProject directory, which lists all the files from my MainProject \ bin \ Debug directory.

The next step is to add includeheat.wxs in your wix project than in my function section, which I added:

 <!--Add Component--> <Feature Id="MainApplication" Title="Main Application" Level="1"> ... <ComponentGroupRef Id="Components" /> </Feature> 

now when i rebuild and install .msi, all the content that is in my MainProject \ bin \ Debug directory will also be included in the MyAppDir directory at the destination location.

For more information: I followed these guides:

Create a Wix work project.

The easy way is heat.exe.

It is also recommended that you read to determine what flags to use in your team.

+1
source

All Articles