Преглед на файлове

优化 - 重整安装过程逻辑,文件分类

chenrongqian преди 2 години
родител
ревизия
652ed03445
променени са 41 файла, в които са добавени 1092 реда и са изтрити 660 реда
  1. 4 5
      PDFReaderPro_Installer/Bin/XMLFile.xml
  2. 1 8
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp
  3. 3 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp
  4. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h
  5. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp
  6. 8 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp
  7. 5 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h
  8. 18 305
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp
  9. 12 40
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h
  10. 267 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWndInit.cpp
  11. 8 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp
  12. 4 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.h
  13. 32 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMainPage.cpp
  14. 53 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMainPage.h
  15. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h
  16. 2 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineStr.h
  17. 193 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DeviceProduct.cpp
  18. 67 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DeviceProduct.h
  19. 17 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Documentation.h
  20. 62 15
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp
  21. 17 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h
  22. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp
  23. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h
  24. 7 7
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp
  25. 9 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h
  26. 25 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.cpp
  27. 8 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h
  28. 1 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.cpp
  29. 1 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h
  30. 56 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.cpp
  31. 21 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.h
  32. 21 17
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.cpp
  33. 21 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineVersion.h
  34. 10 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj
  35. 60 27
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters
  36. 0 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/UIwnd.h
  37. 2 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp
  38. 35 163
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstall.cpp
  39. 6 12
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp
  40. 0 18
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.h
  41. 34 20
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp

+ 4 - 5
PDFReaderPro_Installer/Bin/XMLFile.xml

@@ -20,13 +20,13 @@
 			<HorizontalLayout padding="0,30,0,0" width="760" visible="true">
 				<Container />
 				<Text name="TxtByClickInstall" font="0" autocalcwidth="true" floatalign="center" text="By clicking “Install”,you agree to the" textcolor="0xFF000000" />
-				<Button name="BtnTermsService" padding="0,-25,0,0" text="Terms of Service." font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
+				<Button name="BtnTermsService" padding="0,-30,0,0" text="Terms of Service." font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
 				<Text name="TxtAnd" text=" and " font="0" autocalcwidth="true" textcolor="0xFF000000" />
-				<Button name="BtnPrivacyPolicy" padding="0,-25,0,0" text=" Privacy Policy" font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
+				<Button name="BtnPrivacyPolicy" padding="0,-30,0,0" text=" Privacy Policy" font="3" autocalcwidth="true" textcolor="0XFF477EDE" hotbordercolor="0xFF004AFF" cursor="Hand" />
 				<Text name="TextShowContentLink" visible="false" padding="0,16,0,0" autocalcwidth="true" floatalign="center" font="0" text="By clicking “Install”,you agree to the {a https://www.baidu.com} Privacy Policy{/a} and {a https://www.csdn.net} Terms of Service{/a}" textcolor="0xFF000000" showhtml="true" />
 				<Container />
 			</HorizontalLayout>
-			<HorizontalLayout padding="0,20,0,0" width="760" visible="true">
+			<HorizontalLayout padding="0,0,0,0" width="760" visible="true">
 				<Container />
 				<HorizontalLayout autocalcwidth="true" floatalign="center">
 					<Container />
@@ -37,7 +37,7 @@
 				<Container />
 			</HorizontalLayout>
 			<HorizontalLayout visible="true" padding="40,0,0,0" width="680" bkcolor="0xFFEAECF2" height="1" />
-			<HorizontalLayout padding="40,10,0,0" width="760" autocalcheight="true">
+			<HorizontalLayout padding="40,15,0,0" width="760" autocalcheight="true">
 				<Label name="InstallationfolderTitle" font="0" height="30" autocalcwidth="true" padding="0,0,8,0" text="Installation folder" textcolor="0xFF000000" />
 				<RichEdit name="EdFilepath" autohscroll="true" readonly="true" text="" font="0" textpadding="4,6,4,0" height="32" bordercolor="0xFFDFDFDF" bordersize="1,1,1,1" />
 				<HorizontalLayout visible="false" width="32" height="32" bordercolor="0xFFDFDFDF" bordersize="0,1,1,1">
@@ -82,7 +82,6 @@
 					<Container />
 					<Button name="Btnminsize" height="32" width="32" visible="true" hotbkcolor="0x39F0F0F0" pushedbkcolor="0x69E1E1E1" normalimage="minimize.png" hotimage="minimize.png" pushedimage="minimize.png" />
 					<Button name="BtnClose" height="32" width="32" hotbkcolor="0xFFFF0000" pushedbkcolor="0xFFFF5757" normalimage="close.png" hotimage="close.png" pushedimage="close.png" />
-					<Container name="containerCloseNone" visible="false" height="32" width="32" />
 				</HorizontalLayout>
 			</HorizontalLayout>
 		</HorizontalLayout>

+ 1 - 8
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp

@@ -3,13 +3,6 @@
 #include "AppCore.h"
 #include "KeyVar.h"
 
-#pragma region ¾²Ì¬³ÉÔ±±äÁ¿
-
-
-//const wstring AppCore::FileName_ProgressName = L"PDF Reader Pro";
-#pragma endregion
-
-
 #pragma region Îļþ·¾¶
 
 wstring AppCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar)
@@ -96,7 +89,7 @@ void AppCore::InitAppTempPath()
 
 	 if (isCreate)
 	 {
-		 PathCore::smPath_Install = PathCore::smPath_Install + L"\\" + ExeCore::smName_ExeProcess;
+		 PathCore::smPath_Install = PathCore::smPath_Install + L"\\" + ExeCore::smName_AppName;
 		 if (!PathIsDirectoryW(PathCore::smPath_Install.c_str()))
 			 isCreate = CreateDirectory((PathCore::smPath_Install.c_str()), NULL);
 	 }

+ 3 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp

@@ -23,6 +23,7 @@
 #include <Windows.h>
 #include "CDownLoadFile.h"
 #include<profinfo.h>
+#include "OnlineVersion.h"
 
 VertionResultType CAccessRegedit::AccessKey()
 {
@@ -90,7 +91,7 @@ VertionResultType CAccessRegedit::AccessSubKey(std::wstring AppKey)
 	HKEY hkRKey;
 	LPCTSTR lpSubKey;
 	
-	AppKey = RegeditCore::smPath_ProductsInfo + AppKey;
+	AppKey = RegeditCore::smPath_ProductsInfo+L"\\" + AppKey;
 	lpSubKey = AppKey.c_str();
 	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey1);
 	VertionResultType state = VertionResultType::None;
@@ -176,7 +177,7 @@ VertionResultType CAccessRegedit::AccessSubKey(std::wstring AppKey)
 
 std::wstring CAccessRegedit::GetVersionFromXML()
 {
-	XmlNode xmlNode;
+	OnlineVersion xmlNode;
 	char* newstr = const_cast<char*>(xmlNode.GetInstallPageVersion());
 	VersionFromXML = AppCore::GetMultiByteToWideChar(newstr);
 	return VersionFromXML;

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h

@@ -4,7 +4,6 @@
 #include "AppCore.h"
 #include "CClasses.h"
 #include<vector>
-#include "XmlNode.h"
 
 typedef struct _URL_INFO
 {

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp

@@ -46,7 +46,7 @@ BOOL CCmd::OpenAppcmd()
 void CCmd::WriteInIniFile(string contentType,wstring cmdContent)
 {
 	//文件:存放在文档里
-	wstring wPath = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + L"静默安装日志";
+	wstring wPath = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + L"SilentInstallationLog.ini";
 	wchar_t* ptrPath = _wcsdup(wPath.c_str());
 	std::string sPath = AppCore::GetWideCharToMultiByte(ptrPath);
 

+ 8 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp

@@ -28,3 +28,11 @@ bool CDownLoadFile::GetInstallPackage(std::wstring SaveFolder)
 	
 	return false;
 }
+
+ bool NetWorkState::IsNetWorking()
+{
+	 DWORD   flags;
+	 BOOL   m_bOnline = TRUE;
+	 m_bOnline = InternetGetConnectedState(&flags, 0);
+	 return m_bOnline;
+}

+ 5 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h

@@ -68,3 +68,8 @@ public:
     bool GetInstallPackage(std::wstring SaveFolder);
 };
 
+class NetWorkState
+{
+public:
+    static bool IsNetWorking();
+};

+ 18 - 305
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp

@@ -4,184 +4,16 @@
 #include<vector>
 #include <Utils/stb_image.h>
 #define UIMSG_SET_DPI WM_USER + 200
-#pragma region 初始化
-
-DUI_BEGIN_MESSAGE_MAP(CMainPage, CNotifyPump)
-DUI_ON_MSGTYPE(DUI_MSGTYPE_CLICK, OnClick)
-DUI_ON_MSGTYPE(DUI_MSGTYPE_SELECTCHANGED, OnSelectChanged)
-DUI_ON_MSGTYPE(DUI_MSGTYPE_ITEMCLICK, OnItemClick)
-DUI_END_MESSAGE_MAP()
-
-CMainPage::CMainPage()
-{
-	m_pPaintManager = NULL;
-}
-
-void CMainPage::SetPaintMagager(CPaintManagerUI* pPaintMgr)
-{
-	m_pPaintManager = pPaintMgr;
-}
-
-void CMainPage::OnClick(TNotifyUI& msg)
-{
-
-}
-
-void CMainPage::OnSelectChanged(TNotifyUI& msg)
-{
-
-}
-
-void CMainPage::OnItemClick(TNotifyUI& msg)
-{
-
-}
-
-
-/// ///////////////////////////////////////
-
-SilenceInstallingType CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::None;
-
-CFrameWnd::CFrameWnd(LPCTSTR pszXMLPath)
-	: m_strXMLPath(pszXMLPath)
-{
-
-}
-
-CFrameWnd::CFrameWnd()
-{
-	m_MainPage.SetPaintMagager(&m_pm);
-	AddVirtualWnd(_T("MainWnd"), &m_MainPage);
-	banner = new CAdsBanner();
-	m_threadData.pFrame = this;
-}
-
-CFrameWnd::~CFrameWnd(void)
-{
-	RemoveVirtualWnd(_T("MainWnd"));
-}
-
-LPCTSTR CFrameWnd::GetWindowClassName() const
-{
-	return _T("MainWnd");
-}
-
-
-//DuiLib::CDuiString CFrameWnd::GetSkinFile()
-//{
-//	return XML_MainFile;
-//}
-
-CDuiString CFrameWnd::GetSkinFolder()
-{
-	return _T("");
-}
-
-void CFrameWnd::InitControls()
-{
-	m_InstallationPage = new InstallationPage(&m_pm);
-	m_InstallingPage = new InstallingPage(&m_pm);
-	m_InstalledPage = new InstalledPage(&m_pm);
-	InitHomeControls();
-	InitInstallingControls();
-	InitInstalledControls();
-
-}
-
-void CFrameWnd::InitAsscessKey()
-{
-	CAccessRegedit accessRegedit;
-	accessRegedit.GetVersionFromXML();
-	VertionResultType state = accessRegedit.AccessKey();
-}
-
-void CFrameWnd::InitWindow()
-{
-	SetIcon(IDI_ICON1);
-	SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME);//禁止最大化窗口
-	this->CenterWindow();
-	InitControls();
-	//AdaptationDPI();
-	SelectLayout(LayoutType::Home);
-}
-
-
-void CFrameWnd::AdaptationDPI()
-{
-	HWND hd = FindWindow(L"Progman", L"Program Manager");
-
-	int dpiValue = GetDpiForWindow(hd);//当前DPI
-
-	double currentZoom = dpiValue / 96.0;//当前显示比例
-	double tempDPI = currentZoom;
-
-	int dpiOffer = (int)(96 - (currentZoom - 1) * 96.0);//DPI偏移量
-
-	if (dpiValue == 96)
-	{
-		dpi = 1;
-		CurrentDPI = 96;
-	}
-	else
-	{
-		dpi = dpiOffer / 96.0;//比例偏移量
-		CurrentDPI = 96 - dpiOffer;
-		dpi = 1 - dpi;
-
-	}
-
-	m_pm.SetDPI(CurrentDPI);
-}
-
-void CFrameWnd::setDPI(int DPI)
-{
-	m_pm.SetDPI(DPI);
-}
-//使用OnCreate就会不触发GetSkinFile事件
-//LRESULT CFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-//{
-//
-//	return 1;
-//}
-
-
-LRESULT CFrameWnd::OnDPIChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
-	m_pm.SetDPI(LOWORD(wParam));
-	m_pm.ResetDPIAssets();
-	int g_dpi = HIWORD(wParam);
-
-	RECT* const prcNewWindow = (RECT*)lParam;
-	SetWindowPos(m_hWnd,
-		NULL,
-		prcNewWindow->left,
-		prcNewWindow->top,
-		prcNewWindow->right - prcNewWindow->left,
-		prcNewWindow->bottom - prcNewWindow->top,
-		SWP_NOZORDER | SWP_NOACTIVATE);
-	if (m_pm.GetRoot() != NULL) m_pm.GetRoot()->NeedUpdate();
-
-	bHandled = false;
-
-	wstring optionName;
-	wstringstream wss;
-	wss << L"DPI";
-	wss << m_pm.GetDPIObj()->GetDPI();
-	wss >> optionName;
-	COptionUI* option = static_cast<COptionUI*>(m_pm.FindControl(optionName.c_str()));
-	option->Selected(true);
-
-	return 0;
-}
-
-#pragma endregion
-
 
