WiX setup: adding a reference to Visual Studio project output issue
Asked Answered
S

2

14

I'm trying to learn WiX and now creating sample setup project, using WiX Setup Project template for Visual Studio.

I have a solution with three projects:

  • .net class library;
  • .net application, which uses class library;
  • WiX setup project.

Of course, I want to add my first two projects' output as components to WiX setup.

As described here and here (and as far, as I understand), adding a reference in WiX project and setting it Harvest property to True automatically adds a component for project's output.

Now, I want to reference to this component in some Feature description.

The questions:

  • what Id for ComponentRef should I use?
  • is this the correct way to reference VS projects' output?

I'm using VS 2010 and WiX 3.6 RC.

Savick answered 10/8, 2012 at 9:6 Comment(0)
C
14

Currently Harvesting referenced project outputs does not work in Wix3.6 and will be added in Wix4.0

For now you will have to manually add the binary outputs into your project yourself (which I personally prefer anyway). For the examples below the Components will be named the same as their Child File elements (dotNetClass.Output and dotNetApp.Output).

<Component>
    <File Id="dotNetClass.Output"
          Name="$(var.dotNetClass.TargetFileName)"
          Source="$(var.dotNetClass.TargetPath)"
          KeyPath="yes" />
</Component>

<Component>
    <File Id="dotNetApp.Output"
          Name="$(var.dotNetApp.TargetFileName)"
          Source="$(var.dotNetApp.TargetPath)"
          KeyPath="yes" />
</Component>
Crankshaft answered 10/8, 2012 at 11:21 Comment(4)
Thanks a lot! I've been added components manually... but then I've decided, that some automation in this process will be nice.Savick
FYI it's $(var.VisualStudioProjectName.MacroName). A project may have 0, 1 or many classes.Aleenaleetha
how i can add 2 folders in directory to out put ? @CrankshaftBoo
@Boo I don't get what you mean. If the above question doesn't answer what you need you should ask a separate question yourself.Crankshaft
R
2

As an alternative, you can use HarvestProject, HeatDirectory and HarvestDirectory MsBuild tasks:

These are needed to embedded into your *.wixproj file or you can create a separate MSBuild compatible proj file.

Roderica answered 19/9, 2014 at 7:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.