I’ve got a WiX installer project which uses MSBuild to generate the MSI file. The WXS file includes the WiX firewall extension:
xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension"
I’ve defined two cultures in the MSBuild file with the following definition:
<PropertyGroup>
...
<Cultures>en-us;no-no</Cultures>
</PropertyGroup>
I’ve also added the translated resources:
<ItemGroup>
<EmbeddedResource Include="lang\Firewall_no-no.wxl" />
<EmbeddedResource Include="lang\WixUI_no-no.wxl" />
</ItemGroup>
These represents translation to Norwegian for the Firewall extension and the WixUI extension. When I run the build it succeeds with the en-us part, but the no-no part fails with the following error messages:
C:\delivery\Dev\wix30_public\src\ext\FirewallExtension\wixlib\FirewallExtension.wxs(19):
error LGHT0102: The localization variable !(loc.WixSchedFirewallExceptionsInstall)
is unknown. Please ensure the variable is defined.
....
Couple of issues: I don’t know where the C:\delivery directory comes from. I don’t have such a directory. The localization variables referenced in the error message have been translated in the Firewall_no-no.wxl file.
When I run MSBuild with more detailed information I see the following output right before the error message:
Task "Light"
Command:
C:\Program Files (x86)\Windows Installer XML v3\bin\Light.exe -cultures:no-no
-ext "C:\Program Files (x86)\Windows Installer XML v3\bin\WixUIExtension.dll"
-ext "C:\Program Files (x86)\Windows I nstaller XML v3\bin\WixUtilExtension.dll"
-ext "C:\Program Files (x86)\Windows Installer XML v3\bin\WixFirewallExtension.dll"
-loc lang\Firewall_no-no.wxl -loc lang\WixUI_no-no.wxl
-out F:\Projects\MyProd\MyProj\Installer\bin\Debug\no-no\MyInstaller.msi
-pdbout F:\Projects\MyProd\MyProj\Installer\bin\Debug\no-no\MyInstaller.wixpdb
obj\Debug\MyProj.wixobj
As the details show, the MSBuild task results in having two -loc parameters to the Light executable. Not sure if that would be the reason for this problem. Any ideas on how to solve this?
It seems that the reason for this error was very simple. I got the exception because I hadn’t changed the
Culture="no-no"attribute in theWixLocalizationtag. Setting this value made the errors disappear.