Prev: Creating a range out of a scattered cells with MFC Excel automation
Next: Dll has no DllMain or CWinApp?
From: Amarandei on 3 Feb 2010 10:01 http://msdn.microsoft.com/en-us/library/37k4h0bh%28VS.80%29.aspx Tom Serface wrote: I think you will find that a better long term solution anyway. 26-Jun-07 I think you will find that a better long term solution anyway. I hope it works out for you. Tom Previous Posts In This Thread: On Tuesday, June 19, 2007 3:06 PM Ro wrote: Wizard property sheet questions 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.) On Tuesday, June 19, 2007 3:16 PM Pete Delgado wrote: Re: Wizard property sheet questions "Rob" <Rob(a)discussions.microsoft.com> wrote in message news:C2CBE963-C8C2-4D31-9155-67860B3356EB(a)microsoft.com... 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. So what exactly is your question? You've given requirements, but have not really asked a question! -Pete On Tuesday, June 19, 2007 4:00 PM Ro wrote: Re: Wizard property sheet questions "Pete Delgado" wrote: 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.) 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? On Tuesday, June 19, 2007 5:27 PM Pete Delgado wrote: Re: Wizard property sheet questions "Rob" <Rob(a)discussions.microsoft.com> wrote in message news:29DEE539-0BF7-48D4-8D55-126D4995D928(a)microsoft.com... 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 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 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. 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 ); No. It is not automatically disabled. It just doesn't do anything when clicked! -Pete On Tuesday, June 19, 2007 10:11 PM Ro wrote: One of our prerequisites is SQL Server Express, which is packaged as an One of our prerequisites is SQL Server Express, which is packaged as an executable. On Tuesday, June 19, 2007 11:15 PM Pete Delgado wrote: Re: Wizard property sheet questions Run the executable on a clean system. You will find that it is simply a self-extracting archive that houses the MSI files. -Pete On Wednesday, June 20, 2007 1:29 AM Pete Delgado wrote: Re: Wizard property sheet questions http://www.devx.com/dbzone/Article/31648 The above article may help you... -Pete On Monday, June 25, 2007 6:16 PM Ro wrote: Is there any way to show the Finish button and hide only the Next button? Is there any way to show the Finish button and hide only the Next button? I want to leave the Back button showing, but CPropertySheet::SetFinishText() hides the Back button as well as the Next button. Also, how do I get access to the 'Next' button so that I can get its text? (My wizard, implemented in the bootstrap program of an installer, is supposed to be the first few pages of the installer wizard. The install that gets launched after the last page of the portion in code is meant to carry on the wizard where the bootstrap left off, so it would make sense for the text on the 'Finish' button to be the same as on the 'Next' button to keep the illusion intact.) On Tuesday, June 26, 2007 11:20 AM Tom Serface wrote: Re: Wizard property sheet questions Hi Rob, You could just call: pSheet->SetWizardButtons( PSWIZB_BACK | PSWIZB_FINISH ); if you don't need to actually change the text. You could try calling GetDlgItem(ID_WIZNEXT) to get the window for the Next button. Then you could get or set the text on the button. Tom "Rob" <Rob(a)discussions.microsoft.com> wrote in message news:8B5B0D31-5EEA-4231-A415-7F77C22113B5(a)microsoft.com... On Tuesday, June 26, 2007 1:14 PM Ro wrote: Re: Wizard property sheet questions "Tom Serface" wrote: The problem is that, with the last page not having a Finish button, the wizard doesn't exit the way it should. (In fact, it doesn't exit at all unless the user clicks Cancel.) What would be helpful is to have a way for the last Next button to behave as though it's the Finish button. With the info that you gave, I guess it's possible to just hide the Next button, show the Finish button and copy the text from the former to the latter. No big deal, though. Concerns regarding look and feel consistency between the wizard in the bootstrap program and the one in the main install have forced us to rethink things and go with a wizard that has the exterior pages in the bootstrap, so we're not going to be doing the crazy stuff any more. On Tuesday, June 26, 2007 5:19 PM Tom Serface wrote: I think you will find that a better long term solution anyway. I think you will find that a better long term solution anyway. I hope it works out for you. Tom Submitted via EggHeadCafe - Software Developer Portal of Choice Visual Studio 2005: Cool Debugging Tricks http://www.eggheadcafe.com/tutorials/aspnet/1e7daccd-ed00-4a35-a2ed-92fb0ad72bec/visual-studio-2005-cool.aspx |