4

I have a wixproj that creates an MSI, with references to a csproj. This is being built on teamcity, with a number of build steps:

  • NuGet install
  • Build csproj (default targets)
  • Run signtool on built .exe
  • Build wixproj (default targets)
  • Run signtool on built .msi

The msi gets signed, but once installed, the .exe is not.

Investigating this, it turns out that running msbuild with the default targets on the wixproj rebuilds the exe, overwriting the signed one.

I tried changing the targets on the wixproj build step, but "Candle" is unknown, and "Compile" errors out with "Undefined preprocessor variable '$(var.App.TargetPath)'"

Morten Nilsen
  • 621
  • 7
  • 18
  • How are you running signtool to sign the built exe? Can you put this signing of the exe as a setp in the "AfterBuild" target? – Brian Sutherland Jul 07 '17 at 15:13
  • I have a build step that runs `%SdkPath%\signtool sign /a %WorkDir%\%Project%\bin\%Configuration%\%Executable%` I would rather avoid placing this in the project file, as it is only relevant to the build server, and not on a dev machine. – Morten Nilsen Jul 07 '17 at 16:44
  • I solve this problem by removing reference of csproj from wixproj file and use only file path in wix – Pavel Anikhouski Feb 15 '19 at 11:10
  • I've since this time redesigned build chains on our build server such that this is no longer an issue I am having. – Morten Nilsen Mar 04 '19 at 12:24

1 Answers1

1

I found a workaround for this thanks to Build MSBuild target without dependencies

Adding a command line option /p:BuildProjectReferences=false to the build step fixed my issue.

However, the build log now gives this notice:

MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead.

But as I cannot add that setting to all the build steps, that is not an option for me.

Morten Nilsen
  • 621
  • 7
  • 18