summaryrefslogtreecommitdiff
path: root/Checklist/ChecklistApp.cpp
blob: 503dfceb1f390b80f92b6c19dd288cec67d83f72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// 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;
}