Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

464 lines
12 KiB

  1. // FinalInstalledPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CertWiz.h"
  5. #include "FinalPages.h"
  6. #include "Certificat.h"
  7. #include "Certutil.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CFinalInstalledPage property page
  15. IMPLEMENT_DYNCREATE(CFinalInstalledPage, CIISWizardBookEnd2)
  16. CFinalInstalledPage::CFinalInstalledPage(HRESULT * phResult, CCertificate * pCert)
  17. : CIISWizardBookEnd2(phResult,
  18. USE_DEFAULT_CAPTION,
  19. IDS_INSTALL_CERT_FAILURE_HEADER,
  20. IDS_CERTWIZ,
  21. &m_idBodyText,
  22. NULL,
  23. &pCert->m_idErrorText,
  24. &pCert->m_strErrorText,
  25. USE_DEFAULT_CAPTION,
  26. CFinalInstalledPage::IDD),
  27. m_pCert(pCert)
  28. {
  29. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  30. }
  31. CFinalInstalledPage::~CFinalInstalledPage()
  32. {
  33. }
  34. BEGIN_MESSAGE_MAP(CFinalInstalledPage, CIISWizardBookEnd2)
  35. //{{AFX_MSG_MAP(CFinalInstalledPage)
  36. //}}AFX_MSG_MAP
  37. END_MESSAGE_MAP()
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CFinalInstalledPage message handlers
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CFinalReplacedPage property page
  42. IMPLEMENT_DYNCREATE(CFinalReplacedPage, CIISWizardBookEnd2)
  43. CFinalReplacedPage::CFinalReplacedPage(HRESULT * phResult, CCertificate * pCert)
  44. : CIISWizardBookEnd2(phResult,
  45. USE_DEFAULT_CAPTION,
  46. IDS_INSTALL_CERT_FAILURE_HEADER,
  47. IDS_CERTWIZ,
  48. &m_idBodyText,
  49. NULL,
  50. &pCert->m_idErrorText,
  51. &pCert->m_strErrorText,
  52. USE_DEFAULT_CAPTION,
  53. CFinalReplacedPage::IDD),
  54. m_pCert(pCert)
  55. {
  56. m_idBodyText = IDS_CERT_REPLACE_SUCCESS;
  57. }
  58. CFinalReplacedPage::~CFinalReplacedPage()
  59. {
  60. }
  61. BEGIN_MESSAGE_MAP(CFinalReplacedPage, CIISWizardBookEnd2)
  62. //{{AFX_MSG_MAP(CFinalReplacedPage)
  63. //}}AFX_MSG_MAP
  64. END_MESSAGE_MAP()
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CFinalInstalledPage message handlers
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CFinalRemovePage property page
  69. IMPLEMENT_DYNCREATE(CFinalRemovePage, CIISWizardBookEnd2)
  70. CFinalRemovePage::CFinalRemovePage(HRESULT * phResult, CCertificate * pCert)
  71. : CIISWizardBookEnd2(phResult,
  72. USE_DEFAULT_CAPTION,
  73. IDS_REMOVE_CERT_FAILURE_HEADER,
  74. IDS_CERTWIZ,
  75. &m_idBodyText,
  76. NULL,
  77. &pCert->m_idErrorText,
  78. &pCert->m_strErrorText,
  79. USE_DEFAULT_CAPTION,
  80. CFinalRemovePage::IDD),
  81. m_pCert(pCert)
  82. {
  83. m_idBodyText = IDS_CERT_REMOVE_SUCCESS;
  84. }
  85. CFinalRemovePage::~CFinalRemovePage()
  86. {
  87. }
  88. void CFinalRemovePage::DoDataExchange(CDataExchange* pDX)
  89. {
  90. CIISWizardBookEnd2::DoDataExchange(pDX);
  91. //{{AFX_DATA_MAP(CFinalRemovePage)
  92. // NOTE: the ClassWizard will add DDX and DDV calls here
  93. //}}AFX_DATA_MAP
  94. }
  95. BEGIN_MESSAGE_MAP(CFinalRemovePage, CIISWizardBookEnd2)
  96. //{{AFX_MSG_MAP(CFinalRemovePage)
  97. //}}AFX_MSG_MAP
  98. END_MESSAGE_MAP()
  99. /////////////////////////////////////////////////////////////////////////////
  100. // CFinalRemovePage message handlers
  101. BOOL CFinalRemovePage::OnInitDialog()
  102. {
  103. CIISWizardBookEnd2::OnInitDialog();
  104. ASSERT(m_pCert != NULL);
  105. if (m_pCert->m_hResult != S_OK)
  106. {
  107. // we need to replace text in template to error message
  108. CString str;
  109. str.LoadString(m_pCert->m_idErrorText);
  110. SetDlgItemText(IDC_STATIC_WZ_BODY, str);
  111. GetDlgItem(IDC_STATIC_WZ_BODY)->SendMessage(EM_SETSEL, -1, -1);
  112. }
  113. GetParent()->GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
  114. return TRUE;
  115. }
  116. /////////////////////////////////////////////////////////////////////////////
  117. // CFinalCancelPage property page
  118. IMPLEMENT_DYNCREATE(CFinalCancelPage, CIISWizardBookEnd2)
  119. CFinalCancelPage::CFinalCancelPage(HRESULT * phResult, CCertificate * pCert)
  120. : CIISWizardBookEnd2(phResult,
  121. USE_DEFAULT_CAPTION,
  122. IDS_CANCEL_CERT_FAILURE_HEADER,
  123. IDS_CERTWIZ,
  124. &m_idBodyText,
  125. NULL,
  126. &pCert->m_idErrorText,
  127. &pCert->m_strErrorText,
  128. USE_DEFAULT_CAPTION,
  129. CFinalCancelPage::IDD),
  130. m_pCert(pCert)
  131. {
  132. m_idBodyText = IDS_CERT_CANCEL_SUCCESS;
  133. }
  134. CFinalCancelPage::~CFinalCancelPage()
  135. {
  136. }
  137. void CFinalCancelPage::DoDataExchange(CDataExchange* pDX)
  138. {
  139. CIISWizardBookEnd2::DoDataExchange(pDX);
  140. //{{AFX_DATA_MAP(CFinalRemovePage)
  141. // NOTE: the ClassWizard will add DDX and DDV calls here
  142. //}}AFX_DATA_MAP
  143. }
  144. BEGIN_MESSAGE_MAP(CFinalCancelPage, CIISWizardBookEnd2)
  145. //{{AFX_MSG_MAP(CFinalCancelPage)
  146. //}}AFX_MSG_MAP
  147. END_MESSAGE_MAP()
  148. /////////////////////////////////////////////////////////////////////////////
  149. // CFinalCancelPage message handlers
  150. BOOL CFinalCancelPage::OnInitDialog()
  151. {
  152. CIISWizardBookEnd2::OnInitDialog();
  153. ASSERT(m_pCert != NULL);
  154. if (m_pCert->m_hResult != S_OK)
  155. {
  156. // we need to replace text in template to error message
  157. CString str;
  158. str.LoadString(m_pCert->m_idErrorText);
  159. SetDlgItemText(IDC_STATIC_WZ_BODY, str);
  160. GetDlgItem(IDC_STATIC_WZ_BODY)->SendMessage(EM_SETSEL, -1, -1);
  161. }
  162. GetParent()->GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
  163. return TRUE;
  164. }
  165. /////////////////////////////////////////////////////////////////////////////
  166. // CFinalToFilePage property page
  167. IMPLEMENT_DYNCREATE(CFinalToFilePage, CIISWizardBookEnd2)
  168. CFinalToFilePage::CFinalToFilePage(HRESULT * phResult, CCertificate * pCert)
  169. : CIISWizardBookEnd2(phResult,
  170. USE_DEFAULT_CAPTION,
  171. IDS_FINAL_TO_FILE_FAILURE_HEADER,
  172. IDS_CERTWIZ,
  173. NULL,
  174. NULL,
  175. &pCert->m_idErrorText,
  176. &pCert->m_strErrorText,
  177. USE_DEFAULT_CAPTION,
  178. CFinalToFilePage::IDD),
  179. m_pCert(pCert)
  180. {
  181. }
  182. CFinalToFilePage::~CFinalToFilePage()
  183. {
  184. }
  185. void CFinalToFilePage::DoDataExchange(CDataExchange* pDX)
  186. {
  187. CIISWizardBookEnd2::DoDataExchange(pDX);
  188. //{{AFX_DATA_MAP(CFinalToFilePage)
  189. DDX_Control(pDX, IDC_HOTLINK_CCODES, m_hotlink_codessite);
  190. //}}AFX_DATA_MAP
  191. }
  192. BEGIN_MESSAGE_MAP(CFinalToFilePage, CIISWizardBookEnd2)
  193. //{{AFX_MSG_MAP(CFinalToFilePage)
  194. //}}AFX_MSG_MAP
  195. END_MESSAGE_MAP()
  196. /////////////////////////////////////////////////////////////////////////////
  197. // CFinalToFilePage message handlers
  198. BOOL CFinalToFilePage::OnInitDialog()
  199. {
  200. ASSERT(NULL != m_pCert);
  201. CIISWizardBookEnd2::OnInitDialog();
  202. // in case of success we should prepare text and include
  203. // request file name into
  204. if (SUCCEEDED(m_pCert->m_hResult))
  205. {
  206. CString str, strPath;
  207. strPath = m_pCert->m_ReqFileName;
  208. // If filename is too long, it will look ugly, we could
  209. // limit it to our static control width.
  210. VERIFY(CompactPathToWidth(GetDlgItem(IDC_STATIC_WZ_BODY), strPath));
  211. // This MFC helper limits the format internally
  212. // to 256 characters: cannot use it here
  213. // AfxFormatString1(str, IDS_FINAL_TO_FILE_BODY_SUCCESS, m_pCert->m_ReqFileName);
  214. str.Format(IDS_CERT_REQUEST_SUCCESS, strPath);
  215. SetDlgItemText(IDC_STATIC_WZ_BODY, str);
  216. GetDlgItem(IDC_STATIC_WZ_BODY)->SendMessage(EM_SETSEL, -1, -1);
  217. //GetDlgItem(IDC_STATIC_WZ_BODY)->SetFocus();
  218. // setup the link to CA list
  219. m_hotlink_codessite.SetLink(IDS_MICROSOFT_CA_LINK);
  220. }
  221. else
  222. {
  223. // hide controls that are not for error message
  224. GetDlgItem(IDC_HOTLINK_CCODES)->ShowWindow(SW_HIDE);
  225. GetDlgItem(IDC_STATIC_WZ_BODY2)->ShowWindow(SW_HIDE);
  226. }
  227. SetWizardButtons(PSWIZB_FINISH);
  228. GetParent()->GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
  229. return TRUE;
  230. }
  231. /////////////////////////////////////////////////////////////////////////////
  232. // CFinalInstalledPage property page
  233. IMPLEMENT_DYNCREATE(CFinalInstalledImportPFXPage, CIISWizardBookEnd2)
  234. CFinalInstalledImportPFXPage::CFinalInstalledImportPFXPage(HRESULT * phResult, CCertificate * pCert)
  235. : CIISWizardBookEnd2(phResult,
  236. USE_DEFAULT_CAPTION,
  237. IDS_INSTALL_CERT_FAILURE_HEADER,
  238. IDS_CERTWIZ,
  239. &m_idBodyText,
  240. NULL,
  241. &pCert->m_idErrorText,
  242. &pCert->m_strErrorText,
  243. USE_DEFAULT_CAPTION,
  244. CFinalInstalledImportPFXPage::IDD),
  245. m_pCert(pCert)
  246. {
  247. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  248. }
  249. CFinalInstalledImportPFXPage::~CFinalInstalledImportPFXPage()
  250. {
  251. }
  252. BEGIN_MESSAGE_MAP(CFinalInstalledImportPFXPage, CIISWizardBookEnd2)
  253. //{{AFX_MSG_MAP(CFinalInstalledImportPFXPage)
  254. //}}AFX_MSG_MAP
  255. END_MESSAGE_MAP()
  256. /////////////////////////////////////////////////////////////////////////////
  257. // CFinalInstalledPage property page
  258. IMPLEMENT_DYNCREATE(CFinalInstalledExportPFXPage, CIISWizardBookEnd2)
  259. CFinalInstalledExportPFXPage::CFinalInstalledExportPFXPage(HRESULT * phResult, CCertificate * pCert)
  260. : CIISWizardBookEnd2(phResult,
  261. USE_DEFAULT_CAPTION,
  262. IDS_INSTALL_CERT_FAILURE_HEADER,
  263. IDS_CERTWIZ,
  264. &m_idBodyText,
  265. NULL,
  266. &pCert->m_idErrorText,
  267. &pCert->m_strErrorText,
  268. USE_DEFAULT_CAPTION,
  269. CFinalInstalledExportPFXPage::IDD),
  270. m_pCert(pCert)
  271. {
  272. m_idBodyText = IDS_PFX_EXPORT_SUCCESS;
  273. }
  274. CFinalInstalledExportPFXPage::~CFinalInstalledExportPFXPage()
  275. {
  276. }
  277. BEGIN_MESSAGE_MAP(CFinalInstalledExportPFXPage, CIISWizardBookEnd2)
  278. //{{AFX_MSG_MAP(CFinalInstalledExportPFXPage)
  279. //}}AFX_MSG_MAP
  280. END_MESSAGE_MAP()
  281. /////////////////////////////////////////////////////////////////////////////
  282. // CFinalInstalledPage property page
  283. IMPLEMENT_DYNCREATE(CFinalInstalledCopyFromRemotePage, CIISWizardBookEnd2)
  284. CFinalInstalledCopyFromRemotePage::CFinalInstalledCopyFromRemotePage(HRESULT * phResult, CCertificate * pCert)
  285. : CIISWizardBookEnd2(phResult,
  286. USE_DEFAULT_CAPTION,
  287. IDS_INSTALL_CERT_FAILURE_HEADER,
  288. IDS_CERTWIZ,
  289. &m_idBodyText,
  290. NULL,
  291. &pCert->m_idErrorText,
  292. &pCert->m_strErrorText,
  293. USE_DEFAULT_CAPTION,
  294. CFinalInstalledCopyFromRemotePage::IDD),
  295. m_pCert(pCert)
  296. {
  297. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  298. }
  299. CFinalInstalledCopyFromRemotePage::~CFinalInstalledCopyFromRemotePage()
  300. {
  301. }
  302. BEGIN_MESSAGE_MAP(CFinalInstalledCopyFromRemotePage, CIISWizardBookEnd2)
  303. //{{AFX_MSG_MAP(CFinalInstalledCopyFromRemotePage)
  304. //}}AFX_MSG_MAP
  305. END_MESSAGE_MAP()
  306. /////////////////////////////////////////////////////////////////////////////
  307. // CFinalInstalledPage property page
  308. IMPLEMENT_DYNCREATE(CFinalInstalledMoveFromRemotePage, CIISWizardBookEnd2)
  309. CFinalInstalledMoveFromRemotePage::CFinalInstalledMoveFromRemotePage(HRESULT * phResult, CCertificate * pCert)
  310. : CIISWizardBookEnd2(phResult,
  311. USE_DEFAULT_CAPTION,
  312. IDS_INSTALL_CERT_FAILURE_HEADER,
  313. IDS_CERTWIZ,
  314. &m_idBodyText,
  315. NULL,
  316. &pCert->m_idErrorText,
  317. &pCert->m_strErrorText,
  318. USE_DEFAULT_CAPTION,
  319. CFinalInstalledMoveFromRemotePage::IDD),
  320. m_pCert(pCert)
  321. {
  322. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  323. }
  324. CFinalInstalledMoveFromRemotePage::~CFinalInstalledMoveFromRemotePage()
  325. {
  326. }
  327. BEGIN_MESSAGE_MAP(CFinalInstalledMoveFromRemotePage, CIISWizardBookEnd2)
  328. //{{AFX_MSG_MAP(CFinalInstalledMoveFromRemotePage)
  329. //}}AFX_MSG_MAP
  330. END_MESSAGE_MAP()
  331. /////////////////////////////////////////////////////////////////////////////
  332. // CFinalInstalledPage property page
  333. IMPLEMENT_DYNCREATE(CFinalInstalledCopyToRemotePage, CIISWizardBookEnd2)
  334. CFinalInstalledCopyToRemotePage::CFinalInstalledCopyToRemotePage(HRESULT * phResult, CCertificate * pCert)
  335. : CIISWizardBookEnd2(phResult,
  336. USE_DEFAULT_CAPTION,
  337. IDS_INSTALL_CERT_FAILURE_HEADER,
  338. IDS_CERTWIZ,
  339. &m_idBodyText,
  340. NULL,
  341. &pCert->m_idErrorText,
  342. &pCert->m_strErrorText,
  343. USE_DEFAULT_CAPTION,
  344. CFinalInstalledCopyToRemotePage::IDD),
  345. m_pCert(pCert)
  346. {
  347. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  348. }
  349. CFinalInstalledCopyToRemotePage::~CFinalInstalledCopyToRemotePage()
  350. {
  351. }
  352. BEGIN_MESSAGE_MAP(CFinalInstalledCopyToRemotePage, CIISWizardBookEnd2)
  353. //{{AFX_MSG_MAP(CFinalInstalledCopyToRemotePage)
  354. //}}AFX_MSG_MAP
  355. END_MESSAGE_MAP()
  356. /////////////////////////////////////////////////////////////////////////////
  357. // CFinalInstalledPage property page
  358. IMPLEMENT_DYNCREATE(CFinalInstalledMoveToRemotePage, CIISWizardBookEnd2)
  359. CFinalInstalledMoveToRemotePage::CFinalInstalledMoveToRemotePage(HRESULT * phResult, CCertificate * pCert)
  360. : CIISWizardBookEnd2(phResult,
  361. USE_DEFAULT_CAPTION,
  362. IDS_INSTALL_CERT_FAILURE_HEADER,
  363. IDS_CERTWIZ,
  364. &m_idBodyText,
  365. NULL,
  366. &pCert->m_idErrorText,
  367. &pCert->m_strErrorText,
  368. USE_DEFAULT_CAPTION,
  369. CFinalInstalledMoveToRemotePage::IDD),
  370. m_pCert(pCert)
  371. {
  372. m_idBodyText = IDS_CERT_INSTALLED_SUCCESS;
  373. }
  374. CFinalInstalledMoveToRemotePage::~CFinalInstalledMoveToRemotePage()
  375. {
  376. }
  377. BEGIN_MESSAGE_MAP(CFinalInstalledMoveToRemotePage, CIISWizardBookEnd2)
  378. //{{AFX_MSG_MAP(CFinalInstalledMoveToRemotePage)
  379. //}}AFX_MSG_MAP
  380. END_MESSAGE_MAP()