+#include <Windows.h>
 
+#include <AccCtrl.h>
+#include <AclAPI.h>
+#include <tchar.h>#include <iostream>
+#include<accctrl.h>
 
 #pragma region 事件逻辑处理
 
-
 LRESULT CFrameWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
 	switch (wParam)
@@ -209,42 +41,39 @@ LRESULT CFrameWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
 	return 0;
 }
 
+void CFrameWnd::KillAllTimer()
+{
+	KillTimer(m_hWnd, TIMER_BANNER_ID);
+	KillTimer(m_hWnd, TIMER_INSTALL_ID);
+	KillTimer(m_hWnd, TIMER_WAITDOWNLOAD_ID);
+	KillTimer(m_hWnd, TIMER_SILENTINSTALL_ID);
+}
+
 #pragma endregion
 
 
-void CFrameWnd::Notify(TNotifyUI& msg)
+void CFrameWnd::SlotMsg(TNotifyUI& msg)
 {
 	if (msg.sType == _T("click"))
 	{
-	
 		if (msg.pSender->GetName() == _T("BtnClose"))
 		{
 			if (m_State.m_LayoutType == LayoutType::Home)
 			{
-				if (MSGID_OK == CMsgWnd::MessageBox(
-					m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_IsExitApp).c_str(),
-					CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
-					CLanguage::GetText(TextType::MSG_BtnNo).c_str()
-				))
+				if (MSGID_OK == MessageBoxWnd::Show(m_hWnd, MessageContentType::IsExitApp))
 				{
-					
 					::DestroyWindow(m_hWnd);
 				}
 			}
 			else
 			{
-				if (MSGID_OK == CMsgWnd::MessageBox(
-					m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledIsExitApp).c_str(),
-					CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
-					CLanguage::GetText(TextType::MSG_BtnNo).c_str()
-				))
+				if (MSGID_OK == MessageBoxWnd::Show(m_hWnd, MessageContentType::InstallingFailed))
 				{
-					
 					::DestroyWindow(m_hWnd);
 				}
 			}
 
-			
+
 		}
 
 		if (msg.pSender->GetName() == _T("Btnminsize"))
@@ -252,48 +81,9 @@ void CFrameWnd::Notify(TNotifyUI& msg)
 			SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
 		}
 	}
-
-	switch (m_State.m_LayoutType)
-	{
-	case LayoutType::Home:
-		NotifyHome(msg);
-		break;
-	case LayoutType::Installing:
-		NotifyInstalling(msg);
-		break;
-	case LayoutType::Installed:
-		NotifyInstalled(msg);
-		break;
-	default:
-		break;
-	}
-
-	return WindowImplBase::Notify(msg);
 }
 
-std::wstring CFrameWnd::m_replace(std::wstring strSrc, const std::wstring& oldStr, const std::wstring& newStr)
-{
-	std::wstring strRet = strSrc;
-	size_t pos = 0;
-	int l_count = 0;
-	int count = -1;
-	if (-1 == count) // replace all
-		count = strRet.size();
-	while ((pos = strRet.find(oldStr, pos)) != std::wstring::npos)
-	{
-		strRet.replace(pos, oldStr.size(), newStr);
-		if (++l_count >= count) break;
-		pos += newStr.size();
-	}
-	return strRet;
-}
 
-#include <Windows.h>
-
-#include <AccCtrl.h>
-#include <AclAPI.h>
-#include <tchar.h>#include <iostream>
-#include<accctrl.h>
 LRESULT CFrameWnd::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
 	LRESULT lRes = 0;
@@ -309,79 +99,6 @@ LRESULT CFrameWnd::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
 
 }
 
