From 8b5505cd13367d48bce4ec8a6018e370ed3755b1 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Fri, 23 Oct 2020 17:32:44 -0400 Subject: Reorganize Product/Package to Package/SummaryInformation. --- .../Bind/BindSummaryInfoCommand.cs | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs index 6af2dc7a..a496c7ce 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindSummaryInfoCommand.cs @@ -46,9 +46,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.InstallerVersion = 0; this.ModularizationSuffix = null; - var foundCreateDataTime = false; + var foundCreateDateTime = false; var foundLastSaveDataTime = false; var foundCreatingApplication = false; + var foundPackageCode = false; var now = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture); foreach (var summaryInformationSymbol in this.Section.Symbols.OfType()) @@ -73,20 +74,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind break; case SummaryInformationType.PackageCode: // PID_REVNUMBER + foundPackageCode = true; var packageCode = summaryInformationSymbol.Value; if (SectionType.Module == this.Section.Type) { this.ModularizationSuffix = "." + packageCode.Substring(1, 36).Replace('-', '_'); } - else if ("*" == packageCode) - { - // set the revision number (package/patch code) if it should be automatically generated - summaryInformationSymbol.Value = Common.GenerateGuid(); - } break; case SummaryInformationType.Created: - foundCreateDataTime = true; + foundCreateDateTime = true; break; case SummaryInformationType.LastSaved: foundLastSaveDataTime = true; @@ -113,8 +110,18 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } + // set the revision number (package/patch code) if it should be automatically generated + if (!foundPackageCode) + { + this.Section.AddSymbol(new SummaryInformationSymbol(null) + { + PropertyId = SummaryInformationType.PackageCode, + Value = Common.GenerateGuid(), + }); + } + // add a summary information row for the create time/date property if its not already set - if (!foundCreateDataTime) + if (!foundCreateDateTime) { this.Section.AddSymbol(new SummaryInformationSymbol(null) { -- cgit v1.2.3-55-g6feb