Re: Wizard property sheet questions
"Rob" <Rob@discussions.microsoft.com> wrote in message
news:29DEE539-0BF7-48D4-8D55-126D4995D928@microsoft.com...
"Pete Delgado" wrote:
Microsoft has made the VS boostrap utility available for use. See:
http://msdn.microsoft.com/msdnmag/issues/04/10/Bootstrapper/
This may or may not fulfil your requirements or a portion of them.
This fulfills some of my requirements. Because our installer is for a
suite
of programs, the required prerequisites depend on what the user wants to
install, so one of the wizard pages is the feature selection dialogue for
the
suite. Also, we would prefer not to have to ask the user which
prerequisites
to install, but rather, have them installed automatically based on which
ones
are needed for the part(s) of the suite that are to be installed. Further,
one of the prerequisites for most parts of the suite is that a security
key
is attached to the computer. We want the bootstrap to be able to check for
that after it checks that its driver is installed. Would that be possible
to
implement?
It may be possible, but it depends upon the driver that you intend to
install. In addition, if your product is intended to run on Windows Vista
you should ensure that you insert a manifest that indicates that the
executable must run underneath administrative credentials in order to allow
you to install and query your driver.
Here is some information that may help you to determine if your driver will
require a reboot of Windows:
http://www.microsoft.com/whdc/system/pnppwr/pnp/no_reboot.mspx
Would I be able to implement the first few pages (i.e., welcome
page, license page and feature selection page) of my install wizard in the
bootstrap using this utility?
I have not used the utility because the products for which I write the
application installers require third-party software that doesn't play well
with the Visual Studio utility and give a poor user experience.
Consequently, I don't know of the full capabilities of the utility, only
that it exists and what I read in the article when it was published.
(If so, then my property sheet questions
probably become moot. If not, then I'll need to know how to determine when
a
prerequisite's install needs a reboot without actually letting that
install
do the reboot in case more than one prerequisite needs a reboot.)
If your prerequisites are packaged as MSI files, then the logic within the
MSI file will determine whether a reboot is needed. You can use
MsiSetExternalUI and trap the messages to determine the requirements of the
software at run-time and control the installation of the package with your
wizard.
So what exactly is your question? You've given requirements, but have
not
really asked a question!
My question is, how do I do the things that I want to do in the property
sheet (i.e., don't show the welcome page, make the 'Next' button on the
last
page act like a Finish button, etc.)?
To not show a welcome page, just don't create one! In order to create a
Welcome or Finish page (using the Wizard 97 spec) you have to add the
following to the CPropertyPage constructor:
CWelcomePage::CWelcomePage(): CPropertyPage(CWelcomePage::IDD,
IDS_APP_TITLE)
{
m_psp.dwFlags |= PSP_HIDEHEADER;
}
What the above code does is simply create what is known as an "exterior
page". If you do not change the flags of the property page, then the page
automatically becomes an "interior page".
To set the "Finish" button you should do the following in your OnSetActive
handler for the final CPropertyPage:
CPropertySheet* pSheet = (CPropertySheet*)GetParent();
ASSERT_KINDOF(CPropertySheet, pSheet);
pSheet->SetFinishText (_T("Finish"));
pSheet->SetWizardButtons(PSWIZB_FINISH);
Please note that in order to allow for localization you should be loading a
resource string for the text of your finish button.
To enable or disable specific buttons use SetWizardButtons from the
OnSetActive handler in each CPropertyPage:
Example: (Enables the Next button only):
CPropertySheet* pSheet = (CPropertySheet*)GetParent();
ASSERT_KINDOF(CPropertySheet, pSheet);
pSheet->SetWizardButtons(PSWIZB_NEXT);
Example: (Enables the Next and Back buttons):
CPropertySheet* pSheet = (CPropertySheet*)GetParent();
ASSERT_KINDOF(CPropertySheet, pSheet);
pSheet->SetWizardButtons( PSWIZB_BACK | PSWIZB_NEXT );
I'm guessing that the Back button disabled automatically if all pages
before
the current one are removed. Correct?
No. It is not automatically disabled. It just doesn't do anything when
clicked!
-Pete