From 28ef79b681f9b41f203f3176266ce48a31b435b7 Mon Sep 17 00:00:00 2001
From: Bob Arnson <bob@firegiant.com>
Date: Thu, 11 May 2023 22:57:46 -0400
Subject: Fix Dialog table decompilation.

Fix duplicate NoMinimize attribute and
add attributes that were entirely missing.

Fixes https://github.com/wixtoolset/issues/issues/7482.
---
 .../Decompile/Decompiler.cs                        |   3 ++-
 .../TestData/Decompile/ExpectedUI.wxs              |   3 +++
 .../TestData/Decompile/ui.msi                      | Bin 290816 -> 290816 bytes
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
index 9fda8248..183c319b 100644
--- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
+++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs
@@ -4246,13 +4246,14 @@ namespace WixToolset.Core.WindowsInstaller.Decompile
                     0 == (attributes & WindowsInstallerConstants.MsidbDialogAttributesVisible) ? new XAttribute("Hidden", "yes") : null,
                     0 == (attributes & WindowsInstallerConstants.MsidbDialogAttributesModal) ? new XAttribute("Modeless", "yes") : null,
                     0 == (attributes & WindowsInstallerConstants.MsidbDialogAttributesMinimize) ? new XAttribute("NoMinimize", "yes") : null,
-                    0 == (attributes & WindowsInstallerConstants.MsidbDialogAttributesMinimize) ? new XAttribute("NoMinimize", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesSysModal == (attributes & WindowsInstallerConstants.MsidbDialogAttributesSysModal) ? new XAttribute("SystemModal", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesKeepModeless == (attributes & WindowsInstallerConstants.MsidbDialogAttributesKeepModeless) ? new XAttribute("KeepModeless", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesTrackDiskSpace == (attributes & WindowsInstallerConstants.MsidbDialogAttributesTrackDiskSpace) ? new XAttribute("TrackDiskSpace", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesUseCustomPalette == (attributes & WindowsInstallerConstants.MsidbDialogAttributesUseCustomPalette) ? new XAttribute("CustomPalette", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesLeftScroll == (attributes & WindowsInstallerConstants.MsidbDialogAttributesLeftScroll) ? new XAttribute("LeftScroll", "yes") : null,
                     WindowsInstallerConstants.MsidbDialogAttributesError == (attributes & WindowsInstallerConstants.MsidbDialogAttributesError) ? new XAttribute("ErrorDialog", "yes") : null,
+                    WindowsInstallerConstants.MsidbDialogAttributesRightAligned == (attributes & WindowsInstallerConstants.MsidbDialogAttributesRightAligned) ? new XAttribute("RightAligned", "yes") : null,
+                    WindowsInstallerConstants.MsidbDialogAttributesRTLRO == (attributes & WindowsInstallerConstants.MsidbDialogAttributesRTLRO) ? new XAttribute("RightToLeft", "yes") : null,
                     !row.IsColumnNull(6) ? new XAttribute("Title", row.FieldAsString(6)) : null);
 
                 this.UIElement.Add(xDialog);
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ExpectedUI.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ExpectedUI.wxs
index 0526efc1..38aa2e7a 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ExpectedUI.wxs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ExpectedUI.wxs
@@ -478,6 +478,9 @@
         <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Text="{\WixUI_Font_Bigger}Welcome to the [ProductName] Setup Wizard" Transparent="yes" NoPrefix="yes" TabSkip="yes" />
         <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" Disabled="yes" TabSkip="yes" />
       </Dialog>
+      <Dialog Id="TrickyDlg" X="50" Y="50" Width="370" Height="270" NoMinimize="yes" RightAligned="yes" RightToLeft="yes" LeftScroll="yes" Title="Dialog with tricky style bits">
+        <Control Id="TrickyText" Type="Text" X="48" Y="15" Width="194" Height="30" Text="This is tricky." TabSkip="no" />
+      </Dialog>
       <RadioButtonGroup Property="WixUIRMOption">
         <RadioButton Value="UseRM" X="0" Y="0" Width="295" Height="16" Text="&amp;Close the applications and attempt to restart them." />
         <RadioButton Value="DontUseRM" X="0" Y="20" Width="295" Height="16" Text="&amp;Do not close applications. A reboot will be required." />
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ui.msi b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ui.msi
index 20395fb0..230cdb5d 100644
Binary files a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ui.msi and b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Decompile/ui.msi differ
-- 
cgit v1.2.3-55-g6feb