I have created a simple Wix 3 Merge Module in VS 2005 ( .wxs )
<?xml version='1.0' encoding='UTF-8'?> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> <Module Id='TestMergeModule' Language='1033' Version='1.0.0.0'> <Package Id='ef2a568e-a8db-4213-a211-9261c26031aa' Manufacturer='Me' InstallerVersion='200' /> <Directory Id='TARGETDIR' Name='SourceDir'> <Directory Id='MergeRedirectFolder'> <Component Id='Test_ModuleComponent' Guid='{1081C5BC-106E-4b89-B14F-FFA71B0987E1}'> <File Id='Test' Name='$(var.Project.TargetFileName)' Source='$(var.Project.TargetPath)' DiskId='1' /> </Component> </Directory> </Directory> </Module> </Wix>
And I have added the project ‘Project’ as a reference to this Merge Module, however I continue to get this error
Error 7 Undefined preprocessor variable ‘$(var.Project.TargetFileName)’.
Any suggestions, I am sure I am just missing the obvious here.
Good practice dictates that you always assume this is your issue and it is not a bug, but after a lot of wasted time I though I would just check, and, it looks like it might be because this is not supported for C++ projects (which mine is )
From WIX3 bug report page
This is an open feature request.. but has been for a long time now it seems, so not sure if it will ever be fixed 🙁