[wix-users] WiX Error Determining Previous Package Version

Jon Earle earlej at hotmail.com
Thu Sep 22 09:26:00 PDT 2016


Running into an issue with version numbers.

We used to use Installshield for our client installer.  Since switching to WiX, we've "fixed" a few things such as the version numbering scheme.  We used to use x.x.x-y, but WiX does not allow the "-" to be part of the version #.

When I try to update an older installed product using the "dashed" version #, the installation stops (before it even gets going) with:

    [09A4:1908][2016-09-20T09:20:34]e000: Error 0x80070057: Failed to convert version: 5.3.0-7 to DWORD64 for ProductCode: {...}
    [09A4:1908][2016-09-20T09:20:34]e151: Detect failed for package: Client_MSI, error: 0x80070057

The error appears to cause the engine to not trigger OnDetectMsiFeature, however, the engine does -somehow- appear to know, somehow, about the features:

    [09A4:1908][2016-09-20T09:20:34]i000: WixWPF: Enter Method: OnDetectPackageComplete
    [09A4:1908][2016-09-20T09:20:34]i000: WixWPF: Leaving Method: OnDetectPackageComplete
    [09A4:1908][2016-09-20T09:20:34]i101: Detected package: NetFx40Web, state: Present, cached: None
    [09A4:1908][2016-09-20T09:20:34]i101: Detected package: vcredist2015x64, state: Present, cached: Complete
    [09A4:1908][2016-09-20T09:20:34]i101: Detected package: vcredist2015x86, state: Present, cached: None
    [09A4:1908][2016-09-20T09:20:34]i101: Detected package: Client_MSI, state: Unknown, cached: None
    [09A4:1908][2016-09-20T09:20:34]i104: Detected package: Client_MSI, feature: FeatureA, state: Unknown
    [09A4:1908][2016-09-20T09:20:34]i104: Detected package: Client_MSI, feature: FeatureB, state: Unknown
    ...
    [09A4:1908][2016-09-20T09:20:34]i000: WixWPF: Enter Method: OnDetectComplete

I tracked the problem with the version numbers to dutil\fileutil.cpp.  I changed the check on line 444 to:

    while (wzPartEnd < wzEnd && ((L'.' != *wzPartEnd)
                             &&  (L'-' != *wzPartEnd)))

soas to accept the '-' as a version separator.  Now, the new bootstrapper loads, but is having problems with state detection.  While it "sees" the package and features, it sees all of them as "Absent".

    [0280:1050][2016-09-20T12:36:05]i103: Detected related package: {...}, scope: PerMachine, version: 5.3.0.7, language: 0 operation: MajorUpgrade
    [0280:1050][2016-09-20T12:36:05]i000: WixWPF: Enter Method: OnDetectRelatedMsiPackage
    [0280:1050][2016-09-20T12:36:05]i000: WixWPF: Leaving Method: OnDetectRelatedMsiPackage
    [0280:1050][2016-09-20T12:36:05]i000: WixWPF: Enter Method: OnDetectMsiFeature
    [0280:1050][2016-09-20T12:40:42]i000: WixWPF: Leaving Method: OnDetectMsiFeature
    ...
    [0280:1050][2016-09-20T12:41:04]i000: WixWPF: Enter Method: OnDetectPackageComplete
    [0280:1050][2016-09-20T12:41:07]i000: WixWPF: Leaving Method: OnDetectPackageComplete
    [0280:1050][2016-09-20T12:41:07]i101: Detected package: NetFx40Web, state: Present, cached: None
    [0280:1050][2016-09-20T12:41:07]i101: Detected package: vcredist2015x64, state: Present, cached: Complete
    [0280:1050][2016-09-20T12:41:07]i101: Detected package: vcredist2015x86, state: Present, cached: None
    [0280:1050][2016-09-20T12:41:07]i101: Detected package: Client_MSI, state: Absent, cached: None
    [0280:1050][2016-09-20T12:41:07]i104: Detected package: Client_MSI, feature: LunaClient, state: Absent
    [0280:1050][2016-09-20T12:41:07]i104: Detected package: Client_MSI, feature: FeatureB, state: Absent

Related... I would up having to change the MajorUpgrade tag to:

<MajorUpgrade AllowDowngrades="yes" />

Since, a lower numbered "dashed" version winds up having a larger value in the registry than a higher numbered "dotted" version (eg. 5.2.1-1 has a larger Version key value than 8.3.0.34), which causes the installer to think that I am installing an older version of the software.  Of course, now a user can install an older version of the software (the msi-only version, not the updated bootstrapper version) and leading to a mixed bag of trouble as a result.

So, I would like to ask:

 1. Why is the old package and the selected list of features all marked as Absent and how do I recover from this?

 2.  Is it possible, somehow, to "fix" the existing version # in the registry, before the installer gets so far along that it detects what it believes to be a downgrade?


More information about the wix-users mailing list