1
votes

I'm using Win10 64bit OS, with Wix3.11RC Toolset installed. My VS2017 have created a Wix v3 installer Project. Our team is using TeamCity9.1 as the CI tool.

Now I want to make the Build Agent in TeamCity to support wixproj build without touch CI server settings(I don't have privilege ). I basically follow some tutorials to checked in all necessary Wix build files(the wix Bin folder, and the wix.targets ) which is put in a relative path to the source code, now I'm blocked with the path issue in editing .wixproj file, the official doc said: http://wixtoolset.org/documentation/manual/v3/msbuild/daily_builds.html

<PropertyGroup>
      <WixToolPath>$(SourceCodeControlRoot)\wix\[[Version]]\</WixToolPath>
      <WixTargetsPath>$(WixToolPath)Wix.targets</WixTargetsPath>
      <WixTasksPath>$(WixToolPath)wixtasks.dll</WixTasksPath>
</PropertyGroup>

And this is mine:

  <PropertyGroup>
      <WixToolPath>..\..\wix\3.11\</WixToolPath>
      <WixTargetsPath>$(WixToolPath)targetsFile\v3.x\wix.targets</WixTargetsPath>
      <WixTasksPath>$(WixToolPath)wixtasks.dll</WixTasksPath>
  </PropertyGroup>

The reason I'm using the relative path for WixToolPath is the $(SourceCodeControlRoot) was resolved as D:\ here, but actually the source code will be checked out by CI server and put under a random folder like D:\ABC\f14c7929aa63f1fc. By my configuration, the local build even can't go through, the build error indicates the WixTasksPath had been resolved to a non-existed path: C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\..\..\wix\3.11\wixtasks.dll

So how can I achieve? thanks!

2
This issue has been marked as documentation bug on the GitHub: github.com/wixtoolset/issues/issues/1911. unfortunately, there is no any update about this issue.Leo Liu-MSFT

2 Answers

0
votes

One of the approaches you can try is to change the path in the file to the absolute path using TeamCity-provided references before invoking the tool. In TeamCity settings you can reference the checkout directory path as %system.teamcity.build.checkoutDir% or use ${teamcity.build.checkoutDir} within MSBuild step if run as MSBuild build step. You can do the replacement in the first build step or just use TeamCity file content replacer to change the old value to new one.

0
votes

just use

<WixTasksPath>wixtasks.dll</WixTasksPath>

this worked for me.