-LRESULT CFrameWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
-	LRESULT lRes = 0;
-	BOOL bHandled1 = TRUE;
-
-	wstring optionNamea;
-	wstringstream wss;
-	
-	switch (uMsg)
-	{
-	case WM_CREATE:
-		break;
-	case WM_DESTROY:
-	{
-		::PostQuitMessage(0);
-		AppCore::ClearAllTempFolder();
-		break;
-	}
-
-	case WM_NCCALCSIZE:
-		return 0;
-	/*case WM_DPICHANGED:
-		lRes = OnDPIChanged(uMsg, wParam, lParam, bHandled); 
-		break;*/
-    case WM_TIMER:  
-		lRes = OnTimer(uMsg, wParam, lParam, bHandled);
-		break;
-	case WM_KEYDOWN:
-		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
-	default:
-		break;
-	}
-
-	return lRes;
-
-	//以下代码的实现,会导致编辑框失去焦点之后而无法再次获取焦点
-	/*if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes)) return lRes;
-	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);*/
-
-}
-
-LRESULT CFrameWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
-	switch (wParam)
-	{
-	case _T('A'):
-	{
-		if (GetKeyState(VK_CONTROL) < 0)
-		{
-			if (m_InstallationPage->EdFilepath->IsFocused())
-			{
-				m_InstallationPage->EdFilepath->SetSelAll();
-			}
-		}
-	}
-
-	case _T('C'):
-	{
-		if (GetKeyState(VK_CONTROL) < 0)
-		{
-			if (m_InstallationPage->EdFilepath->IsFocused() &&
-				m_InstallationPage->EdFilepath->GetSelText() == m_InstallationPage->EdFilepath->GetText())
-			{
-				m_InstallationPage->EdFilepath->Copy();
-			}
-		}
-	}
-
-
-	break;
-	}
-	return 0;
-}
 
 void CFrameWnd::SelectLayout(LayoutType LayoutType)
 {
@@ -394,19 +111,15 @@ void CFrameWnd::SelectLayout(LayoutType LayoutType)
 	case LayoutType::Home:
 		m_InstallationPage->LayoutHome->SetVisible(true);
 		m_InstallationPage->BtnClose->SetVisible(true);
-		//m_InstallationPage->containerCloseNone->SetVisible(false);
 		break;
 	case LayoutType::Installing:
 		m_InstallingPage->LayoutInstalling->SetVisible(true);
 		m_InstallationPage->BtnClose->SetVisible(false);
-		//m_InstallationPage->containerCloseNone->SetVisible(true);
 		break;
 	case LayoutType::Installed:
 		m_InstalledPage->LayoutInstalled->SetVisible(true);
 		m_InstallationPage->BtnClose->SetVisible(true);
-		//m_InstallationPage->containerCloseNone->SetVisible(false);
-		KillTimer(m_hWnd, TIMER_INSTALL_ID);
-		KillTimer(m_hWnd, TIMER_BANNER_ID);
+		KillAllTimer();
 		break;
 	default:
 		break;

+ 12 - 40
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h

@@ -13,44 +13,16 @@
 #include "resource.h"
 //UI
 #include "CMsgWnd.h"
-#include "CAdsBanner.h"
+//#include "CAdsBanner.h"
 #include "InstallPage.h"
 #include "InstallingPage.h"
 #include "InstalledPage.h"
-#include "UIWnd.h"
-typedef struct ThreadData
-{
-public:
-	struct CFrameWnd* pFrame;
-}ThreadData;
-
-typedef struct CurrentState
-{
-public:
-	enum class LayoutType m_LayoutType = LayoutType::Home;
-	enum class VertionResultType m_VertionResultType = VertionResultType::None;
-	enum class InstallStateType m_InstallStateType = InstallStateType::None;
-
-
-}CurrentState;
-
-
-class CMainPage : public CNotifyPump
-{
-public:
-	CMainPage();
-
-public:
-	void SetPaintMagager(CPaintManagerUI* pPaintMgr);
-
-	DUI_DECLARE_MESSAGE_MAP()
-    virtual void OnClick(TNotifyUI& msg);
-	virtual void OnSelectChanged(TNotifyUI& msg);
-	virtual void OnItemClick(TNotifyUI& msg);
-
-private:
-	CPaintManagerUI* m_pPaintManager;
-};
+#include "MessageBoxWnd.h"
+#include "CMainPage.h"
+#include "stdafx.h"
+//#include "duilib.h"
+#include "KeyVar.h"
+#include "FileCore.h"
 
  class CFrameWnd : public WindowImplBase
 {
@@ -66,9 +38,8 @@ private:
 	double dpi = 1;
 	RECT start_rect_;
 	
-
 	CMainPage m_MainPage;
-	bool IsSpaceDisk();
+	
 public:
 	//³õʼ»¯
 	 explicit CFrameWnd(LPCTSTR pszXMLPath);
@@ -80,14 +51,15 @@ public:
 	 void InitControls();
 	 void InitWindow();
 	 void InitAsscessKey();
+	 void KillAllTimer();
 private:
-	 void WindowSize();
+	 void CustomInstallWndSize(bool isExpend);
 	 //Âß¼­
 	 void setDPI(int DPI);
 	 void AdaptationDPI();
 	 void SelectLayout(LayoutType LayoutType);
-	 
-	 std::wstring m_replace(std::wstring strSrc, const std::wstring& oldStr, const std::wstring& newStr);
+	 void SlotMsg(TNotifyUI& msg);
+	 void LayoutNotify(TNotifyUI& msg);
 	 //ÏûϢʼþ
 	 void Notify(TNotifyUI& msg);
 	// LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

+ 267 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWndInit.cpp

@@ -0,0 +1,267 @@
+#include "CFrameWnd.h"
+//说明:初始化窗口,但对运行的程序不常操作
+#pragma region 初始化
+
+SilenceInstallingType CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::None;
+
+CFrameWnd::CFrameWnd(LPCTSTR pszXMLPath)
+	: m_strXMLPath(pszXMLPath)
+{
+
+}
+
+CFrameWnd::CFrameWnd()
+{
+	m_MainPage.SetPaintMagager(&m_pm);
+	AddVirtualWnd(_T("MainWnd"), &m_MainPage);
+	banner = new CAdsBanner();
+	m_threadData.pFrame = this;
+}
+
+CFrameWnd::~CFrameWnd(void)
+{
+	RemoveVirtualWnd(_T("MainWnd"));
+}
+
+LPCTSTR CFrameWnd::GetWindowClassName() const
+{
+	return _T("MainWnd");
+}
+
+CDuiString CFrameWnd::GetSkinFolder()
+{
+	return _T("");
+}
+
+void CFrameWnd::InitControls()
+{
+	m_InstallationPage = new InstallationPage(&m_pm);
+	m_InstallingPage = new InstallingPage(&m_pm);
+	m_InstalledPage = new InstalledPage(&m_pm);
+	InitHomeControls();
+	InitInstallingControls();
+	InitInstalledControls();
+
+}
+
+void CFrameWnd::InitAsscessKey()
+{
+	CAccessRegedit accessRegedit;
+	accessRegedit.GetVersionFromXML();
+	VertionResultType state = accessRegedit.AccessKey();
+}
+
+void CFrameWnd::InitWindow()
+{
+	SetIcon(IDI_ICON1);
+	SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME);//禁止最大化窗口
+	this->CenterWindow();
+	InitControls();
+	//AdaptationDPI();
+	SelectLayout(LayoutType::Home);
+	ShowWindow();
+}
+
+
+void CFrameWnd::AdaptationDPI()
+{
+	HWND hd = FindWindow(L"Progman", L"Program Manager");
+
+	int dpiValue = GetDpiForWindow(hd);//当前DPI
+
+	double currentZoom = dpiValue / 96.0;//当前显示比例
+	double tempDPI = currentZoom;
+
+	int dpiOffer = (int)(96 - (currentZoom - 1) * 96.0);//DPI偏移量
+
+	if (dpiValue == 96)
+	{
+		dpi = 1;
+		CurrentDPI = 96;
+	}
+	else
+	{
+		dpi = dpiOffer / 96.0;//比例偏移量
+		CurrentDPI = 96 - dpiOffer;
+		dpi = 1 - dpi;
+
+	}
+
+	m_pm.SetDPI(CurrentDPI);
+}
+
+void CFrameWnd::setDPI(int DPI)
+{
+	m_pm.SetDPI(DPI);
+}
+//使用OnCreate就会不触发GetSkinFile事件
+//LRESULT CFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+//{
+//
+//	return 1;
+//}
+
+
+LRESULT CFrameWnd::OnDPIChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	m_pm.SetDPI(LOWORD(wParam));
+	m_pm.ResetDPIAssets();
+	int g_dpi = HIWORD(wParam);
+
+	RECT* const prcNewWindow = (RECT*)lParam;
+	SetWindowPos(m_hWnd,
+		NULL,
+		prcNewWindow->left,
+		prcNewWindow->top,
+		prcNewWindow->right - prcNewWindow->left,
+		prcNewWindow->bottom - prcNewWindow->top,
+		SWP_NOZORDER | SWP_NOACTIVATE);
+	if (m_pm.GetRoot() != NULL) m_pm.GetRoot()->NeedUpdate();
+
+	bHandled = false;
+
+	wstring optionName;
+	wstringstream wss;
+	wss << L"DPI";
+	wss << m_pm.GetDPIObj()->GetDPI();
+	wss >> optionName;
+	COptionUI* option = static_cast<COptionUI*>(m_pm.FindControl(optionName.c_str()));
+	option->Selected(true);
+
+	return 0;
+}
+
+LRESULT CFrameWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LRESULT lRes = 0;
+
+	switch (uMsg)
+	{
+	case WM_CREATE:break;
+	
+	case WM_DESTROY:
+	{
+		::PostQuitMessage(0);
+		AppCore::ClearAllTempFolder();
+		break;
+	}
+
+	case WM_NCCALCSIZE:
+		return 0;
+		/*case WM_DPICHANGED:
+			lRes = OnDPIChanged(uMsg, wParam, lParam, bHandled);
+			break;*/
+	case WM_TIMER:
+		lRes = OnTimer(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_KEYDOWN:
+		lRes = OnKeyDown(uMsg, wParam, lParam, bHandled);
+	default:
+		break;
+	}
+
+	return lRes;
+
+	//以下代码的实现,会导致编辑框失去焦点之后而无法再次获取焦点
+	/*if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes)) return lRes;
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);*/
+
+}
+
+LRESULT CFrameWnd::OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	switch (wParam)
+	{
+	case _T('A'):
+	{
+		if (GetKeyState(VK_CONTROL) < 0)
+		{
+			if (m_InstallationPage->EdFilepath->IsFocused())
+			{
+				m_InstallationPage->EdFilepath->SetSelAll();
+			}
+		}
+	}
+
+	case _T('C'):
+	{
+		if (GetKeyState(VK_CONTROL) < 0)
+		{
+			if (m_InstallationPage->EdFilepath->IsFocused() &&
+				m_InstallationPage->EdFilepath->GetSelText() == m_InstallationPage->EdFilepath->GetText())
+			{
+				m_InstallationPage->EdFilepath->Copy();
+			}
+		}
+	}
+
+
+	break;
+	}
+	return 0;
+}
+
+
+
+void CFrameWnd::Notify(TNotifyUI& msg)
+{
+	SlotMsg(msg);
+	LayoutNotify(msg);
+	return WindowImplBase::Notify(msg);
+}
+
+void CFrameWnd::LayoutNotify(TNotifyUI& msg)
+{
+	switch (m_State.m_LayoutType)
+	{
+	case LayoutType::Home:
+		NotifyHome(msg);
+		break;
+	case LayoutType::Installing:
+		NotifyInstalling(msg);
+		break;
+	case LayoutType::Installed:
+		NotifyInstalled(msg);
+		break;
+	default:
+		break;
+	}
+}
+
+#pragma endregion
+
+
+//自定义安装,收缩展开窗口大小
+void CFrameWnd::CustomInstallWndSize(bool isExpend)
+{
+	if (isExpend)
+	{
+		std::wstring textcontent = CLanguage::GetText(TextType::Btn_CutomInstall);
+		m_InstallationPage->CheckInstallSetting->SetText(textcontent.c_str());
+		m_InstallationPage->Lbicon->SetText(L"▲");
+		::GetClientRect(*this, &start_rect_);
+		SetWindowPos(m_hWnd, NULL, 0, 0, XML_WndExpendWidth * dpi, XML_WndExpenHeight * dpi, SWP_NOMOVE);
+		ischeckCustom = true;
+		m_pm.SetDPI(CurrentDPI);
+	}
+	else
+	{
+		std::wstring textcontent = CLanguage::GetText(TextType::Btn_CutomInstall);
+		m_InstallationPage->Lbicon->SetText(L"▼");
+		m_InstallationPage->CheckInstallSetting->SetText(textcontent.c_str());
+		::GetClientRect(*this, &start_rect_);
+		SetWindowPos(m_hWnd, NULL, 0, 0, XML_WndWidth * dpi, XML_WndHeight * dpi, SWP_NOMOVE);
+		ischeckCustom = false;
+		m_pm.SetDPI(CurrentDPI);
+	}
+}
+//if (msg.sType == _T("link"))
+//{
+//	if (control == UI_TextShowContentLink)
+//	{
+//		DuiLib::CTextUI* pText = (DuiLib::CTextUI*)msg.pSender;
+//		int index = (msg.wParam == 0 ? 0 : 1);
+//		DuiLib::CDuiString* str = pText->GetLinkContent(index);
+//		ShellExecute(NULL, _T("open"), str->GetData(), NULL, NULL, SW_SHOWNORMAL);
+//	}
+//}

+ 8 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp

@@ -221,3 +221,11 @@ LanguageType CLanguage::GetLocalLanguage(bool isGetText)
 }
 
 #pragma endregion
+
+#pragma region UIÎÄ°¸×Ö·ûÀàÐÍת»»
+CDuiString CLanguage::GetDuiText(TextType textType)
+{
+    CDuiString duiStr(CLanguage::GetText(textType).c_str());
+    return duiStr;
+}
+#pragma endregion

+ 4 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.h

@@ -1,7 +1,7 @@
 #pragma once
 #include<string>
 #include<Windows.h>
-
+#include "duilib.h"
 #pragma region 文件说明
 
 ///备注时间:2022/11/26
@@ -84,6 +84,9 @@ private:
 	static LanguageType LastLanguage;//上次选择的语言,或程序初始化时
 
 public:
+#pragma region UI文案字符类型转换
+	static CDuiString GetDuiText(TextType textType);
+#pragma endregion
 	/// <summary>
 	/// //获取当前系统显示的语言种类
 	/// </summary>

+ 32 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMainPage.cpp

@@ -0,0 +1,32 @@
+#include "CMainPage.h"
+
+DUI_BEGIN_MESSAGE_MAP(CMainPage, CNotifyPump)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_CLICK, OnClick)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_SELECTCHANGED, OnSelectChanged)
+DUI_ON_MSGTYPE(DUI_MSGTYPE_ITEMCLICK, OnItemClick)
+DUI_END_MESSAGE_MAP()
+
+CMainPage::CMainPage()
+{
+	m_pPaintManager = NULL;
+}
+
+void CMainPage::SetPaintMagager(CPaintManagerUI* pPaintMgr)
+{
+	m_pPaintManager = pPaintMgr;
+}
+
+void CMainPage::OnClick(TNotifyUI& msg)
+{
+
+}
+
+void CMainPage::OnSelectChanged(TNotifyUI& msg)
+{
+
+}
+
+void CMainPage::OnItemClick(TNotifyUI& msg)
+{
+
+}

