0

I'm building my MSI project using Visual Studio 2010 and WiX. I'd like to automatically sign the release build upon successful compilation. (Note, not the Debug build though, to save on compilation time.)

So far, I added this "Post-build" event when 'Release' is selected in solution configuration:

enter image description here

Which translates into this command:

"D:\C++\My Project\MSI Installer\MyProject-Installer\..\..\..\CodeSigner.exe" "D:\C++\My Project\MSI Installer\MyProject-Installer\MyProject-Installer\bin\Release\MyProject-Installer.msi"

Well, the problem is that $(TargetPath) is not that. The actual path for the resulting MSI is this for US English build:

D:\C++\My Project\MSI Installer\MyProject-Installer\MyProject-Installer\bin\Release\en-us\MyProject-Installer.msi

Issue 1: You see the \en-us folder is somehow missing in what $(TargetPath) is filling out.

Issue 2: VS 2010 tries to run this post-build script for both Release and Debug. And I need it for Release only, like I was able to do with VS 2008.

So any idea how to fix these two issues?

c00000fd
  • 20,994
  • 29
  • 177
  • 400
  • For issue 2: See http://stackoverflow.com/questions/150053/how-to-run-visual-studio-post-build-events-for-debug-build-only. – bradfordrg Mar 20 '16 at 16:23

1 Answers1

0
if $(ConfigurationName) == Debug (
xcopy "$(ProjectDir)bin\Debug\Blobs.msi" "$(SolutionDir)debugDir" /Y /r
) ELSE (
 xcopy "$(ProjectDir)bin\Release\Blobs.msi" "$(SolutionDir)releaseDir" /Y /r
)
Chris Tanev
  • 208
  • 3
  • 16