[wix-users] EditBox Control in HyperLinkTheme.xml
Stephen Downard
stephen.downard at medfusion.com
Thu Jun 2 10:21:26 PDT 2016
In regards to the spacing, the following was just a copy & paste formatting issue within the email and not an issue within the .wxs file.
<Variable Name=" LABELONE" Type="numeric" bal:Overridable="yes" Value="1" />
<Variable Name=" LABELTWO" Type="numeric" bal:Overridable="yes" Value="0"/>
<Variable Name=" MSG" Type="string" bal:Overridable="yes" Value="test test"/>
Also in repsonse to your suggestion, the existing comment within the code indicates that "hide" does not work. So, how would I assign a value of "disable" or "hide" to a variable within the .wxs file based upon installed state? How is WixBundleInstalled evaluated within .wxs?
WixStandardBootstrapApplication.cpp:
// Hide or disable controls based on the control name with 'State' appended
HRESULT hr = StrAllocFormatted(&sczControlName, L"%lsState", pControl->sczName);
if (SUCCEEDED(hr))
{
hr = BalGetStringVariable(sczControlName, &sczControlState);
if (SUCCEEDED(hr) && sczControlState && *sczControlState)
{
if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, sczControlState, -1, L"disable", -1))
{
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Disable control %ls", pControl->sczName);
ThemeControlEnable(m_pTheme, pControl->wId, FALSE);
}
else if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, sczControlState, -1, L"hide", -1))
{
BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Hide control %ls", pControl->sczName);
// TODO: This doesn't work
ThemeShowControl(m_pTheme, pControl->wId, SW_HIDE);
}
}
}
Suggested solution:
If (WixBundleInstalled) <--How is this formatted within wxs?
{
<Variable Name="EditBoxName1State" Type=" string" Value="hide" />
<Variable Name="EditBoxName2State" Type="string" Value=" hide "/>
<Variable Name="EditBoxName3State" Type="string" Value=" hide "/>
}
Thanks for the insight!
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Thursday, June 02, 2016 11:11 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] EditBox Control in HyperLinkTheme.xml
Sorry,
Still dealing with other things so I didn't have time to look at this fully... You really shouldn't have to do this. Your controls are properly assigned to the Page, so the call to ThemeShowPage(m_pTheme, dwOldPageId, SW_HIDE); in that same method should hide them. Is it just a formatting issue in your email where that both your control and variables start with spaces? Are you certain you haven't added anything else to the theme file? (With names like LabelOne/ LabelTwo, I have to ask.)
You could do this without customization if you created a few burn variables and assigned them a value of hide if you were already installed.
// Hide or disable controls based on the control name with 'State' appended
HRESULT hr = StrAllocFormatted(&sczControlName, L"%lsState", pControl->sczName);
...
else if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, sczControlState, -1, L"hide", -1))
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Stephen Downard
Sent: Thursday, June 02, 2016 9:25 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] EditBox Control in HyperLinkTheme.xml
I solved this issue by modifying the OnChangeState( ) method within WixStdBA with the following change. I used Spy to retrieve the Control ID value and then hardcoded it. Is there a better solution?
else if (m_rgdwPageIds[WIXSTDBA_PAGE_MODIFY] == dwNewPageId) {
ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_REPAIR_BUTTON, !m_fSuppressRepair);
ThemeControlEnable(m_pTheme, 266, FALSE);
ThemeControlEnable(m_pTheme, 268, FALSE);
ThemeControlEnable(m_pTheme, 270, FALSE); }
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Stephen Downard
Sent: Wednesday, June 01, 2016 4:15 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] EditBox Control in HyperLinkTheme.xml
Sorry I forgot to include the Bundle variables for your review.
<Variable Name=" LABELONE" Type="numeric" bal:Overridable="yes" Value="1" />
<Variable Name=" LABELTWO" Type="numeric" bal:Overridable="yes" Value="0"/>
<Variable Name=" MSG" Type="string" bal:Overridable="yes" Value="test test"/>
>>>>>>>>>>>>>>>>
The editboxes are detailed below and are not added to the Modify Page.
<Page Name="Install">
<Hypertext Name="EulaHyperlink" X="11" Y="121" Width="-11" Height="51" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallLicenseLinkText)</Hypertext>
<Checkbox Name="EulaAcceptCheckbox" X="-11" Y="-41" Width="260" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.InstallAcceptCheckbox)</Checkbox>
<Button Name="OptionsButton" X="-171" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.InstallOptionsButton)</Button>
<Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
<Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
<Text X="11" Y="-40" Width="246" Height="17" FontId="3">#(loc.InstallVersion)</Text>
<Text X="50" Y="-80" Width="100" Height="17" FontId="3" HideWhenDisabled="yes">Label One:</Text>
<Editbox X="130" Y="-80" Width="200" Height ="17" FontId="3" TabStop="yes" Visible="yes" Name=" LabelOne" HideWhenDisabled="yes">[LABELONE]</Editbox>
<Text X="50" Y="-110" Width="100" Height="17" FontId="3" HideWhenDisabled="yes">Label Two:</Text>
<Editbox X="130" Y="-110" Width="200" Height ="17" FontId="3" TabStop="yes" Visible="yes" Name=" LabelTwo" HideWhenDisabled="yes">[LABELTWO]</Editbox>
<Text X="50" Y="-140" Width="100" Height="17" FontId="3" HideWhenDisabled="yes">Message:</Text>
<Editbox X="130" Y="-140" Width="200" Height ="17" FontId="3" TabStop="yes" Visible="yes" Name="Message" HideWhenDisabled="yes">[MSG]</Editbox>
</Page>
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Hoover, Jacob
Sent: Wednesday, June 01, 2016 4:03 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] EditBox Control in HyperLinkTheme.xml
Would need a bit more info on how you customized it... If it was only within the <Page Name="Install"> area, it would expect it only visible during install.
-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Stephen Downard
Sent: Wednesday, June 01, 2016 2:58 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] EditBox Control in HyperLinkTheme.xml
Basically, the problem is that the controls are added to the Install Page but also show up on the Modify Page during uninstall. I only want the controls to display during initial installation.
>>>>>>>>>>>>>>>>
Using WixStdBA.dll and HyperLinkTheme, I have added editbox controls to query end-user input. How can I conditionally enable/disable the editbox controls based upon installed state?
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
More information about the wix-users
mailing list