Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ext/Bal/stdbas/Resources/HyperlinkLargeTheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<Text>#(loc.InstallOptionsButton)</Text>
<ChangePageAction Page="Options" />
</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.InstallInstallButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.InstallCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -74,8 +74,8 @@
<Page Name="Modify">
<Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
<Button Name="ModifyUpdateButton" X="11" Y="-11" Width="200" Height="23" TabStop="yes" FontId="0" EnableCondition="WixStdBAUpdateAvailable" HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.ModifyCancelButton)</Text>
<CloseWindowAction />
Expand Down
6 changes: 3 additions & 3 deletions src/ext/Bal/stdbas/Resources/HyperlinkSidebarTheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<Text>#(loc.InstallOptionsButton)</Text>
<ChangePageAction Page="Options" />
</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.InstallInstallButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.InstallCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -81,8 +81,8 @@
<ImageControl X="11" Y="11" Width="165" Height="400" ImageFile="logoside.png"/>
<Label X="185" Y="50" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
<Button Name="ModifyUpdateButton" X="11" Y="-11" Width="200" Height="23" TabStop="yes" FontId="0" EnableCondition="WixStdBAUpdateAvailable" HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.ModifyCancelButton)</Text>
<CloseWindowAction />
Expand Down
6 changes: 3 additions & 3 deletions src/ext/Bal/stdbas/Resources/HyperlinkTheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Text>#(loc.InstallOptionsButton)</Text>
<ChangePageAction Page="Options" />
</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.InstallInstallButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.InstallCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -68,8 +68,8 @@
<Page Name="Modify">
<Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
<Button Name="ModifyUpdateButton" X="11" Y="-11" Width="200" Height="23" TabStop="yes" FontId="0" EnableCondition="WixStdBAUpdateAvailable" HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.ModifyCancelButton)</Text>
<CloseWindowAction />
Expand Down
8 changes: 4 additions & 4 deletions src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<Text>#(loc.InstallOptionsButton)</Text>
<ChangePageAction Page="Options" />
</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.InstallInstallButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.InstallCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -70,8 +70,8 @@
<Page Name="Modify">
<Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
<Button Name="ModifyUpdateButton" X="11" Y="-11" Width="200" Height="23" TabStop="yes" FontId="0" EnableCondition="WixStdBAUpdateAvailable" HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.ModifyCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -118,6 +118,6 @@
<Text>#(loc.FailureCloseButton)</Text>
<CloseWindowAction />
</Button>
</Page>
</Page>
</Window>
</Theme>
6 changes: 3 additions & 3 deletions src/ext/Bal/stdbas/Resources/RtfTheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Text>#(loc.InstallOptionsButton)</Text>
<ChangePageAction Page="Options" />
</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.InstallInstallButton)</Button>
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.InstallCancelButton)</Text>
<CloseWindowAction />
Expand Down Expand Up @@ -68,8 +68,8 @@
<Page Name="Modify">
<Label X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ModifyHeader)</Label>
<Button Name="ModifyUpdateButton" X="11" Y="-11" Width="200" Height="23" TabStop="yes" FontId="0" EnableCondition="WixStdBAUpdateAvailable" HideWhenDisabled="yes">#(loc.UpdateButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ModifyUninstallButton)</Button>
<Button Name="RepairButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyRepairButton)</Button>
<Button Name="UninstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" ElevationShieldCondition='(WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3) AND WixStdBAScope = "PerMachine"'>#(loc.ModifyUninstallButton)</Button>
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.ModifyCancelButton)</Text>
<CloseWindowAction />
Expand Down
3 changes: 3 additions & 0 deletions src/libs/dutil/WixToolset.DUtil/inc/thmutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ typedef enum THEME_CONTROL_AUTOMATIC_BEHAVIOR_TYPE
THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE = 0x8,
// This has no effect on editboxes since their text is their value.
THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT = 0x10,
THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ELEVATION_SHIELD = 0x20,
} THEME_CONTROL_AUTOMATIC_BEHAVIOR_TYPE;

typedef enum THEME_CONTROL_TYPE
Expand Down Expand Up @@ -238,12 +239,14 @@ typedef struct _THEME_CONTROL

LPWSTR sczEnableCondition;
LPWSTR sczVisibleCondition;
LPWSTR sczElevationShieldCondition;

BOOL fAutomaticEnabled;
BOOL fAutomaticVisible;
BOOL fAutomaticAction;
BOOL fAutomaticValue;
BOOL fAutomaticText;
BOOL fAutomaticElevationShield;

