Value containing !(wix) variable is used before being resolved #5432

Open
mediawolf opened this Issue Nov 2, 2016 · 0 comments

Projects

None yet

2 participants

@mediawolf

WIX 3.10.3.3007

In my bundled installer, I have a fragment that defines a shared package:

    <WixVariable Id="SharedProductInstallerPath"
                 Value="\\NetworkShare\SharedProduct.msi"
                 Overridable="yes"
                 />
    <PackageGroup Id="SharedProduct">
        <MsiPackage SourceFile="!(wix.SharedProductInstallerPath)"
                    DisplayInternalUI="no"
                    Compressed="yes"
                    Cache="no"
                    Vital="yes"
                    Permanent="yes"
                    Visible="yes"
                    />
    </PackageGroup>

Installer builds successfully but it installation fails and log contains this entry:
[0F70:0808][2016-11-02T11:34:07]e000: Error 0x8007052e: Failed to open payload at path: \NetworkShare\SharedProduct.msi

BootstrapperApplicationData.xml contains this line:

I've looked at how WIX forms Name value if it's unspecified in wix3-develop\src\tools\wix\Compiler.cs:
private void CreatePayloadRow(...)
...
row[1] = String.IsNullOrEmpty(name) ? Path.GetFileName(sourceFile) : name
...
Obviously Path.GetFileName() assumes that unexpanded !(wix.SharedProductInstallerPath) represents a file name.
Workaround is to specify Name attribute explicitly which is a bit inconvenient and took time to figure out.

It would be nice if either:

  • (best) if unspecified values are automatically generated only after !(wix) variables are resolved
  • if compiler emits error (good) or warning (can be unnoticed) in cases, when value has to be automatically generated from other values containing unresolved variables
@barnson barnson added this to the v3.x milestone Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment