Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Culture-specific TargetPath preprocessor variable no longer works in WiX v4 #7590

Open
doomlaur opened this issue Jul 5, 2023 · 2 comments
Labels
up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue"

Comments

@doomlaur
Copy link

doomlaur commented Jul 5, 2023

  • Which version of WiX are you building with?

4.0.1

  • Which version of Visual Studio are you building with (if any)?

Visual Studio Enterprise 2022 17.6.4

  • Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?

HeatWave for VS2022 1.0.1

  • Which version of .NET are you building with?

7.0.304

  • If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on?

(not relevant - issue happens at build time)

  • Describe the problem and the steps to reproduce it.

According to the WiX v3 documentation, it is possible to use a preprocessor variable like $(var.MyProject.en-US.TargetPath) to get the path to the localized build of a project. The same should be possible with WiX v4 according to the WiX v4 documentation.

However, I tried to migrate a WiX v3 project to v4 and started getting errors (more about that in a moment). The background: I have a project that creates an MSI and then uses a bundle to install the MSI and some other dependencies. Because for special requests we might still deliver an MSI without dependencies, we still offer the possibility to install using the standalone MSI, which also includes building it for both English (en-US) and German (de-DE). However, for most cases, we will simply deliver the bundle which does not show the UI of the MSI, so the language does not matter. Because of these reasons, our solution builds both English and German MSIs, then builds a bundle that uses the English version of the MSI. For that reason we're using the following in our bundle: <MsiPackage SourceFile="$(WixV4Test.en-US.TargetPath)">

To avoid unnecessary details I will explain the actual error using a new project:

  1. I created a new WiX v4 solution that contains an MSI project and a bundle.
  2. In addition to the already existing Package.en-us.wxl I added Package.de-de.wxl with Culture="de-DE".
  3. In the Bundle I used the following configuration:
<Chain>
  <MsiPackage SourceFile="$(WixV4Test.TargetPath)" Id="WixV4TestID" Vital="yes" Compressed="yes" Cache="keep">
    
  </MsiPackage>
</Chain>
  1. As expected, that did not work and produced the following error message: >C:\PROJECTS\WixV4Test\Bundle\Bundle.wxs(8): error WIX0103: Cannot find the WixBundlePayload file 'C:\PROJECTS\WixV4Test\WixV4Test\bin\x64\Debug\de-DE\WixV4Test.msi;C:\PROJECTS\WixV4Test\WixV4Test\bin\x64\Debug\en-US\WixV4Test.msi'. The following paths were checked: C:\PROJECTS\WixV4Test\WixV4Test\bin\x64\Debug\de-DE\WixV4Test.msi;C:\PROJECTS\WixV4Test\WixV4Test\bin\x64\Debug\en-US\WixV4Test.msi
  2. I then tried to change the preprocessor variable for SourceFile to $(WixV4Test.en-US.TargetPath). However, that produces the following error message: >C:\PROJECTS\WixV4Test\Bundle\Bundle.wxs(8): error WIX0150: Undefined preprocessor variable '$(WixV4Test.en-US.TargetPath)'.
  • Describe the behavior you expected and how it differed from the actual behavior.

The culture-specific TargetPath should work in WiX v4 just as it did with WiX v3.

@doomlaur doomlaur added the triage label Jul 5, 2023
@doomlaur
Copy link
Author

doomlaur commented Jul 6, 2023

Just in case anyone else has the same issue, here is a simple workaround until this issue is fixed: $(WixV4Test.TargetDir)\en-US\$(WixV4Test.TargetFileName)

@barnson barnson added up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue" and removed triage labels Jul 11, 2023
@Silver-Fang
Copy link

I don't even have TargetDir. I wonder if it's the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up for grabs No one volunteered to fix the issue. If you are interested, comment with "I want to fix this issue"
Projects
None yet
Development

No branches or pull requests

3 participants