union
{
Expand Down
15 changes: 15 additions & 0 deletions src/libs/dutil/WixToolset.DUtil/thmutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3538,6 +3538,9 @@ static HRESULT ParseControl(
}
else if (THEME_CONTROL_TYPE_HYPERLINK == pControl->type || THEME_CONTROL_TYPE_BUTTON == pControl->type)
{
hr = XmlGetAttributeEx(pixn, L"ElevationShieldCondition", &pControl->sczElevationShieldCondition);
ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' ElevationShieldCondition attribute.", pControl->sczName);

hr = GetAttributeFontId(pTheme, pixn, L"HoverFontId", &pControl->dwFontHoverId);
ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control '%ls' HoverFontId attribute.", pControl->sczName);

Expand Down Expand Up @@ -4826,6 +4829,7 @@ static void FreeControl(
ReleaseStr(pControl->sczNote);
ReleaseStr(pControl->sczEnableCondition);
ReleaseStr(pControl->sczVisibleCondition);
ReleaseStr(pControl->sczElevationShieldCondition);
ReleaseStr(pControl->sczValue);
ReleaseStr(pControl->sczVariable);

Expand Down Expand Up @@ -5625,6 +5629,7 @@ static HRESULT ShowControl(

BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED);
BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN);
BOOL fShield = FALSE;

if (pTheme->pfnEvaluateCondition)
{
Expand All @@ -5641,6 +5646,13 @@ static HRESULT ShowControl(
hr = pTheme->pfnEvaluateCondition(pControl->sczEnableCondition, &fEnabled, pTheme->pvVariableContext);
ThmExitOnFailure(hr, "Failed to evaluate EnableCondition: %ls", pControl->sczEnableCondition);
}

// If the control has an ElevationShieldCondition, check if it's true.
if (pControl->sczElevationShieldCondition && pControl->fAutomaticElevationShield)
{
hr = pTheme->pfnEvaluateCondition(pControl->sczElevationShieldCondition, &fShield, pTheme->pvVariableContext);
ThmExitOnFailure(hr, "Failed to evaluate ElevationShieldCondition: %ls", pControl->sczElevationShieldCondition);
}
}

// Try to format each control's text based on context, except for editboxes since their text comes from the user.
Expand Down Expand Up @@ -5816,6 +5828,8 @@ static HRESULT ShowControl(
}
}

ThemeControlElevates(pControl, fShield);

if (!fVisible || (!fEnabled && (pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDE_WHEN_DISABLED)))
{
::ShowWindow(hWnd, SW_HIDE);
Expand Down Expand Up @@ -6283,6 +6297,7 @@ static HRESULT LoadControls(
pControl->fAutomaticAction = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ACTION & dwAutomaticBehaviorType);
pControl->fAutomaticText = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_TEXT & dwAutomaticBehaviorType);
pControl->fAutomaticValue = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_VALUE & dwAutomaticBehaviorType);
pControl->fAutomaticElevationShield = THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ELEVATION_SHIELD != (THEME_CONTROL_AUTOMATIC_BEHAVIOR_EXCLUDE_ELEVATION_SHIELD & dwAutomaticBehaviorType);

// This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range.
if (THEME_FIRST_AUTO_ASSIGN_CONTROL_ID <= wControlId && THEME_FIRST_ASSIGN_CONTROL_ID > wControlId)
Expand Down
7 changes: 6 additions & 1 deletion src/xsd/thmutil/Button.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
</choice>
<attributeGroup ref="CommonControlAttributes" />
<attributeGroup ref="OwnerDrawImageAttributes" />
<attribute name="ElevationShieldCondition" type="xs:string">
<annotation>
<documentation>A condition that determines if the control gets a UAC elevation shield icon. If this condition is true, then the control gets a UAC elevation shield icon.</documentation>
</annotation>
</attribute>
<attribute name="FontId" type="xs:string">
<annotation>
<documentation>Identifier to the Font element that serves as the font for the control. Only valid when using graphic buttons.</documentation>
Expand All @@ -53,4 +58,4 @@
</annotation>
</attribute>
</complexType>
</element>
</element>
7 changes: 6 additions & 1 deletion src/xsd/thmutil/CommandLink.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<element ref="Text" />
</choice>
<attributeGroup ref="CommonControlAttributes" />
<attribute name="ElevationShieldCondition" type="xs:string">
<annotation>
<documentation>A condition that determines if the control gets a UAC elevation shield icon. If this condition is true, then the control gets a UAC elevation shield icon.</documentation>
</annotation>
</attribute>
<attribute name="FontId" type="xs:string">
<annotation>
<documentation>Identifier to the Font element that serves as the font for the control. Only valid when using graphic buttons.</documentation>
Expand Down Expand Up @@ -68,4 +73,4 @@
</annotation>
</attribute>
</complexType>
</element>
</element>
Loading