Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can WiX reference a project with a period in the name?

WiX files can reference other projects using $(var.ProjectName.TargetPath) syntax. However, I have a project with a period in the name (My.Project). How can I reference this? I have tried:

  • $(var.My.Project.TargetPath)
  • $(var.My.Project.TargetPath)
  • $(var.My\.Project.TargetPath)
  • $(var.{My.Project}.TargetPath)
  • $(var.(My.Project).TargetPath)
  • $(var.[My.Project].TargetPath)
  • $(var.MyProject.TargetPath)
  • $(var.My%2EProject.TargetPath)

The build error I get is:

Undefined preprocessor variable '$(var.My.Project.TargetPath)'

like image 285
Stephen Jennings Avatar asked Apr 23 '11 00:04

Stephen Jennings


People also ask

What is TargetDIR Wix?

TargetDIR is the directory in which the files are installed. It is a required parameter for the element. The value of TargetDIR is resolved to an absolute path during installation. If TargetDIR is not specified, the default is the directory of the component.

How do you add references to a project?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference. For more information, see How to: Add or remove references.


2 Answers

The answer is yes, and the method is:

$(var.My.Project.TargetPath)

As it turns out, I'm a dope who forgets to add project references to his installer project.

like image 99
Stephen Jennings Avatar answered Nov 15 '22 20:11

Stephen Jennings


I'm sorry, I'm using WiX 3.5 and I can't reproduct your problem. I created a sample solution with a class library called "Foo.Bar" and a Merge Module with a project reference for "Foo.Bar".

My wixproj looks like:

  <ItemGroup>
    <ProjectReference Include="..\Foo.Bar\Foo.Bar.csproj">
      <Name>Foo.Bar</Name>
      <Project>{0bd367ce-5072-4161-8447-ff4deed97bd4}</Project>
      <Private>True</Private>
      <DoNotHarvest>True</DoNotHarvest>
      <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
      <RefTargetDir>INSTALLLOCATION</RefTargetDir>
    </ProjectReference>
  </ItemGroup>

My wxs looks like:

<Binary Id="TEST" SourceFile="$(var.Foo.Bar.TargetPath)"/>
like image 45
Christopher Painter Avatar answered Nov 15 '22 18:11

Christopher Painter