// ChecklistApp.cpp: implementation of the CChecklistApp class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ChecklistApp.h" #include "NightSecWizard.h" #include "FirstPage.h" #include "NormalPage.h" #include "DonePage.h" #include "AdvancedPage.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CChecklistApp::CChecklistApp() : CNightSecApp(_T("Night Security Checklist"), _T("NightSecurity.SecSetup.{2ED9B361-F6EF-11d2-A5A1-0020182B97FC}")) { } CChecklistApp::~CChecklistApp() { } bool CChecklistApp::InitInstance() { if(!CNightSecApp::InitInstance()) return false; // If more than one instance bail out early if(m_oneInstance.IsAlreadyLoaded()) { m_oneInstance.FindAndActivate(_T("#32770"), _T("Night Security Checklist")); return false; } // Create the Normal Wizard CNormalWizard wizNormal; // Add Normal Wizard Pages CFirstPage page1(&wizNormal, WIZPAGE_FIRST); CNormalPage page2(&wizNormal, WIZPAGE_MIDDLE); CDonePage page3(&wizNormal, WIZPAGE_LAST); wizNormal.AddPage(&page1); wizNormal.AddPage(&page2); wizNormal.AddExtraPages(); wizNormal.AddPage(&page3); // And Show it int nRet = wizNormal.DoModal(); // If Advanced Button was pressed if(nRet == IDC_ADVANCED) { // Create the Advanced Wizard CAdvancedWizard wizAdvanced; // Add advanced Wizard Pages CAdvancedPage pageAdv1(&wizAdvanced, COMPONENT_WIN, IDD_ADVWIZWIN, WIZPAGE_FIRST); CAdvancedPage pageAdv2(&wizAdvanced, COMPONENT_DOS, IDD_ADVWIZDOS, WIZPAGE_LAST); wizAdvanced.AddPage(&pageAdv1); wizAdvanced.AddPage(&pageAdv2); // And Show it nRet = wizAdvanced.DoModal(); } if(nRet == ID_WIZFINISH) { // Set flag so Secure Shutdown Program doesn't prompt m_settings.WriteInt("Is Setup", 1); // If Finish Button was pressed then save data g_aComponents.SaveComponentData(); } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return false; }