+ 53 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CMainPage.h

@@ -0,0 +1,53 @@
+#pragma once
+//核心
+#include "CAccessRegedit.h"
+#include "CDownLoadFile.h"
+#include "CCmd.h"
+//字符与通用
+#include "CLanguage.h"
+#include "CClasses.h"
+#include "DefineStr.h"
+//系统与资源
+#include <WinInet.h>//网络
+#include <thread>
+#include "resource.h"
+//UI
+#include "CMsgWnd.h"
+#include "CAdsBanner.h"
+#include "InstallPage.h"
+#include "InstallingPage.h"
+#include "InstalledPage.h"
+#include "MessageBoxWnd.h"
+
+class CMainPage : public CNotifyPump
+{
+public:
+	CMainPage();
+
+public:
+	void SetPaintMagager(CPaintManagerUI* pPaintMgr);
+
+	DUI_DECLARE_MESSAGE_MAP()
+    virtual void OnClick(TNotifyUI& msg);
+	virtual void OnSelectChanged(TNotifyUI& msg);
+	virtual void OnItemClick(TNotifyUI& msg);
+
+private:
+	CPaintManagerUI* m_pPaintManager;
+};
+
+typedef struct ThreadData
+{
+public:
+	struct CFrameWnd* pFrame;
+}ThreadData;
+
+typedef struct CurrentState
+{
+public:
+	enum class LayoutType m_LayoutType = LayoutType::Home;
+	enum class VertionResultType m_VertionResultType = VertionResultType::None;
+	enum class InstallStateType m_InstallStateType = InstallStateType::None;
+
+
+}CurrentState;

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h

@@ -8,7 +8,7 @@ class CharConvert
 {
 
 #pragma region Unicode和ANSI
-
+public:
 	/// <summary>
 	/// 多字节字符转换为宽字符
 	/// </summary>

+ 2 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineStr.h

@@ -33,7 +33,7 @@
 
 #pragma region ³¬Á´½Ó
 
-#define TermsOfService L"https://www.pdfreaderpro.com/terms_of_service"
-#define PrivacyPolicy  L"https://www.pdfreaderpro.com/privacy-policy"
+#define TermsOfServiceLink L"https://www.pdfreaderpro.com/terms_of_service"
+#define PrivacyPolicyLink  L"https://www.pdfreaderpro.com/privacy-policy"
 
 #pragma endregion

+ 193 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DeviceProduct.cpp

@@ -0,0 +1,193 @@
+#include "DeviceProduct.h"
+DeviceProduct::DeviceProduct()
+{
+
+}
+
+DeviceProduct::DeviceProduct(wstring ProductName)
+{
+	m_ProductName = ProductName;
+	AccessKey();
+}
+
+DeviceProduct::~DeviceProduct()
+{
+
+}
+
+wstring DeviceProduct::GetVersion()
+{
+	return m_ProductName;
+}
+
+wstring DeviceProduct::GetInstallLocation()
+{
+	return m_InstallLocation;
+}
+
+VertionResultType DeviceProduct::AccessKey()
+{
+	long lRet;
+	HKEY hKey;
+	LPCTSTR lpSubKey;
+
+	lpSubKey = RegeditCore::smPath_ProductsInfo.c_str();
+	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
+	VertionResultType state = VertionResultType::None;
+
+	if (lRet == ERROR_SUCCESS)
+	{
+		state = FoundAllProducts(hKey);
+	}
+
+	return state;
+}
+
+
+
+VertionResultType DeviceProduct::AccessSubKey(std::wstring AppKey)
+{
+	VertionResultType state = VertionResultType::None;
+	long lRet;
+	HKEY hKey;
+	LPCTSTR lpSubKey;
+
+	AppKey = RegeditCore::smPath_ProductsInfo + L"\\" + AppKey;
+	lpSubKey = AppKey.c_str();
+	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
+	
+	if (lRet == ERROR_SUCCESS)
+	{
+		state = FindProductInfo(hKey, lpSubKey);
+	}
+	else
+	{
+		m_Version = L"";
+	}
+	
+	return state;
+}
+
+
+VertionResultType DeviceProduct::FoundAllProducts(HKEY hKey)
+{
+	VertionResultType state = VertionResultType::None;
+	DWORD index = 0;
+	TCHAR szKeyName[255] = { 0 };
+	DWORD dwKeyLen = 255;
+	wstring strBuffer;
+
+	while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, index, szKeyName, &dwKeyLen, 0, NULL, NULL, NULL))
+	{
+		index++;
+		wstring temp(szKeyName);
+		strBuffer = temp;
+
+		if (!strBuffer.empty())
+		{
+			state = AccessSubKey(strBuffer);
+			dwKeyLen = 255;
+			memset(szKeyName, 0, 255);
+			if (state != VertionResultType::None)
+				return state;
+
+			continue;
+		}
+		dwKeyLen = 255;
+		memset(szKeyName, 0, 255);
+	}
+
+	return state;
+}
+
+
+
+VertionResultType DeviceProduct::FindProductInfo(HKEY hKey, LPCTSTR lpSubKey)
+{
+	VertionResultType state = VertionResultType::None;
+	DWORD dwType = REG_BINARY | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ | REG_NONE | REG_SZ | REG_DWORD_LITTLE_ENDIAN | REG_DWORD_BIG_ENDIAN | REG_LINK | REG_RESOURCE_LIST | REG_FULL_RESOURCE_DESCRIPTOR | REG_RESOURCE_REQUIREMENTS_LIST | REG_QWORD_LITTLE_ENDIAN;
+	HKEY hkRKey;
+
+	DWORD index = 0;
+	TCHAR szKeyName[255] = { 0 };
+	DWORD dwKeyLen = 255;
+	wstring strBuffer;
+	wstring strMidReg;
+	TCHAR szBufferAppInfo[255] = { 0 };
+	DWORD dwNameLen = 255;
+
+	//遍历已安装程序
+	while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, index, szKeyName, &dwKeyLen, 0, NULL, NULL, NULL))
+	{
+		//获取已安装程序的节点
+		index++;
+		wstring nodeTemp(szKeyName);
+		strBuffer = nodeTemp;
+
+		if (!strBuffer.empty())
+		{
+			wstring nodePathTemp(L"\\" + strBuffer);
+			strMidReg = lpSubKey + nodePathTemp;
+
+			if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, strMidReg.c_str(), 0, KEY_ALL_ACCESS | KEY_WOW64_64KEY, &hkRKey) == ERROR_SUCCESS)
+			{
+				RegQueryValueEx(hkRKey, L"DisplayName", 0, &dwType, (LPBYTE)szBufferAppInfo, &dwNameLen);
+
+				wstring displayNameTemp(szBufferAppInfo);
+
+				if (displayNameTemp == m_ProductName)
+				{
+					RegQueryValueEx(hkRKey, L"DisplayVersion", 0, &dwType, (LPBYTE)szBufferAppInfo, &dwNameLen);
+
+					wstring displayVersionTemp(szBufferAppInfo);
+
+				/*	if (displayVersionTemp.find(VersionFromXML) != -1)
+					{
+						dwNameLen = 255;
+						memset(szBufferAppInfo, 0, 255);
+
+						state = VertionResultType::Same;
+					}
+					else
+					{
+						int n = displayVersionTemp.compare(VersionFromXML);
+						if (n < 0)
+						{
+							state = VertionResultType::Low;
+						}
+						else
+						{
+							state = VertionResultType::Hight;
+						}
+
+					}
+*/
+
+
+					m_Version = displayVersionTemp;
+
+
+					RegQueryValueEx(hkRKey, L"InstallLocation", 0, &dwType, (LPBYTE)szBufferAppInfo, &dwNameLen);
+
+					wstring installLocationTemp(szBufferAppInfo);
+					m_InstallLocation = installLocationTemp;
+
+					dwNameLen = 255;
+					memset(szBufferAppInfo, 0, 255);
+					return state;
+				}
+
+				dwNameLen = 255;
+				memset(szBufferAppInfo, 0, 255);
+
+			}
+			
+			dwKeyLen = 255;
+			memset(szKeyName, 0, 255);
+		}
+
+		return state;
+	}
+}
+
+

+ 67 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DeviceProduct.h

@@ -0,0 +1,67 @@
+#pragma once
+#include "CClasses.h"
+#include <string>
+
+
+
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "CAccessRegedit.h"
+#include <fstream>
+#include <urlmon.h>
+#pragma comment(lib, "urlmon.lib")Pro
+#include <Shlwapi.h>
+#pragma comment(lib,"shlwapi.lib")
+#include <atlconv.h>
+
+#include <WinInet.h> 
+
+#pragma comment(lib,"wininet.lib") 
+
+#define MAXBLOCKSIZE 1024
+
+
+#include <shlobj.h>
+#include <atlstr.h>
+#include <json/reader.h>
+#include "KeyVar.h"
+
+#include <Windows.h>
+#include "CDownLoadFile.h"
+#include<profinfo.h>
+#include "CharConvert.h"
+#include "KeyVar.h"
+
+
+using namespace std;
+class DeviceProduct
+{
+public:
+	DeviceProduct(wstring ProductName);
+	~DeviceProduct();
+private:
+	DeviceProduct();
+private:
+	wstring VersionFromXML;
+	wstring m_Version;
+	wstring m_ProductName;
+	wstring m_InstallLocation;
+public:
+	wstring GetVersion();
+	wstring GetInstallLocation();
+private:
+	/// <summary>
+	/// 访问注册表
+	/// </summary>
+	/// <param name="AppKey">注册表的产品标识</param>
+	/// <returns></returns>
+	VertionResultType AccessKey();
+
+	//查找
+	VertionResultType FoundAllProducts(HKEY hKey);
+	//产品注册表信息
+	VertionResultType FindProductInfo(HKEY hKey, LPCTSTR lpSubKey);
+
+	VertionResultType AccessSubKey(wstring AppKey);
+
+};

+ 17 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Documentation.h

@@ -0,0 +1,17 @@
+/*
+ПоДїОДµµЈє
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+*/

+ 62 - 15
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp

@@ -1,9 +1,20 @@
 #include "FileCore.h"
 #include "stdafx.h"
+#include "KeyVar.h"
+
+#pragma region 文件
+
+bool FileCore::IsExistTheFileW(wstring filePath)
+{
+	bool isExist = PathFileExistsW(filePath.c_str());
+	return isExist;
+}
+#pragma endregion
+
 
 #pragma region 文件夹
 
