سؤال

I wrote up a quick WiX preprocessor extension to grab some product version information from a file we keep in our root folder.

I'd like to keep this extension in the same solution as our WiX setup project, because it's easier to maintain. But the problem is that when testing, we use a Debug configuration, and when releasing a build, we switch to Release. This means that I have two extensions to deal with.

How would I tell WiX to grab one depending on the current configuration?

I've been looking at the reference paths in the WiX project's properties, and added "..\MyWiXExtensions\bin\$(Configuration)\" as a folder, hoping that it would pick up the MSBuild property, but that doesn't seem to work.

I've also looked at the build events. I could copy the output dll to my setup project's folder, but wouldn't that break references if I clean my solution?

I'm using WiX 3.7 and Visual Studio 2012.

هل كانت مفيدة؟

المحلول

I ended up using a post-build event on my extension that would copy the output to my wixproj's folder.

I just have to build my wixproj separately from the rest of the solution to prevent file locking issues when overwriting the dll. If file locking does come up, I just have to close VS and reopen the solution.

As a side note, referencing the project itself instead of the dll could be a nice feature to have in Votive.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top