From: Rob on
I'm implementing a bootstrap program (setup.exe) for a new installer that
we're creating. Because of our requirements, we need to handle installation
of the program suite's prerequisites prior to launching the actual installer,
so we've come up with the idea of implementing some of the UI in the
bootstrap program.

What we need is to be able to implement a wizard-style property sheet
without the welcome or completion pages. (Because we're using C++/MFC 8,
we're implementing a mini-installer that would install the C++/MFC DLLs, if
necessary, before launching the bootstrap program, so that will contain the
Welcome and licence pages of the UI. That must appear to flow seamlessly into
the UI in the bootstrap program, which must appear to flow seamlessly into
the UI that is implemented in the main installer. Hence, no welcome or
completion pages in the wizard that we're implementing in the bootstrap.)

Most of the pages in the wizard will deal with installation of one of the
program suite's prerequisites, so if that is already installed, then we want
to skip that page. When the user clicks the 'Next' button in the last page
that will be shown, the wizard should close after the task for that page
(usually launching an installer for one of the prerequisites for our program
suite) is done. (I also need to be able to disable the Back button on most
pages and hide the Help button on all pages, but I've found info on how to do
that in another article.)
From: Pete Delgado on

"Rob" <Rob(a)discussions.microsoft.com> wrote in message
news:C2CBE963-C8C2-4D31-9155-67860B3356EB(a)microsoft.com...
> I'm implementing a bootstrap program (setup.exe) for a new installer that
> we're creating. Because of our requirements, we need to handle
> installation
> of the program suite's prerequisites prior to launching the actual
> installer,
> so we've come up with the idea of implementing some of the UI in the
> bootstrap program.

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.

>
> What we need is to be able to implement a wizard-style property sheet
> without the welcome or completion pages. (Because we're using C++/MFC 8,
> we're implementing a mini-installer that would install the C++/MFC DLLs,
> if
> necessary, before launching the bootstrap program, so that will contain
> the
> Welcome and licence pages of the UI. That must appear to flow seamlessly
> into
> the UI in the bootstrap program, which must appear to flow seamlessly into
> the UI that is implemented in the main installer. Hence, no welcome or
> completion pages in the wizard that we're implementing in the bootstrap.)
>
> Most of the pages in the wizard will deal with installation of one of the
> program suite's prerequisites, so if that is already installed, then we
> want
> to skip that page. When the user clicks the 'Next' button in the last page
> that will be shown, the wizard should close after the task for that page
> (usually launching an installer for one of the prerequisites for our
> program
> suite) is done. (I also need to be able to disable the Back button on most
> pages and hide the Help button on all pages, but I've found info on how to
> do
> that in another article.)

So what exactly is your question? You've given requirements, but have not
really asked a question!

-Pete


From: Rob on
"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? 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? (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.)

> 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.)?

I'm guessing that the Back button disabled automatically if all pages before
the current one are removed. Correct?
From: Pete Delgado on

"Rob" <Rob(a)discussions.microsoft.com> wrote in message
news:29DEE539-0BF7-48D4-8D55-126D4995D928(a)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


From: Rob on
> 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.
>
One of our prerequisites is SQL Server Express, which is packaged as an
executable.