-wstring FileCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar)
+wstring FolderCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar)
 {
 	while (true)
 	{
@@ -24,24 +35,24 @@ wstring FileCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstrin
 	return saveFilePath;
 }
 
-wstring FileCore::GetOrCreateFolderPath(wstring saveFilePath)
+wstring FolderCore::GetOrCreateFolderPath(wstring saveFilePath)
 {
-	wstring newSaveFolder = AppCore::GetNewSaveFolder(saveFilePath, L"\\", L"/");
+	wstring newSaveFolder = FolderCore::GetNewSaveFolder(saveFilePath, L"\\", L"/");
 	BOOL isCreate = FALSE;
 	if (!PathIsDirectoryW(newSaveFolder.c_str()))
 		isCreate = CreateDirectory((newSaveFolder.c_str()), NULL);
 	return newSaveFolder;
 }
 
-bool FileCore::IsExistTheFolderW(wstring folderPath)
+bool FolderCore::IsExistTheFolderW(wstring folderPath)
 {
 	BOOL isExist = PathFileExistsW(folderPath.c_str());
 	return isExist;
 }
 
-bool FileCore::IsRootDirectoryW(wstring folderPath)
-{ 
-	int first2 = folderPath.find(L"\\");  
+bool FolderCore::IsRootDirectoryW(wstring folderPath)
+{
+	int first2 = folderPath.find(L"\\");
 	if (first2 + 1 == folderPath.length())
 	{
 		return true;
@@ -51,8 +62,7 @@ bool FileCore::IsRootDirectoryW(wstring folderPath)
 		return false;
 	}
 }
-
-wstring FileCore::CreateFolderFromRootDirW(wstring folderPath, wstring newSubFolderName)
+wstring FolderCore::AddSubFolderFromRootDirW(wstring folderPath, wstring newSubFolderName)
 {
 	if (IsRootDirectoryW(folderPath))
 	{
@@ -63,15 +73,52 @@ wstring FileCore::CreateFolderFromRootDirW(wstring folderPath, wstring newSubFol
 	return folderPath;
 }
 
-#pragma endregion
+wstring FolderCore::FolderBrowser(HWND m_hWnd)
+{
+	BROWSEINFO bi;
+	bi.hwndOwner = m_hWnd;
+	bi.pidlRoot = CSIDL_DESKTOP;//文件夹的根目录,此处为桌面
+	bi.pszDisplayName = NULL;
+	bi.lpszTitle = NULL;//显示位于对话框左上部的提示信息
+	bi.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;//有新建文件夹按钮
+	bi.lpfn = NULL;
+	bi.iImage = 0;
+	LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
+	if (pidl == NULL)
+	{
+		return L"";
+	}
+	TCHAR strFolder[MAX_PATH];
+	SHGetPathFromIDList(pidl, strFolder);
 
+	std::wstring sFolder(strFolder);
+	return sFolder;
+}
+#pragma endregion
 
+#pragma region 磁盘
+bool DiskCore::IsEnoughDisk(wstring smPath)
+{
+	auto cdDisk = smPath.substr(0, 1);
+	std::wstring str_disk_name = cdDisk + L":\\";
 
-#pragma region 文件
+	DWORD64 qwFreeBytesToCaller = 0;
+	DWORD64 qwTotalBytes = 0;
+	DWORD64 qwFreeBytes = 0;
+	//获取磁盘信息
+	BOOL bResult = GetDiskFreeSpaceExW(str_disk_name.c_str(),
+		(PULARGE_INTEGER)&qwFreeBytesToCaller,//空闲空间(字节)
+		(PULARGE_INTEGER)&qwTotalBytes,//磁盘总容量(字节)
+		(PULARGE_INTEGER)&qwFreeBytes);//可获得的空闲空间(字节)
 
-bool FileCore::IsExistTheFileW(wstring filePath)
-{
-	bool isExist = PathFileExistsW(filePath.c_str());
-	return isExist;
+	if (bResult)
+	{
+		//可用空间是否足够1G时
+		qwFreeBytesToCaller = qwFreeBytesToCaller / (1024 * 1024);
+		if (1024 > qwFreeBytesToCaller)
+			return false;
+	}
+	else
+		return true;
 }
 #pragma endregion

+ 17 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h

@@ -1,7 +1,7 @@
 #pragma once
 #include<string>
 using namespace std;
-
+#include<windows.h>
 class FileCore
 {
 #pragma region 文件
@@ -11,18 +11,30 @@ class FileCore
 #pragma endregion
 
 
-#pragma region 文件夹
 
+};
+
+class FolderCore
+{
+#pragma region 文件夹
+public:
 	static wstring GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar);
 	static wstring GetOrCreateFolderPath(wstring saveFilePath);
 
 	static bool IsExistTheFolderW(wstring folderPath);
+	//是否存在根目录
 	static bool IsRootDirectoryW(wstring folderPath);
-	static wstring CreateFolderFromRootDirW(wstring folderPath,wstring newSubFolderName);//从根目录下创建一个子文件夹
-
+	//在根目录下预设子文件夹路径,此时未创建子文件夹
+	static wstring AddSubFolderFromRootDirW(wstring folderPath, wstring newSubFolderName);
+	//文件夹选择器
+	static wstring FolderBrowser(HWND m_hWnd);
 #pragma endregion
 
 
-
 };
 
+class DiskCore
+{
+public:
+	static bool IsEnoughDisk(wstring smPath);
+};

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp

@@ -40,7 +40,6 @@ void InstallationPage::InitControls()
 	Lbicon = static_cast<CButtonUI*>(m_pm->FindControl(UI_Lbicon));
 
 	BtnClose = static_cast<CButtonUI*>(m_pm->FindControl(UI_BtnClose));
-	containerCloseNone = static_cast<CContainerUI*>(m_pm->FindControl(UI_containerCloseNone));
 }
 
 void InstallationPage::InitLanguage()

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h

@@ -49,7 +49,6 @@ public:
 	CButtonUI* Lbicon;
 
 	CButtonUI* BtnClose;
-	CContainerUI* containerCloseNone;
 public:
 	void InitControls();
 	void InitLanguage();

+ 7 - 7
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp

@@ -26,18 +26,18 @@ void InstalledPage::InitControls()
 
 void InstalledPage::InitLanguage()
 {
-	BtnOpenApp->SetText(UIstr(TextType::Btn_OpenApp));
+	BtnOpenApp->SetText(CLanguage::GetDuiText(TextType::Btn_OpenApp));
 	std::wstring ss = CLanguage::GetText(TextType::Btn_GoToFilesPath) + PathCore::smPath_Install;
 	LbInstalledPath->SetText(ss.c_str());
 }
 
-CDuiString InstalledPage::UIstr(TextType textType)
-{
-	CDuiString duiStr(CLanguage::GetText(textType).c_str());
-	return duiStr;
-}
-
 void InstalledPage::InitValue()
 {
 
+}
+void InstalledPage::RefreshInstalledPath(wstring sFolder)
+{
+	LbInstalledPath->SetToolTipWidth(LbInstalledPath->GetWidth());
+	LbInstalledPath->SetToolTip(sFolder.c_str());
+	LbInstalledPath->SetText(sFolder.c_str());
 }

+ 9 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h

@@ -20,10 +20,17 @@ public:
 	CLabelUI* InstallationfolderTitle;
 	CButtonUI* BtnOpenApp;
 	CLabelUI* Lbicon;
-public:
+private:
 	void InitControls();
 	void InitLanguage();
 	void InitValue();
-	CDuiString UIstr(TextType textType);
+
+#pragma region UI½çÃæ±ä»¯
+public:
+	void RefreshInstalledPath(wstring sFolder);
+
+#pragma endregion
+
+
 };
 

+ 25 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.cpp

@@ -1,4 +1,6 @@
 #include "InstallingPage.h"
+#define HaveNetColor 0xFF477EDE
+#define NoNetColor 0xFFB5B6B8
 
 InstallingPage::InstallingPage(CPaintManagerUI* m_pm)
 {
@@ -43,4 +45,26 @@ CDuiString InstallingPage::UIstr(TextType textType)
 void InstallingPage::InitValue()
 {
 
-}
+}
+
+#pragma region UI½çÃæ±ä»¯
+
+void InstallingPage::NetWorkUI(bool isNet)
+{
+	if (isNet)
+	{
+		ConNoNetWork->SetVisible(false);
+		pTabSwitch->SetVisible(true);
+		InstallingProgress->SetForeColor(HaveNetColor);
+		installNotWork->SetText(CLanguage::GetDuiText(TextType::Text_Installing));
+	}
+	else
+	{
+		ConNoNetWork->SetVisible(true);
+		pTabSwitch->SetVisible(false);
+		InstallingProgress->SetForeColor(NoNetColor);
+		installNotWork->SetText(CLanguage::GetDuiText(TextType::Text_NoNetwork));
+	}
+}
+
+#pragma endregion

+ 8 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h

@@ -29,5 +29,13 @@ public:
 	void InitLanguage();
 	void InitValue();
 	CDuiString UIstr(TextType textType);
+
+#pragma region UI界面变化
+public:
+	//网络状态UI改变,isNet是否有网络
+	void NetWorkUI(bool isNet);
+
+#pragma endregion
+
 };
 

+ 1 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.cpp

@@ -12,6 +12,7 @@ const wstring Product::smName_Application = L"PDFReaderProWin.exe";
 #pragma region ³ÌÐò
 
 const wstring ExeCore::smName_ExeProcess = L"PDFReaderPro_Installer.exe";
+const wstring ExeCore::smName_AppName = L"PDF Reader Pro";
 
 #pragma endregion
 

+ 1 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h

@@ -33,6 +33,7 @@ static class ExeCore
 
 public:
 	static const wstring smName_ExeProcess;//后台任务管理器,主窗口进程名
+	static const wstring smName_AppName;//程序exe名称
 
 };
 #pragma endregion

+ 56 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.cpp

@@ -0,0 +1,56 @@
+#include "MessageBoxWnd.h"
+
+int MessageBoxWnd::Show(HWND m_hWnd,MessageContentType Content)
+{
+	int result = 0;
+	switch (Content)
+	{
+	case MessageContentType::LongInstallingPath:
+		result = CMsgWnd::MessageBox(
+			m_hWnd, _T(""), L"安装失败,原因是系统不支持过长的安装路径。系统已回退到安装前的状态;请重新修改安装路径。",
+			CLanguage::GetText(TextType::MSG_BtnOK).c_str()
+		);
+		break;
+	case MessageContentType::IsExitApp:
+		result = CMsgWnd::MessageBox(
+			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_IsExitApp).c_str(),
+			CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
+			CLanguage::GetText(TextType::MSG_BtnNo).c_str()
+		);
+		break;
+	case MessageContentType::InstalledIsExitApp:
+		result = CMsgWnd::MessageBox(
+			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_InstalledIsExitApp).c_str(),
+			CLanguage::GetText(TextType::MSG_BtnYes).c_str(),
+			CLanguage::GetText(TextType::MSG_BtnNo).c_str()
+		);
+		break;
+	case MessageContentType::DiskNoSpace:
+		result = CMsgWnd::MessageBox(
+			m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_DiskNoSpace).c_str(),
+			CLanguage::GetText(TextType::MSG_BtnOK).c_str()
+		);
+		break;
+
+	default:
+		break;
+	}
+	return result;
+}
+
+int MessageBoxWnd::Show(HWND m_hWnd, MessageContentType Content, wstring parameter)
+{
+	int result = 0;
+	switch (Content)
+	{
+	case MessageContentType::InstallingFailed:
+		result = CMsgWnd::MessageBox(
+			m_hWnd, _T(""), parameter.c_str(),
+			L"打开安装路径"
+		);
+		break;
+	default:
+		break;
+	}
+	return result;
+}

