Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Merge branch 'wixbug3643' of https://git01.codeplex.com/forks/seanhal…
Browse files Browse the repository at this point in the history
…l/working into wix40

Conflicts:
	History.md
	src/burn/engine/msiengine.cpp
	src/burn/engine/package.h
	src/tools/wix/ChainPackageInfo.cs
  • Loading branch information
robmen committed Mar 13, 2014
2 parents 147bfa8 + 48f8474 commit 0ccd3d5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* SeanHall: WIXBUG:3643 - Incorrect operation for detect-only package

* MikeGC: Add/tweak a few UDM manifests for settings engine

* MikeGC: In Settings Browser, display times in local time (instead of GMT), and in a more UI friendly format than RFC 3339
Expand Down
14 changes: 12 additions & 2 deletions src/burn/engine/msiengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ extern "C" HRESULT MsiEngineParsePackageFromXml(
hr = XmlGetYesNoAttribute(pixnMsiPackage, L"DisplayInternalUI", &pPackage->Msi.fDisplayInternalUI);
ExitOnFailure(hr, "Failed to get @DisplayInternalUI.");

// @UpgradeCode
hr = XmlGetAttributeEx(pixnMsiPackage, L"UpgradeCode", &pPackage->Msi.sczUpgradeCode);
if (E_NOTFOUND != hr)
{
ExitOnFailure(hr, "Failed to get @UpgradeCode.");
}

// select feature nodes
hr = XmlSelectNodes(pixnMsiPackage, L"MsiFeature", &pixnNodes);
ExitOnFailure(hr, "Failed to select feature nodes.");
Expand Down Expand Up @@ -319,6 +326,7 @@ extern "C" void MsiEnginePackageUninitialize(
)
{
ReleaseStr(pPackage->Msi.sczProductCode);
ReleaseStr(pPackage->Msi.sczUpgradeCode);

// free features
if (pPackage->Msi.rgFeatures)
Expand Down Expand Up @@ -554,7 +562,9 @@ extern "C" HRESULT MsiEngineDetectPackage(
{
relatedMsiOperation = BOOTSTRAPPER_RELATED_OPERATION_NONE;
}
else if (BOOTSTRAPPER_PACKAGE_STATE_ABSENT == pPackage->currentState)
// It can't be a downgrade if the upgrade codes aren't the same.
else if (BOOTSTRAPPER_PACKAGE_STATE_ABSENT == pPackage->currentState &&
pPackage->Msi.sczUpgradeCode && CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pPackage->Msi.sczUpgradeCode, -1, pRelatedMsi->sczUpgradeCode, -1))
{
relatedMsiOperation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE;
operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE;
Expand Down Expand Up @@ -997,7 +1007,7 @@ extern "C" HRESULT MsiEngineExecutePackage(
// add feature action properties
hr = ConcatFeatureActionProperties(pExecuteAction->msiPackage.pPackage, pExecuteAction->msiPackage.rgFeatures, &sczProperties);
ExitOnFailure(hr, "Failed to add feature action properties to argument string.");

hr = ConcatFeatureActionProperties(pExecuteAction->msiPackage.pPackage, pExecuteAction->msiPackage.rgFeatures, &sczObfuscatedProperties);
ExitOnFailure(hr, "Failed to add feature action properties to obfuscated argument string.");

Expand Down
1 change: 1 addition & 0 deletions src/burn/engine/package.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ typedef struct _BURN_PACKAGE
DWORD64 qwVersion;
DWORD64 qwInstalledVersion;
BOOL fDisplayInternalUI;
LPWSTR sczUpgradeCode;

BURN_MSIPROPERTY* rgProperties;
DWORD cProperties;
Expand Down
4 changes: 4 additions & 0 deletions src/tools/wix/Binder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4322,6 +4322,10 @@ private void CreateBurnManifest(string outputPath, WixBundleRow bundleInfo, WixB
writer.WriteAttributeString("Language", package.Language);
writer.WriteAttributeString("Version", package.Version);
writer.WriteAttributeString("DisplayInternalUI", package.DisplayInternalUI ? "yes" : "no");
if (!String.IsNullOrEmpty(package.UpgradeCode))
{
writer.WriteAttributeString("UpgradeCode", package.UpgradeCode);
}
}
else if (Compiler.ChainPackageType.Msp == package.ChainPackageType)
{
Expand Down
3 changes: 1 addition & 2 deletions src/tools/wix/ChainPackageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ private void ResolveMsiPackage(IBinderFileManager fileManager, IBinderCore core,
}

int attributes = record.GetInteger(5);
// when an Upgrade row has an upgrade code different than this package's upgrade code, don't count it as a possible downgrade to this package
related.OnlyDetect = ((attributes & MsiInterop.MsidbUpgradeAttributesOnlyDetect) == MsiInterop.MsidbUpgradeAttributesOnlyDetect) && this.UpgradeCode.Equals(related.Id, StringComparison.OrdinalIgnoreCase);
related.OnlyDetect = (attributes & MsiInterop.MsidbUpgradeAttributesOnlyDetect) == MsiInterop.MsidbUpgradeAttributesOnlyDetect;
related.MinInclusive = (attributes & MsiInterop.MsidbUpgradeAttributesVersionMinInclusive) == MsiInterop.MsidbUpgradeAttributesVersionMinInclusive;
related.MaxInclusive = (attributes & MsiInterop.MsidbUpgradeAttributesVersionMaxInclusive) == MsiInterop.MsidbUpgradeAttributesVersionMaxInclusive;
related.LangInclusive = (attributes & MsiInterop.MsidbUpgradeAttributesLanguagesExclusive) == 0;
Expand Down

0 comments on commit 0ccd3d5

Please sign in to comment.