Remove the Options page...

Jun 20, 2013 at 4:24 PM
Edited Jun 20, 2013 at 4:25 PM
I've been playing with the idea of removing the Options page...

I've moved the install folder editboxes from Options to Install in the theme xml, and added the get/set of Installfolder and Installfolder2 to wixextba..

Can this be included in the extension?

Thanks,
Coordinator
Jun 20, 2013 at 7:01 PM
Why would you want to remove it, it can be disabled with the SuppressOptionsUI attribute.
Jun 20, 2013 at 10:26 PM
I want to disable it (forgot about SuppressOptionsUI) but want to still allow the install folder edit box...

So I think I still need to modify wixextba to get/set the values...
Coordinator
Jun 21, 2013 at 10:29 AM
I think it would be fairly easy to add the textboxes to install page, I haven't really looked at it.
Apr 8, 2014 at 11:32 AM
Hi rowbot,

I am trying to do the same thing as you. But when i changed the location of installfolder Editbox, my bootstrapper doesn't take into account the value that i set on it.
How did you do to make it work??

Thanks in advance,
Coordinator
Apr 8, 2014 at 12:03 PM
You would need to modify WixStandardBootstrapperApplication.cpp so that it reads the value when from the main page instead of the option page. This is the code: HRESULT hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER, &sczUnformattedText);
Apr 8, 2014 at 4:48 PM
Indeed..
                    HRESULT hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX, sczText);
                    }

                    hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER2, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX2, sczText);
                    }
Jul 21, 2014 at 4:03 PM
Edited Jul 21, 2014 at 4:13 PM
First of all thank you for the fast reply. I didn't receive notifications that you responded me and put the issue on standby for a while.

I tried the suggested solution, but it still doesn't work.

I never coded on C++, so i m guessing that i am compiling the wrong projects.

I edited WixStandardBootstrapperApplication.cpp file and added the code above in the part of install page.
like this :
 // Enable disable controls per-page.
                if (m_rgdwPageIds[WIXSTDBA_PAGE_INSTALL] == dwNewPageId) // on the "Install" page, ensure the install button is enabled/disabled correctly.
                {
                    // If the EULA control exists, show it only if a license URL is provided as well.
                    if (ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_EULA_LINK))
                    {
                        BOOL fEulaLink = (m_sczLicenseUrl && *m_sczLicenseUrl);
                        ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_EULA_LINK, fEulaLink);
                        ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX, fEulaLink);
                    }

                      HRESULT hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX, sczText);
                    }

                    hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER2, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX2, sczText);
                    }
                    BOOL fAcceptedLicense = !ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX) || !ThemeControlEnabled(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX) || ThemeIsControlChecked(m_pTheme, WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX);
                    ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_INSTALL_BUTTON, fAcceptedLicense);

                    // If there is an "Options" page, the "Options" button exists, and it hasn't been suppressed, then enable the button.
                    BOOL fOptionsEnabled = m_rgdwPageIds[WIXSTDBA_PAGE_OPTIONS] && ThemeControlExists(m_pTheme, WIXSTDBA_CONTROL_OPTIONS_BUTTON) && !m_fSuppressOptionsUI;
                    ThemeControlEnable(m_pTheme, WIXSTDBA_CONTROL_OPTIONS_BUTTON, fOptionsEnabled);
               
                }
                else if (m_rgdwPageIds[WIXSTDBA_PAGE_OPTIONS] == dwNewPageId)
                {
                    HRESULT hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX, sczText);
                    }

                    hr = BalGetStringVariable(WIXSTDBA_VARIABLE_INSTALL_FOLDER2, &sczUnformattedText);
                    if (SUCCEEDED(hr))
                    {
                        BalFormatString(sczUnformattedText, &sczText);
                        ThemeSetTextControl(m_pTheme, WIXSTDBA_CONTROL_FOLDER_EDITBOX2, sczText);
                    }
                }
I compiled the solution (after adding link to MSImsg32.lib to resolve compilation error), tried to reference wixextba.dll in my wix project, then i realised i should reference WixBalExtensionExt.dll, but it doesn't work. I even think that my changes are not taken into account :/


Can you tell me what i am missing?
Jul 22, 2014 at 11:44 AM
I don't remember having to link in MSImsg32.lib...

You need to build the solution and pick up bafunctions.dll and include the following in your bundle.wxs:
    <Payload Name="bafunctions.dll" Compressed="yes" SourceFile="$(var.SolutionDir)bafunctions.dll" />
If you're new to C++, I would suggest putting in some BalLog calls or MessageBox'es so you check code paths etc... (instead of trying to attach/debug)
Coordinator
Jul 22, 2014 at 11:54 AM
Shouldn't need to include bafunctions.dll to get this to work.

As rowbot suggested I think you need some logs calls or message boxes.
Jul 22, 2014 at 2:00 PM
Shouldn't need to include bafunctions.dll to get this to work.
We're using WiX 3.7 so I think I do...
Coordinator
Jul 22, 2014 at 3:04 PM
That doesn't matter this is a change to the WixBalExtensionExt.dll so independent of bafunctions.dll.
Jul 22, 2014 at 3:16 PM
Apologies, indeed it is - not looked at this stuff for a while.

HendR, you will need to "debug"..
Jul 22, 2014 at 4:42 PM
Edited Jul 22, 2014 at 4:48 PM
Good News.

I finally found what was missing after some debug.
I just figured out that when the user clicks on install button, it doesn't take into account the new value of install folder.
Whereas, when option page is displayed it retrieves this value when the OK button is clicked.
So I just added a call to OnClickOptionsOkButton() at the end of OnClickInstallButton().

And now it works like a charm.

Thanks for both of you.
And hope it will help other people.
Coordinator
Jul 22, 2014 at 4:49 PM
Of course, I now remember having to do that for the checkboxs on the main page. Glad you got it sorted.