+ 21 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.h

@@ -0,0 +1,21 @@
+#pragma once
+#include "CMsgWnd.h"
+#include <wtypes.h>
+#include "CLanguage.h"
+
+enum class MessageContentType
+{
+	LongInstallingPath,//安装路径过长
+	InstallingFailed,//特殊原因安装失败
+	IsExitApp,//在未安装下,是否退出程序
+	InstalledIsExitApp,//安装完成后,是否退出程序
+	DiskNoSpace//磁盘空间不足
+};
+
+class MessageBoxWnd
+{
+public:
+	static int Show(HWND m_hWnd, MessageContentType Content);
+	static int Show(HWND m_hWnd, MessageContentType Content,wstring parameter);
+};
+

+ 21 - 17
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.cpp

@@ -1,34 +1,31 @@
-#include "XmlNode.h"
-#include "KeyVar.h"
-XmlNode::XmlNode()
+#include "OnlineVersion.h"
+
+OnlineVersion::OnlineVersion()
 {
 	pDocument = new TiXmlDocument();
 
 }
-XmlNode::~XmlNode()
+OnlineVersion::~OnlineVersion()
 {
 	delete pDocument;
 	pDocument = nullptr;
 }
 
-const char* XmlNode::GetInstallPageVersion()
+const char* OnlineVersion::GetInstallPageVersion()
 {
+	//下载xml文件
 	auto SaveFolder = AppCore::GetOrCreateFolderPath(PathCore::smPath_Temp) + L"/" + L"test.xml";
 	HRESULT Hfile = URLDownloadToFile(NULL, Product::URI_AppXml.c_str(), SaveFolder.c_str(), 0, NULL);
 
-	//宽字符转多字节字符
-	char* pStr;
-	int iwstrLen = WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, 0, 0, 0, 0);
-	pStr = new char[iwstrLen + 1];
-	memset(pStr, 0, sizeof(char) * (iwstrLen + 1));
-	WideCharToMultiByte(CP_ACP, 0, SaveFolder.c_str(), -1, pStr, iwstrLen, 0, 0);
+	char* pStr = CharConvert::GetMultiByteW(SaveFolder.c_str());
 
-	return LoadXML(pStr);
+	return LoadXmlA(pStr);
 }
 
 
-const char* XmlNode::LoadXML(const char* xmlStr)
+const char* OnlineVersion::LoadXmlA(const char* xmlStr)
 {
+	//加载xml文件
 	if (pDocument == NULL)
 		pDocument = new TiXmlDocument();
 
@@ -38,28 +35,30 @@ const char* XmlNode::LoadXML(const char* xmlStr)
 	}
 
 	
-	return GetVersionFromXML();
+	return GetVersionFromXmlA();
 }
 
-const char* XmlNode::GetVersionFromXML()
+const char* OnlineVersion::GetVersionFromXmlA()
 {
+	//解析xml
 	TiXmlElement* pRootElement = pDocument->RootElement();
 	if (NULL == pRootElement)
 	{
 		return "";
 	}
+
 	TiXmlElement* xml_host = pRootElement->FirstChildElement("channel");
 	if (xml_host == pRootElement || xml_host == NULL)
 	{
 		return "";
 	}
-	//	const char* text = xml_host->GetText();
+
 	TiXmlElement* item = xml_host->FirstChildElement("item");
 	if (item == NULL)
 	{
 		return "";
 	}
-	//	
+
 	TiXmlElement* enclosure = item->FirstChildElement("enclosure");
 	if (enclosure == NULL)
 	{
@@ -74,3 +73,8 @@ const char* XmlNode::GetVersionFromXML()
 	return version;
 }
 
+
+wstring OnlineVersion::GetVersionW()
+{
+	return CharConvert::GetWideCharW(&m_Verstion);
+}

+ 21 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineVersion.h

@@ -0,0 +1,21 @@
+#pragma once
+#include "AppCore.h"
+#include "tinyxml/tinyxml.h"
+#include "KeyVar.h"
+#include "CharConvert.h"
+class OnlineVersion
+{
+private:
+	string m_Verstion;
+	TiXmlDocument* pDocument;
+public:
+	OnlineVersion();
+	~OnlineVersion();
+public:
+	const char* GetInstallPageVersion();
+	wstring GetVersionW();
+private:
+	const char* LoadXmlA(const char* xmlStr);
+	const char* GetVersionFromXmlA();
+};
+

+ 10 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj

@@ -165,23 +165,26 @@
     <ClInclude Include="CFrameWnd.h" />
     <ClInclude Include="CharConvert.h" />
     <ClInclude Include="CLanguage.h" />
+    <ClInclude Include="CMainPage.h" />
     <ClInclude Include="CMsgWnd.h" />
     <ClInclude Include="CSystemInfo.h" />
     <ClInclude Include="CAdsBanner.h" />
     <ClInclude Include="DefineStr.h" />
     <ClInclude Include="DefineUI.h" />
+    <ClInclude Include="DeviceProduct.h" />
     <ClInclude Include="duilib.h" />
     <ClInclude Include="FileCore.h" />
     <ClInclude Include="InstallPage.h" />
     <ClInclude Include="InstalledPage.h" />
     <ClInclude Include="InstallingPage.h" />
     <ClInclude Include="KeyVar.h" />
+    <ClInclude Include="MessageBoxWnd.h" />
     <ClInclude Include="resource.h" />
     <ClInclude Include="stdafx.h" />
     <ClInclude Include="tinyxml\tinystr.h" />
     <ClInclude Include="tinyxml\tinyxml.h" />
-    <ClInclude Include="UIwnd.h" />
-    <ClInclude Include="XmlNode.h" />
+    <ClInclude Include="Documentation.h" />
+    <ClInclude Include="OnlineVersion.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="CAccessRegedit.cpp" />
@@ -190,14 +193,18 @@
     <ClCompile Include="AppCore.cpp" />
     <ClCompile Include="CDownLoadFile.cpp" />
     <ClCompile Include="CFrameWnd.cpp" />
+    <ClCompile Include="CFrameWndInit.cpp" />
     <ClCompile Include="CharConvert.cpp" />
     <ClCompile Include="CLanguage.cpp" />
+    <ClCompile Include="CMainPage.cpp" />
     <ClCompile Include="CMsgWnd.cpp" />
     <ClCompile Include="CSystemInfo.cpp" />
     <ClCompile Include="CAdsBanner.cpp" />
+    <ClCompile Include="DeviceProduct.cpp" />
     <ClCompile Include="FileCore.cpp" />
     <ClCompile Include="InstallPage.cpp" />
     <ClCompile Include="KeyVar.cpp" />
+    <ClCompile Include="MessageBoxWnd.cpp" />
     <ClCompile Include="tinyxml\tinystr.cpp" />
     <ClCompile Include="tinyxml\tinyxml.cpp" />
     <ClCompile Include="tinyxml\tinyxmlerror.cpp" />
@@ -213,7 +220,7 @@
     <ClCompile Include="src\lib_json\json_value.cpp" />
     <ClCompile Include="src\lib_json\json_writer.cpp" />
     <ClCompile Include="stdafx.cpp" />
-    <ClCompile Include="XmlNode.cpp" />
+    <ClCompile Include="OnlineVersion.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="PDFReaderPro_Insrtaller.rc" />

+ 60 - 27
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters

@@ -61,17 +61,23 @@
     <Filter Include="头文件\Core">
       <UniqueIdentifier>{2c1621fb-6b68-4bea-a305-ab3817baa02a}</UniqueIdentifier>
     </Filter>
+    <Filter Include="头文件\Core\Product">
+      <UniqueIdentifier>{027a50e4-aaab-42f0-bc7b-6cb08909667e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="源文件\Core\Product">
+      <UniqueIdentifier>{e94d04c5-58e5-4427-ad97-88bb27919ee5}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="头文件\Core\Log">
+      <UniqueIdentifier>{a5b5c087-560f-40ab-93f7-30e1a5c19132}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="源文件\Core\Log">
+      <UniqueIdentifier>{20abcaa6-ab7b-4a21-8656-74f2046aba5d}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="CAccessRegedit.h">
       <Filter>头文件\Core</Filter>
     </ClInclude>
-    <ClInclude Include="CDownLoadFile.h">
-      <Filter>头文件\Core</Filter>
-    </ClInclude>
-    <ClInclude Include="CAdsBanner.h">
-      <Filter>头文件\Core</Filter>
-    </ClInclude>
     <ClInclude Include="CCmd.h">
       <Filter>头文件\Core</Filter>
     </ClInclude>
@@ -84,9 +90,6 @@
     <ClInclude Include="CLanguage.h">
       <Filter>头文件\strings</Filter>
     </ClInclude>
-    <ClInclude Include="CSystemInfo.h">
-      <Filter>头文件\Core</Filter>
-    </ClInclude>
     <ClInclude Include="DefineStr.h">
       <Filter>头文件\strings</Filter>
     </ClInclude>
@@ -96,9 +99,6 @@
     <ClInclude Include="tinyxml\tinyxml.h">
       <Filter>Library\tinyxml</Filter>
     </ClInclude>
-    <ClInclude Include="XmlNode.h">
-      <Filter>Library\LibraryOrSystem</Filter>
-    </ClInclude>
     <ClInclude Include="stdafx.h">
       <Filter>Library\LibraryOrSystem</Filter>
     </ClInclude>
@@ -123,9 +123,6 @@
     <ClInclude Include="CMsgWnd.h">
       <Filter>头文件\Layout\UX</Filter>
     </ClInclude>
-    <ClInclude Include="UIwnd.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
     <ClInclude Include="FileCore.h">
       <Filter>头文件\CoreApp</Filter>
     </ClInclude>
@@ -138,17 +135,35 @@
     <ClInclude Include="DefineUI.h">
       <Filter>头文件\Layout\UI</Filter>
     </ClInclude>
+    <ClInclude Include="Documentation.h">
+      <Filter>头文件\strings</Filter>
+    </ClInclude>
+    <ClInclude Include="MessageBoxWnd.h">
+      <Filter>头文件\Layout\UI</Filter>
+    </ClInclude>
+    <ClInclude Include="DeviceProduct.h">
+      <Filter>头文件\Core\Product</Filter>
+    </ClInclude>
+    <ClInclude Include="OnlineVersion.h">
+      <Filter>头文件\Core\Product</Filter>
+    </ClInclude>
+    <ClInclude Include="CDownLoadFile.h">
+      <Filter>头文件\Core\Product</Filter>
+    </ClInclude>
+    <ClInclude Include="CAdsBanner.h">
+      <Filter>头文件\Core\Product</Filter>
+    </ClInclude>
+    <ClInclude Include="CSystemInfo.h">
+      <Filter>头文件\Core\Log</Filter>
+    </ClInclude>
+    <ClInclude Include="CMainPage.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="CAccessRegedit.cpp">
       <Filter>源文件\Core</Filter>
     </ClCompile>
-    <ClCompile Include="CDownLoadFile.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
-    <ClCompile Include="CAdsBanner.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
     <ClCompile Include="CCmd.cpp">
       <Filter>源文件\Core</Filter>
     </ClCompile>
@@ -170,9 +185,6 @@
     <ClCompile Include="src\lib_json\json_writer.cpp">
       <Filter>Library\json</Filter>
     </ClCompile>
-    <ClCompile Include="CSystemInfo.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
     <ClCompile Include="main.cpp">
       <Filter>源文件\Core</Filter>
     </ClCompile>
@@ -218,9 +230,6 @@
     <ClCompile Include="stdafx.cpp">
       <Filter>Library\LibraryOrSystem</Filter>
     </ClCompile>
-    <ClCompile Include="XmlNode.cpp">
-      <Filter>Library\LibraryOrSystem</Filter>
-    </ClCompile>
     <ClCompile Include="FileCore.cpp">
       <Filter>源文件\CoreApp</Filter>
     </ClCompile>
@@ -230,6 +239,30 @@
     <ClCompile Include="KeyVar.cpp">
       <Filter>源文件\CoreApp</Filter>
     </ClCompile>
+    <ClCompile Include="MessageBoxWnd.cpp">
+      <Filter>源文件\Layout\UI</Filter>
+    </ClCompile>
+    <ClCompile Include="DeviceProduct.cpp">
+      <Filter>源文件\Core\Product</Filter>
+    </ClCompile>
+    <ClCompile Include="OnlineVersion.cpp">
+      <Filter>源文件\Core\Product</Filter>
+    </ClCompile>
+    <ClCompile Include="CDownLoadFile.cpp">
+      <Filter>源文件\Core\Product</Filter>
+    </ClCompile>
+    <ClCompile Include="CAdsBanner.cpp">
+      <Filter>源文件\Core\Product</Filter>
+    </ClCompile>
+    <ClCompile Include="CSystemInfo.cpp">
+      <Filter>源文件\Core\Log</Filter>
+    </ClCompile>
+    <ClCompile Include="CMainPage.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="CFrameWndInit.cpp">
+      <Filter>源文件\Layout\UX</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="PDFReaderPro_Insrtaller.rc">

+ 0 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/UIwnd.h


+ 2 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp

@@ -88,7 +88,7 @@ void CFrameWnd::SetTimerBanner()
 	m_bOnline = InternetGetConnectedState(&flags, 0);
 	if (m_bOnline)
 	{
-		KillTimer(m_hWnd, TIMER_WAITDOWNLOAD_ID);
+		KillAllTimer();
 		CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::DownLoading;
 
 		m_InstallingPage->ConNoNetWork->SetVisible(false);
@@ -114,7 +114,7 @@ void CFrameWnd::SetTimerBannerSwitch()
 
 void CFrameWnd::SetBannerOnTimer()
 {
-	KillTimer(m_hWnd, TIMER_WAITDOWNLOAD_ID);
+	KillAllTimer();
 	SetTimer(m_hWnd, TIMER_WAITDOWNLOAD_ID, TIMER_WAITDOWNLOAD_TIMES, NULL);
 }
 

+ 35 - 163
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstall.cpp

@@ -1,8 +1,4 @@
-#include "stdafx.h"
-//#include "duilib.h"
-
 #include "CFrameWnd.h"
-#include "KeyVar.h"
 
 #pragma region 初始化
 
@@ -28,64 +24,45 @@ LRESULT CFrameWnd::HomeMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
 /// </summary>
 void CFrameWnd::NotifyHome(TNotifyUI& msg)
 {
+	CDuiString control = msg.pSender->GetName();
+
 	if (msg.sType == _T("click"))
 	{
-
 		//打开路径选择
-		if (msg.pSender->GetName() == UI_BtnTextSelectFolder || msg.pSender->GetName() == UI_BtnIconSelectFolder)
+		if (control == UI_BtnTextSelectFolder || control == UI_BtnIconSelectFolder)
 		{
 			SetSelectedFolder();
 		}
 
-		if (msg.pSender->GetName() == UI_BtnTermsService)
+		if (control == UI_BtnTermsService)
 		{
-			GoToLink(TermsOfService);
+			GoToLink(TermsOfServiceLink);
 		}
 
-		if (msg.pSender->GetName() == UI_BtnPrivacyPolicy)
+		if (control == UI_BtnPrivacyPolicy)
 		{
-			GoToLink(PrivacyPolicy);
+			GoToLink(PrivacyPolicyLink);
 		}
 
 		//点击安装按钮
-		if (msg.pSender->GetName() == UI_BtnInstall)
+		if (control == UI_BtnInstall)
 		{
 			Install_Click();
 		}
 
 		//显示隐藏自定义安装路径区域
-		if (msg.pSender->GetName() == UI_CheckInstallSetting || msg.pSender->GetName() == UI_Lbicon) {
+		if (control == UI_CheckInstallSetting || control == UI_Lbicon) {
 			{
-				if (msg.pSender->GetName() == UI_Lbicon)
+				if (control == UI_Lbicon)
 				{
 					m_InstallationPage->CheckInstallSetting->SetCheck(!m_InstallationPage->CheckInstallSetting->IsSelected());
 				}
 
-				WindowSize();
+				CustomInstallWndSize(m_InstallationPage->CheckInstallSetting->IsSelected());
 			}
 		}
 		
 	}
-	
-	
-	if (msg.sType == _T("link"))
-	{
-		if (msg.pSender->GetName() == UI_TextShowContentLink)
-		{
-			DuiLib::CTextUI* pText = (DuiLib::CTextUI*)msg.pSender;
-			if (msg.wParam == 0)
-			{
-				DuiLib::CDuiString* str = pText->GetLinkContent(0);
-				ShellExecute(NULL, _T("open"), str->GetData(), NULL, NULL, SW_SHOWNORMAL);
-			}
-			else
-			{
-				DuiLib::CDuiString* str = pText->GetLinkContent(1);
-				ShellExecute(NULL, _T("open"), str->GetData(), NULL, NULL, SW_SHOWNORMAL);
-			}
-		}
-
-	}
 
 }
 
@@ -101,112 +78,35 @@ void CFrameWnd::GoToLink(std::wstring linkStr)
 	
 }
 
-void CFrameWnd::WindowSize()
-{
-	if (m_InstallationPage->CheckInstallSetting->IsSelected() == true)
-	{
-		std::wstring textcontent = CLanguage::GetText(TextType::Btn_CutomInstall);
-		m_InstallationPage->CheckInstallSetting->SetText(textcontent.c_str());
-		m_InstallationPage->Lbicon->SetText(L"▲");
-		::GetClientRect(*this, &start_rect_);
-		SetWindowPos(m_hWnd, NULL, 0, 0, XML_WndExpendWidth * dpi, XML_WndExpenHeight * dpi, SWP_NOMOVE);
-		ischeckCustom = true;
-		m_pm.SetDPI(CurrentDPI);
-	}
-	else
-	{
-		std::wstring textcontent = CLanguage::GetText(TextType::Btn_CutomInstall);
-		m_InstallationPage->Lbicon->SetText(L"▼");
-		m_InstallationPage->CheckInstallSetting->SetText(textcontent.c_str());
-		::GetClientRect(*this, &start_rect_);
-		SetWindowPos(m_hWnd, NULL, 0, 0, XML_WndWidth* dpi, XML_WndHeight* dpi, SWP_NOMOVE);
-		ischeckCustom = false;
-		m_pm.SetDPI(CurrentDPI);
-	}
-}
-
-bool CFrameWnd::IsSpaceDisk()
-{
-	auto cdDisk = PathCore::smPath_Install.substr(0, 1);
-	wchar_t* ptr = _wcsdup(cdDisk.c_str());
-	char* ch = AppCore::GetWideCharToMultiByte(ptr);
-	string str = ch;
-
-	std::string str_disk_name = str + ":\\";
-
-	DWORD64 qwFreeBytesToCaller = 0;
-	DWORD64 qwTotalBytes = 0;
-	DWORD64 qwFreeBytes = 0;
-	///使用GetDiskFreeSpaceEx获取磁盘信息并打印结果
-	BOOL bResult = GetDiskFreeSpaceExA(str_disk_name.c_str(),
-		(PULARGE_INTEGER)&qwFreeBytesToCaller,
-		(PULARGE_INTEGER)&qwTotalBytes,
-		(PULARGE_INTEGER)&qwFreeBytes);
-	/// 读取成功
-	if (bResult)
-	{
-		/// 如果还剩下1024M空闲空间,则禁止写入日志
-		qwFreeBytesToCaller = qwFreeBytesToCaller/(1024 * 1024);
-		if (1024 > qwFreeBytesToCaller)
-			return false;
-		//printf("使用GetDiskFreeSpaceEx获取磁盘空间信息\n");
-		//printf("可获得的空闲空间(字节): \t%I64d\n", qwFreeBytesToCaller);
-		//printf("空闲空间(字节): \t\t%I64d\n", qwFreeBytes);
-		//printf("磁盘总容量(字节): \t\t%I64d\n", qwTotalBytes);
-	}
-	/// 读取失败
-	else
-		return true;
-
-	return true;
-}
-
+//点击安装按钮
 void CFrameWnd::Install_Click()
 {
-	DWORD   flags;
-	BOOL   m_bOnline = TRUE;
-	m_bOnline = InternetGetConnectedState(&flags, 0);
-
+	
 	if (ischeckCustom)
-	{
-		m_InstallationPage->CheckInstallSetting->SetCheck(false);
-		std::wstring textcontent = CLanguage::GetText(TextType::Btn_CutomInstall);
-		m_InstallationPage->Lbicon->SetText(L"▼");
-		m_InstallationPage->CheckInstallSetting->SetText(textcontent.c_str());
-		::GetClientRect(*this, &start_rect_);
-		SetWindowPos(m_hWnd, NULL, 0, 0, XML_WndWidth* dpi, XML_WndHeight* dpi, SWP_NOMOVE);
-	}
+		CustomInstallWndSize(!ischeckCustom);
 
+	BOOL m_bOnline = NetWorkState::IsNetWorking();
 	if (m_bOnline)
 	{
-
-		bool isHaveSpace = IsSpaceDisk();
-		if (isHaveSpace == false)
+		if (DiskCore::IsEnoughDisk(PathCore::smPath_Install) == false)
 		{
-			CMsgWnd::MessageBox(
-				m_hWnd, _T(""), CLanguage::GetText(TextType::MSG_DiskNoSpace).c_str(),
-				CLanguage::GetText(TextType::MSG_BtnOK).c_str()
-			);
-
+			MessageBoxWnd::Show(m_hWnd, MessageContentType::DiskNoSpace);
 			return;
 		}
-
-		m_InstallingPage->installNotWork->SetText(CLanguage::GetText(TextType::Text_Installing).c_str());
+		
+		m_InstallingPage->installNotWork->SetText(CLanguage::GetDuiText(TextType::Text_Installing));
 		m_isCanInstall = GetVersionState();
 
 		if (m_isCanInstall)
 		{
 
 			SelectLayout(LayoutType::Installing);
-			KillTimer(m_hWnd, TIMER_BANNER_ID);
-			KillTimer(m_hWnd, TIMER_INSTALL_ID);
-
+			KillAllTimer();
 			SetTimer(m_hWnd, TIMER_BANNER_ID, TIMER_BANNER_TIMES, NULL);
 			SetTimer(m_hWnd, TIMER_INSTALL_ID, TIMER_INSTALL_TIMES, NULL);
 
-			m_InstallingPage->ConNoNetWork->SetVisible(false);
-			m_InstallingPage->pTabSwitch->SetVisible(true);
-			m_InstallingPage->InstallingProgress->SetForeColor(0xFF477EDE);
+			m_InstallingPage->NetWorkUI(m_bOnline);
+
 			thread installingThread(Thread_Installing, m_threadData);
 			installingThread.detach();
 
@@ -215,11 +115,9 @@ void CFrameWnd::Install_Click()
 	else
 	{
 		SetBannerOnTimer();
-		m_InstallingPage->ConNoNetWork->SetVisible(true);
-		m_InstallingPage->pTabSwitch->SetVisible(false);
+
+		m_InstallingPage->NetWorkUI(m_bOnline);
 		SelectLayout(LayoutType::Installing);
-		m_InstallingPage->installNotWork->SetText(CLanguage::GetText(TextType::Text_NoNetwork).c_str());
-		m_InstallingPage->InstallingProgress->SetForeColor(0xFFB5B6B8);
 		
 	}
 	
@@ -230,46 +128,25 @@ void CFrameWnd::Install_Click()
 /// </summary>
 void CFrameWnd::SetSelectedFolder()
 {
-	BROWSEINFO bi;
-	bi.hwndOwner = m_hWnd;
-	bi.pidlRoot = CSIDL_DESKTOP;//文件夹的根目录,此处为桌面
-	bi.pszDisplayName = NULL;
-	bi.lpszTitle = NULL;//显示位于对话框左上部的提示信息
-	bi.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;//有新建文件夹按钮
-	bi.lpfn = NULL;
-	bi.iImage = 0;
-	LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
-	if (pidl == NULL)
-	{
-		return;
-	}
-	TCHAR strFolder[MAX_PATH];
-	SHGetPathFromIDList(pidl, strFolder);
-
-	std::wstring sFolder(strFolder);
-
-	std::wstring sFolderTemp = AppCore::ReplaceSubStr(sFolder, L"\\", L"/");
+	wstring sFolder = FolderCore::FolderBrowser(m_hWnd);
 
-	int first2 = sFolder.find(L"\\");
-	if (first2 + 1 == sFolder.length())
+	if (FolderCore::IsRootDirectoryW(sFolder) == true)
 	{
-		int first = sFolder.find(L"\\");
-		std::wstring newStr = sFolder.substr(0, first + 1);
-		sFolder = newStr + L"PDF Reader Pro";
+		sFolder = FolderCore::AddSubFolderFromRootDirW(sFolder, ExeCore::smName_AppName);
 	}
-	else
-	{
 
-	}
-	m_InstalledPage->LbInstalledPath->SetToolTipWidth(m_InstalledPage->LbInstalledPath->GetWidth());
-	m_InstalledPage->LbInstalledPath->SetToolTip(sFolder.c_str());
-	m_InstalledPage->LbInstalledPath->SetText(sFolder.c_str());
-	bool ii =  m_InstalledPage->LbInstalledPath->GetAutoCalcWidth();
-	int iii = m_InstalledPage->LbInstalledPath->GetHeight();
+	m_InstalledPage->RefreshInstalledPath(sFolder); 
+
 	PathCore::smPath_Install = sFolder;
 	m_InstallationPage->EdFilepath->SetText(sFolder.c_str());
 }
 
+void CFrameWnd::Thread_GetVerstion(ThreadData threadData)
+{
+	threadData.pFrame->m_isCanInstall = threadData.pFrame->GetVersionState();
+}
+
+
 bool CFrameWnd::GetVersionState()
 {
 
@@ -307,9 +184,4 @@ bool CFrameWnd::GetVersionState()
 		return true;
 }
 
-void CFrameWnd::Thread_GetVerstion(ThreadData threadData)
-{
-	threadData.pFrame->m_isCanInstall = threadData.pFrame->GetVersionState();
-
-}
 

+ 6 - 12
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp

@@ -38,7 +38,6 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 	bool isDownloadSuccess = false;
 	CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::DownLoading;
 
-
 	isDownloadSuccess = downLoadFile.GetInstallPackage(PathCore::smPath_Install.c_str());
 
 	if (isDownloadSuccess == false)
@@ -63,12 +62,9 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 
 			if (AppCore::IsExistFile(exe) == false && exe.length() > 190)
 			{
-				KillTimer(threadData.pFrame->m_hWnd, TIMER_SILENTINSTALL_ID);
-				KillTimer(threadData.pFrame->m_hWnd, TIMER_BANNER_ID);
-				CMsgWnd::MessageBox(
-					threadData.pFrame->m_hWnd, _T(""), L"安装失败,原因是系统不支持过长的安装路径。系统已回退到安装前的状态;请重新修改安装路径。",
-					CLanguage::GetText(TextType::MSG_BtnOK).c_str()
-				);
+				threadData.pFrame->KillAllTimer();
+				MessageBoxWnd::Show(threadData.pFrame->m_hWnd, MessageContentType::LongInstallingPath);
+
 				DownloadProgress::Currentpercentage = 0;
 				threadData.pFrame->SelectLayout(LayoutType::Home);
 				return;//直接返回是为了避免IsExistFile判断无效;
@@ -76,10 +72,7 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 			else if (AppCore::IsExistFile(exe) == false)
 			{
 				wstring installError = L"因特殊操作,安装失败!请找到该安装路径下的\"" + Product::smName_Application + L"\"安装包进行运行安装";
-				CMsgWnd::MessageBox(
-					threadData.pFrame->m_hWnd, _T(""), installError.c_str(),
-					L"打开安装路径"
-				);
+				MessageBoxWnd::Show(threadData.pFrame->m_hWnd, MessageContentType::LongInstallingPath, installError);
 
 				wstring folderPath = L"start " + PathCore::smPath_Install;
 				char* ch = AppCore::GetWstringToCharPtr(folderPath);
@@ -94,7 +87,8 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 		}
 
 		DownloadProgress::Currentpercentage = 0;
-		KillTimer(threadData.pFrame->m_hWnd, TIMER_SILENTINSTALL_ID);
+		threadData.pFrame->KillAllTimer();
+		threadData.pFrame->KillAllTimer();
 }
 
 void CFrameWnd::SetTimerSilen()

+ 0 - 18
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.h

@@ -1,18 +0,0 @@
-#pragma once
-#include "AppCore.h"
-#include "tinyxml/tinyxml.h"
-
-class XmlNode
-{
-public:
-	XmlNode();
-	~XmlNode();
-public:
-	string m_Verstion;
-	TiXmlDocument* pDocument;
-	const char* xmlStr = "";
-	const char* LoadXML(const char* xmlStr);
-	const char* GetVersionFromXML();
-	const char* GetInstallPageVersion();
-};
-

+ 34 - 20
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp

@@ -19,36 +19,50 @@
 //方案2:更换xml界面的方式(未使用到):
 ////若要切换其他xml界面,可以继承CNotifyPump类来实现(具体实现思路,参考Duilib Demo)
 
-
-int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)
+CFrameWnd* CreateFrameWnd(HINSTANCE hInstance)
 {
+	CFrameWnd* pFrame = new CFrameWnd();
+	if (pFrame == NULL) return NULL;
 
-	//获取缓存路径  
-	AppCore::InitAppTempPath();
+	pFrame->Create(NULL, _T("MainWnd"), UI_WNDSTYLE_FRAME, 0);
+	pFrame->InitWindow();
+
+	return pFrame;
+}
 
-	string ss = "C:\\Users\\kdan\\Desktop\\1111111111111111111111111111111111112222222222222222222222222222222222\\22222222222222222222222222222222222222222222222222222222222\\3333333333333333333333333333333333333332222222222222222222222233333334567891011121\\PDFReaderPro_V2.0.0";
-	int len = ss.length();
-	//判断是否存在同一个exe;
-	if (CSystemInfo::IsHanvedCurrentWindow() == true) return 0;
+bool LoadedResources(HINSTANCE hInstance)
+{	//判断是否存在同一个exe;
+	if (CSystemInfo::IsHanvedCurrentWindow() == true) return false;
 
 	HRESULT Hr = ::CoInitialize(NULL);
-	if (FAILED(Hr)) return 0;
-	// 初始化UI管理器
+	if (FAILED(Hr))
+		return false;
+
 	CPaintManagerUI::SetInstance(hInstance);
-	// 初始化资源
-	//InitResource();
 	CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath());
+	CFrameWnd* pFrame = CreateFrameWnd(hInstance);
+
+	if (pFrame == NULL)
+		return false;
 
-	CFrameWnd* pFrame = new CFrameWnd();
-	if (pFrame == NULL) return 0;
-	pFrame->Create(NULL, _T("MainWnd"), UI_WNDSTYLE_FRAME,0);
-	pFrame->CenterWindow();
-	pFrame->InitWindow();
-	pFrame->ShowWindow();
 	CSystemInfo::isWriteAppProcessInfoToIni(pFrame->GetHWND());
 	CPaintManagerUI::MessageLoop();
-	
+
+	return true;
+}
+
+
+int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)
+{
+	//初始化缓存路径
+	AppCore::InitAppTempPath();
+
+	// 初始化UI管理器
+	if (LoadedResources(hInstance) == false)
+		return 0;
+
 	::CoUninitialize();
-    return 0;
+
+	return 0;
 }