chenrongqian преди 2 години
родител
ревизия
c6c505b0d0
променени са 36 файла, в които са добавени 532 реда и са изтрити 290 реда
  1. BIN
      PDFReaderPro_Installer/Bin/MainUI.png
  2. 11 11
      PDFReaderPro_Installer/Bin/XMLFile.xml
  3. 1 1
      PDFReaderPro_Installer/Bin/msg.xml
  4. 13 31
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp
  5. 0 44
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h
  6. 25 77
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp
  7. 0 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h
  8. 3 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp
  9. 9 9
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp
  10. 4 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp
  11. 13 11
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp
  12. 1 4
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h
  13. 4 23
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp
  14. 77 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.cpp
  15. 40 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h
  16. 45 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineUI.h
  17. 77 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp
  18. 28 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h
  19. 3 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp
  20. 1 18
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h
  21. 3 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp
  22. 2 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h
  23. 1 7
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h
  24. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyCore.cpp
  25. 0 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyCore.h
  26. 42 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.cpp
  27. 62 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h
  28. 8 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj
  29. 33 9
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters
  30. 0 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/UIwnd.h
  31. 5 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp
  32. 8 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstall.cpp
  33. 2 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalled.cpp
  34. 6 5
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp
  35. 3 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.cpp
  36. 2 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp

BIN
PDFReaderPro_Installer/Bin/MainUI.png


+ 11 - 11
PDFReaderPro_Installer/Bin/XMLFile.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--mininfo="600,400" -->
-<Window size="760,540" roundcorner="6" caption="0,0,0,32" showshadow="true" shadowcorner="1,1,1,1" shadowsize="3">
+<Window size="760,540" roundcorner="4,4,4,4" caption="0,0,0,32" showshadow="true" shadowcorner="6,6,6,6" shadowcolor="0xFF000000" shadowsize="6" shadowdarkness="50">
 	<Font id="0" name="FontBtn" sname="Segoe UI" size="16" />
 	<Font id="3" name="FontBtn" sname="Segoe UI" size="16" underline="true" />
 	<Font id="2" name="FontLable" sname="Segoe UI" size="9" />
@@ -8,9 +8,9 @@
 	<VerticalLayout>
 		<!--主页 -->
 		<VerticalLayout name="LayoutHome" visible="true" width="760" height="600" float="true" bkcolor="0xFFFFFFFF">
-			<VerticalLayout inset="0,0,0,0" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
-				<Control padding="350,120,0,0" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
-				<Label font="1" padding="290,20,0,0" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
+			<VerticalLayout inset="0,0,0,0" bkimage="MainUI.png" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
+				<Control padding="350,120,0,0" visible="false" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
+				<Label font="1" padding="290,20,0,0" visible="false" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
 			</VerticalLayout>
 			<HorizontalLayout height="64" padding="0,32,0,0" width="760">
 				<Container />
@@ -30,8 +30,8 @@
 				<Container />
 				<HorizontalLayout autocalcwidth="true" floatalign="center">
 					<Container />
-					<CheckBox name="CheckInstallSetting" selected="true" autocalcwidth="true" height="30" font="0" text="Installation settings" textcolor="0xFF333333" hotbkcolor="0x01000000" />
-					<Button name="Lbicon" text="▲" font="2" autocalcwidth="true" valign="top" padding="4,6,0,0" />
+					<CheckBox name="CheckInstallSetting" selected="true" autocalcwidth="true" height="30" font="0" text="Installation settings" textcolor="0xFF333333" hotbkcolor="0x01000000" cursor="hand" />
+					<Button name="Lbicon" text="▲" font="2" autocalcwidth="true" valign="top" padding="4,6,0,0" cursor="hand" />
 					<Container />
 				</HorizontalLayout>
 				<Container />
@@ -39,7 +39,7 @@
 			<HorizontalLayout visible="true" padding="40,0,0,0" width="680" bkcolor="0xFFEAECF2" height="1" />
 			<HorizontalLayout padding="40,10,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="1111222222222222222222222211122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222" font="0" textpadding="4,4,4,0" height="32" bordercolor="0xFFDFDFDF" bordersize="1,1,1,1" />
+				<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">
 					<Button name="BtnIconSelectFolder" padding="10,8,0,0" width="16" height="16" bkimage="arrow.png" hotforeimage="file='arrow.png' source='0,0,30,20'" maxheight="16" />
 				</HorizontalLayout>
@@ -58,9 +58,9 @@
 		</VerticalLayout>
 		<!--完成 -->
 		<VerticalLayout name="LayoutInstalled" visible="false" width="760" height="540" float="true" bkcolor="0xFFFFFFFF">
-			<VerticalLayout inset="0,0,0,0" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
-				<Control padding="350,120,0,0" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
-				<Label font="1" padding="290,20,0,0" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
+			<VerticalLayout inset="0,0,0,0" bkimage="MainUI.png" bkcolor="0xff1B263A" bkcolor2="0xff273C62" bkcolor3="0xff273C62" width="760" height="320">
+				<Control padding="350,120,0,0" visible="false" height="80" width="80" minwidth="80" minheight="80" bkimage="Logo.png" />
+				<Label font="1" padding="290,20,0,0" visible="false" height="30" width="760" text="PDF Reader Pro" textcolor="0xFFFFFFFF" />
 			</VerticalLayout>
 			<HorizontalLayout width="760" height="64" padding="0,45,0,0">
 				<Container />
@@ -69,7 +69,7 @@
 			</HorizontalLayout>
 			<HorizontalLayout padding="10,32,10,0" width="760" visible="true">
 				<HorizontalLayout />
-				<RichEdit name="LbInstalledPath" readonly="true" font="0" width="600" align="center" text="C:\\" />
+				<Label name="LbInstalledPath" font="0" width="600" align="center" text="C:\\" />
 				<HorizontalLayout />
 			</HorizontalLayout>
 		</VerticalLayout>

+ 1 - 1
PDFReaderPro_Installer/Bin/msg.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Window caption="0,0,0,40" size="534,206" roundcorner="6" caption="0,0,0,32" showshadow="true" shadowcorner="1,1,1,1" shadowsize="3">
+<Window caption="0,0,0,40" size="534,206" roundcorner="6" showshadow="true" shadowcorner="6,6,6,6" shadowcolor="0xFF000000" shadowsize="6" shadowdarkness="50">
 	<Font id="0" name="微软雅黑" size="12" default="true" />
 	<Font id="1" name="微软雅黑" size="14" />
 	<VerticalLayout bkcolor="#FFFFFFFF">

+ 13 - 31
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp

@@ -1,30 +1,12 @@
 
 #include "stdafx.h"
 #include "AppCore.h"
-
+#include "KeyVar.h"
 
 #pragma region 静态成员变量
 
-//更换为其他产品静默安装时,以“必改项”为必须要更改的内容
-const wstring AppCore::URI_AppXml = L"https://www.pdfreaderpro.com/downloads/pdfreaderprocast_win_en_Us.xml";//必改项
-const wstring AppCore::URI_InstallPackge = L"https://pdfreaderpro.oss-cn-shanghai.aliyuncs.com/downloads/PDFReaderPro.exe";//必改项
-
-const wstring AppCore::smName_InstallPackage = L"PDFReaderPro.exe";//必改项,可自定义名称,建议跟安装包名一致
-const wstring AppCore::smName_Application = L"PDFReaderProWin.exe";//必改项,具体看安装包打包时命名的可执行程序
-
-//const wstring AppCore::smPath_DefaultInstall = L"C:\\Program Files\\PDF Technologies, Inc";//必改项,具体看安装包打包时设置的默认路径\\PDF Reader Pro
-wstring AppCore::smPath_Install = L"C:\\Program Files\\PDF Technologies, Inc";
-
-//缓存路径+"\\InstallerInfoTemp\\",存的是:Banner json文件,Banner图片,config.ini文件;
-//思路:先获取或创建.../Temp,若创建失败,则获取文档文件夹(避免在特殊的情况下发生);若获取文档文件夹失败,则获取安装的路径;
-wstring AppCore::smPath_Temp = L"C:/Program Files(x86)/Temp";
-#define TempFolderName L"InstallTemp"; //在缓存路径Temp文件夹里创建一个缓存文件夹,方便退出程序后,删除所有缓存文件
-//可不改
-int AppCore::ShowBannerCount = 5;
-const wstring AppCore::URI_BannerJson = L"https://content.filmagepro.com/api/pictures/list";
-const wstring AppCore::smName_BannerJson = L"Banner.json";
 
-const wstring AppCore::FileName_ProgressName = L"PDF Reader Pro";
+//const wstring AppCore::FileName_ProgressName = L"PDF Reader Pro";
 #pragma endregion
 
 
@@ -74,11 +56,11 @@ wstring AppCore::SetSHGetFolderPath(_In_ int csidl)
 
 wstring AppCore::GetAppTempPath()
 {
-	 if (smPath_Temp == L"")
+	 if (PathCore::smPath_Temp == L"")
 	 {
-		 smPath_Temp = smPath_Install;
+		 PathCore::smPath_Temp = PathCore::smPath_Install;
 	 }
-	 return smPath_Temp;
+	 return PathCore::smPath_Temp;
 }
 
 void AppCore::InitAppTempPath()
@@ -104,26 +86,26 @@ void AppCore::InitAppTempPath()
 		 temp = L"";
 
 	 temp = temp+L"\\";
-	 smPath_Temp = AppCore::ReplaceSubStr(temp, L"\\", L"/");
+	 PathCore::smPath_Temp = AppCore::ReplaceSubStr(temp, L"\\", L"/");
 
 
 	 isCreate = True;
 
-	 if (!PathIsDirectoryW(smPath_Install.c_str()))
-		 isCreate = CreateDirectory((smPath_Install.c_str()), NULL);
+	 if (!PathIsDirectoryW(PathCore::smPath_Install.c_str()))
+		 isCreate = CreateDirectory((PathCore::smPath_Install.c_str()), NULL);
 
 	 if (isCreate)
 	 {
-		 smPath_Install = smPath_Install + L"\\" + FileName_ProgressName;
-		 if (!PathIsDirectoryW(smPath_Install.c_str()))
-			 isCreate = CreateDirectory((smPath_Install.c_str()), NULL);
+		 PathCore::smPath_Install = PathCore::smPath_Install + L"\\" + ExeCore::smName_ExeProcess;
+		 if (!PathIsDirectoryW(PathCore::smPath_Install.c_str()))
+			 isCreate = CreateDirectory((PathCore::smPath_Install.c_str()), NULL);
 	 }
  }
 
 void AppCore::ClearAllTempFolder()
 {
-	    RemoveDirectory(AppCore::smPath_Temp.c_str());
-		wstring installPathFile = AppCore::smPath_Install + L"\\" + AppCore::smName_InstallPackage;
+	    RemoveDirectory(PathCore::smPath_Temp.c_str());
+		wstring installPathFile = PathCore::smPath_Install + L"\\" + Product::smName_InstallPackage;
 		DeleteFile(installPathFile.c_str());
 }
 

+ 0 - 44
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h

@@ -33,54 +33,10 @@ using namespace std;
 static class AppCore
 {
 public:
-	static wstring smPath_Temp;
-	static wstring smPath_Install;
 
 public:
 	static void ClearAllTempFolder();
-#pragma region 安装信息
 
-	/// <summary>
-	/// 安装包信息的XML文件(对应产品)
-	/// </summary>
-	static const wstring URI_AppXml;
-	/// <summary>
-	/// 安装包资源链接(对应产品)
-	/// </summary>
-	static const wstring URI_InstallPackge;
-	/// <summary>
-	/// 安装包名称(建议对应产品)
-	/// </summary>
-	static const wstring smName_InstallPackage;
-	/// <summary>
-	/// 安装后的程序:安装后的可运行程序名称,该名称由安装包决定的(对应产品)
-	/// </summary>
-	static const wstring smName_Application;
-	/*/// <summary>
-	/// 默认安装路径(建议对应产品)
-	/// </summary>
-	static const wstring smPath_DefaultInstall;*/
-
-#pragma endregion
-
-#pragma region Banner信息
-
-	static int ShowBannerCount;
-	/// <summary>
-	/// Banner图片资源json链接
-	/// </summary>
-	static const wstring URI_BannerJson;
-	/// <summary>
-	/// 创建Banner json文件的名称(带文件后缀名)
-	/// </summary>
-	static const wstring smName_BannerJson;
-
-#pragma endregion
-
-	/// <summary>
-	/// 后台任务管理器的进程名称
-	/// </summary>
-	static const wstring FileName_ProgressName;
 
 public:
 	static wstring GetNewSaveFolder(std::wstring saveFilePath, std::wstring oldchar, std::wstring newchar);

+ 25 - 77
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp

@@ -4,6 +4,25 @@
 #include <fstream>
 #include <urlmon.h>
 #pragma comment(lib, "urlmon.lib")
+#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>
 
 VertionResultType CAccessRegedit::AccessKey()
 {
@@ -17,7 +36,7 @@ VertionResultType CAccessRegedit::AccessKey()
 	HKEY hkResult;
 	HKEY hkRKey;
 	LPCTSTR lpSubKey;
-	lpSubKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products";
+	lpSubKey = RegeditCore::smPath_ProductsInfo.c_str();
 
 	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey1);
 	VertionResultType state = VertionResultType::None;
@@ -71,7 +90,7 @@ VertionResultType CAccessRegedit::AccessSubKey(std::wstring AppKey)
 	HKEY hkRKey;
 	LPCTSTR lpSubKey;
 	
-	AppKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products\\" + AppKey;
+	AppKey = RegeditCore::smPath_ProductsInfo + AppKey;
 	lpSubKey = AppKey.c_str();
 	lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, 0, KEY_READ | KEY_WOW64_64KEY, &hKey1);
 	VertionResultType state = VertionResultType::None;
@@ -153,74 +172,6 @@ VertionResultType CAccessRegedit::AccessSubKey(std::wstring AppKey)
 	VersionFromDevice = L"";
 	return state;
 }
-#include <Shlwapi.h>
-#pragma comment(lib,"shlwapi.lib")
-#include <atlconv.h>
-
-BOOL CAccessRegedit::FileExistsStatus(const CHAR* path)
-{
-	DWORD dwAttribute = GetFileAttributes((LPWSTR)path);
-	if (dwAttribute == 0XFFFFFFFF) {
-		return false;
-	}
-	else {
-		return true;
-	}
-}
-#include <WinInet.h> 
-
-#pragma comment(lib,"wininet.lib") 
-
-#define MAXBLOCKSIZE 1024
-
-
-#include <shlobj.h>
-#include <atlstr.h>
-#include <json/reader.h>
-
-std::wstring CAccessRegedit::GetInstallPageXML()
-{
-
-	IStream* stream;
-	HRESULT ret = URLOpenBlockingStreamW( 
-		nullptr, 
-		AppCore::URI_AppXml.c_str(),
-		&stream,
-		0,
-		nullptr
-	);
-
-
-
-
-	if (ret != S_OK)
-		return L"";
-
-	char buffer[1024] = { 0 };
-	DWORD readBytes = 0; 
-
-	std::wstring xmlcontent=L"";
-
-	do
-	{
-		stream->Read(
-			buffer, 
-			1024,
-			&readBytes
-		);
-
-		std::wstring wch = AppCore::GetMultiByteToWideChar(buffer);
-		xmlcontent = xmlcontent + wch;
-	} while (readBytes > 0);
-
-	int first = xmlcontent.find(L"sparkle:version=\"");
-
-	std::wstring newStr = xmlcontent.substr(first +17, 7);
-	stream->Release();
-
-
-	return newStr;
-}
 
 
 std::wstring CAccessRegedit::GetVersionFromXML()
@@ -231,9 +182,6 @@ std::wstring CAccessRegedit::GetVersionFromXML()
 	return VersionFromXML;
 }
 
-#include <Windows.h>
-#include "CDownLoadFile.h"
-
 std::vector<std::string> CAccessRegedit::ReadJsonFromFile(const char* file)
 {
 	Json::Reader reader;
@@ -265,8 +213,8 @@ std::vector<std::string> CAccessRegedit::GetBannerlinkFromJson(std::wstring st)
 	DownloadProgress progress;
 	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
 
-	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + AppCore::smName_BannerJson;
-	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
+	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
+	HRESULT Hfile = URLDownloadToFile(NULL, BannerCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
 
 	//¿í×Ö·ûת¶à×Ö½Ú×Ö·û
 	char* pStr;
@@ -354,7 +302,7 @@ void CAccessRegedit::AutoRun()
 
 }
 
-#include<profinfo.h>
+
 VertionResultType CAccessRegedit::RegisterDefaultPDFOpen()
 {
 	DWORD dwType1 = 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;
@@ -367,7 +315,7 @@ VertionResultType CAccessRegedit::RegisterDefaultPDFOpen()
 	HKEY hkResult;
 	HKEY hkRKey;
 
-	lpSubKey = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice";
+	lpSubKey = RegeditCore::smPath_DefaultPDFOpen.c_str();
 	std::wstring strAppPath = L"PDFReaderProWin.PDF";
 	
 

+ 0 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h

@@ -39,13 +39,10 @@ public:
 	std::vector<std::string> GetBannerlinkFromJson(std::wstring st);
 	std::vector<std::string> ReadJsonFromFile(const char* file);
 
-	BOOL FileExistsStatus(const CHAR* path);
-
 	void GetImage(std::wstring url, std::wstring saveFolder, int i);
 	std::wstring m_replace(std::wstring strSrc,const std::wstring& oldStr, const std::wstring& newStr);
 private:
 	VertionResultType AccessSubKey(std::wstring AppKey);
-	std::wstring GetInstallPageXML();
 private:
 	const std::wstring AppName = L"PDF Reader Pro";
 

+ 3 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp

@@ -1,5 +1,5 @@
 #include "CAdsBanner.h"
-
+#include "KeyVar.h"
 CAdsBanner::CAdsBanner()
 {
 
@@ -7,8 +7,8 @@ CAdsBanner::CAdsBanner()
 
 std::vector<std::string> CAdsBanner::GetBannerlinkFromJson(std::wstring st)
 {
-	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + AppCore::smName_BannerJson;
-	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0,NULL);
+	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
+	HRESULT Hfile = URLDownloadToFile(NULL, BannerCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0,NULL);
 
 	//¿í×Ö·ûת¶à×Ö½Ú×Ö·û
 	char* pStr;

+ 9 - 9
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp

@@ -1,6 +1,6 @@
 #include "CCmd.h"
 #include <time.h>
-
+#include "KeyVar.h"
 #pragma region cmd指令说明
 // 【/k】:调用cmd进程时,必须调用此参数
 // //  【x:】:x为x盘符,cd到不同盘符下的文件夹路径之前,必须要要调用此参数,否则cd指令不生效;
@@ -21,8 +21,8 @@ CCmd::CCmd()
 BOOL CCmd::Installcmd()
 {
 	std::wstring cmd = L"";
-	auto cdDisk = AppCore::smPath_Install.substr(0, 1) + L": & ";
-	cmd = L"/k " + cdDisk + L"cd \"" + AppCore::smPath_Install + L"\"" + L" & start/wait " + AppCore::smName_InstallPackage + L" APPDIR=\"" + AppCore::smPath_Install + L"\" /qb /qn /norestart";
+	auto cdDisk = PathCore::smPath_Install.substr(0, 1) + L": & ";
+	cmd = L"/k " + cdDisk + L"cd \"" + PathCore::smPath_Install + L"\"" + L" & start/wait " + Product::smName_InstallPackage + L" APPDIR=\"" + PathCore::smPath_Install + L"\" /qb /qn /norestart";
 
 	WriteInIniFile("Install cmd", cmd);
 	TCHAR* tc = (TCHAR*)(&cmd[0]);
@@ -33,9 +33,9 @@ BOOL CCmd::OpenAppcmd()
 {
 	std::wstring cmd = L"";
 
-		auto cdDisk = AppCore::smPath_Install.substr(0, 1) + L": & ";
+		auto cdDisk = PathCore::smPath_Install.substr(0, 1) + L": & ";
 
-		cmd = L"/k " + cdDisk + L"cd \"" + AppCore::smPath_Install + L"\"" + L" & start/wait " + AppCore::smName_Application;
+		cmd = L"/k " + cdDisk + L"cd \"" + PathCore::smPath_Install + L"\"" + L" & start/wait " + Product::smName_Application;
 
 	WriteInIniFile("Start App cmd", cmd);
 	TCHAR* tc = (TCHAR*)(&cmd[0]);
@@ -152,19 +152,19 @@ string CCmd::GetVBAContent()
 	std::wstring echo = L"ECHO.";
 	bat = L"@echo off\u79c1" +
 		echo + L"\u79c1" +
-		L"cd " + AppCore::smPath_Install.substr(0, 1) + L":" + L"%~dp0" + L"\u79c1" +
+		L"cd " + PathCore::smPath_Install.substr(0, 1) + L":" + L"%~dp0" + L"\u79c1" +
 		echo + L"\u79c1" +
 		echo + L"\u79c1" +
-		L"start/wait " + AppCore::smName_InstallPackage + L" APPDIR=%cd% /qb /qn" + L"\u79c1" +
+		L"start/wait " + Product::smName_InstallPackage + L" APPDIR=%cd% /qb /qn" + L"\u79c1" +
 		echo + L"\u79c1" +
 		L"EXIT";
 
 	LPCWSTR sss = _T("C:\\Program Files\\PDF Technologies, Inc\\PDF Reader Pro\\install.bat");
 
-	wchar_t* rootptr = _wcsdup(AppCore::smPath_Install.substr(0, 1).c_str());
+	wchar_t* rootptr = _wcsdup(PathCore::smPath_Install.substr(0, 1).c_str());
 	auto rootch = AppCore::GetWideCharToMultiByte(rootptr);
 
-	wchar_t* ptrInstallPackage = _wcsdup(AppCore::smName_InstallPackage.substr(0, 1).c_str());
+	wchar_t* ptrInstallPackage = _wcsdup(Product::smName_InstallPackage.substr(0, 1).c_str());
 	auto InstallPackagech = AppCore::GetWideCharToMultiByte(ptrInstallPackage);
 
 	std::string cmdd = "";

+ 4 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp

@@ -1,5 +1,6 @@
 #include "CDownLoadFile.h"
 #include <WinInet.h>
+#include "KeyVar.h"
 
 double DownloadProgress::Currentpercentage = 0;
 double DownloadProgress::pro_value = 0;
@@ -9,9 +10,9 @@ bool CDownLoadFile::GetInstallPackage(std::wstring SaveFolder)
 	DownloadProgress progress;
 	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
 
-	SaveFolder = AppCore::GetOrCreateFolderPath(SaveFolder) + L"/" + AppCore::smName_InstallPackage;
-	DeleteUrlCacheEntry(AppCore::URI_InstallPackge.c_str());
-	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_InstallPackge.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
+	SaveFolder = AppCore::GetOrCreateFolderPath(SaveFolder) + L"/" + Product::smName_InstallPackage;
+	DeleteUrlCacheEntry(Product::URI_InstallPackge.c_str());
+	HRESULT Hfile = URLDownloadToFile(NULL, Product::URI_InstallPackge.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
 	if (Hfile == S_OK)
 	{
 		if (DownloadProgress::Currentpercentage > 99.0)

+ 13 - 11
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.cpp

@@ -85,6 +85,7 @@ void CFrameWnd::InitControls()
 	InitHomeControls();
 	InitInstallingControls();
 	InitInstalledControls();
+
 }
 
 void CFrameWnd::InitAsscessKey()
@@ -183,24 +184,25 @@ LRESULT CFrameWnd::OnDPIChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
 
 LRESULT CFrameWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-	if (wParam == TIMER_BANNER_ID)
+	switch (wParam)
 	{
+	case TIMER_BANNER_ID:
 		SetTimerBannerSwitch();
-	}
+		break;
 
-	if (wParam == TIMER_INSTALL_ID)
-	{
+	case TIMER_INSTALL_ID:
 		SetTimerInstalling();
-	}
+		break;
 
-	if (wParam == TIMER_WAITDOWNLOAD_ID)
-	{
+	case TIMER_WAITDOWNLOAD_ID:
 		SetTimerBanner();
-	}
+		break;
 
-	if (wParam == TIMER_SILENTINSTALL_ID)
-	{
+	case TIMER_SILENTINSTALL_ID:
 		SetTimerSilen();
+		break;
+	default:
+		break;
 	}
 
 	bHandled = false;
@@ -237,7 +239,7 @@ void CFrameWnd::Notify(TNotifyUI& msg)
 					CLanguage::GetText(TextType::MSG_BtnNo).c_str()
 				))
 				{
-
+					
 					::DestroyWindow(m_hWnd);
 				}
 			}

+ 1 - 4
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h

@@ -17,7 +17,7 @@
 #include "InstallPage.h"
 #include "InstallingPage.h"
 #include "InstalledPage.h"
-
+#include "UIWnd.h"
 typedef struct ThreadData
 {
 public:
@@ -69,9 +69,6 @@ private:
 
 	CMainPage m_MainPage;
 	bool IsSpaceDisk();
-	//enum class LayoutType m_LayoutType = LayoutType::Home;
-	//enum class VertionResultType m_VertionResultType = VertionResultType::None;
-	//enum class InstallStateType m_InstallStateType = InstallStateType::None;
 public:
 	//³õʼ»¯
 	 explicit CFrameWnd(LPCTSTR pszXMLPath);

+ 4 - 23
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp

@@ -6,6 +6,7 @@
 #define THREADPROCESS "ThreadProcess"
 #define PID "pid"
 #define THREADID "TheardId"
+#include "KeyVar.h"
 
 CSystemInfo::CSystemInfo()
 {
@@ -15,11 +16,10 @@ CSystemInfo::CSystemInfo()
 
 bool CSystemInfo::IsHanvedCurrentWindow()
 {
-	//std::wstring ss1 = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) +L"\\config.ini";
-	std::wstring ss1 = AppCore::smPath_Temp + APPCONFIG;
+	std::wstring ss1 = PathCore::smPath_Temp + APPCONFIG;
 	wchar_t* ptr = _wcsdup(ss1.c_str());
 	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
-	HANDLE h = ::CreateMutex(NULL, TRUE, AppCore::FileName_ProgressName.c_str());
+	HANDLE h = ::CreateMutex(NULL, TRUE, ExeCore::smName_ExeProcess.c_str());
 
 	if (h != NULL)
 	{
@@ -67,7 +67,7 @@ bool CSystemInfo::IsHanvedCurrentWindow()
 
  bool CSystemInfo::isWriteAppProcessInfoToIni(HWND hwnd)
 {
-	std::wstring ss1 = AppCore::smPath_Temp + APPCONFIG;
+	std::wstring ss1 = PathCore::smPath_Temp + APPCONFIG;
 	wchar_t* ptr = _wcsdup(ss1.c_str());
 	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
 	DWORD pid = 0;
@@ -89,22 +89,3 @@ DWORD CSystemInfo::ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefaul
 {
 	return  GetPrivateProfileIntA(lpAppNam, lpKeyName, nDefault, lpFileName);
 }
-
-
-//DWORD GetProcessIDByName()
-//{
-//	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
-//	if (INVALID_HANDLE_VALUE == hSnapshot) {
-//		return NULL;
-//	}
-//	PROCESSENTRY32 pe = { sizeof(pe) };
-//	for (BOOL ret = Process32First(hSnapshot, &pe); ret; ret = Process32Next(hSnapshot, &pe)) {
-//		if (pe.szExeFile == L"PDFReaderPro_Installer") {
-//			CloseHandle(hSnapshot);
-//			return pe.th32ProcessID;
-//		}
-//		//printf("%-6d %s\n", pe.th32ProcessID, pe.szExeFile);
-//	}
-//	CloseHandle(hSnapshot);
-//	return 0;
-//}

+ 77 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.cpp

@@ -0,0 +1,77 @@
+#include "CharConvert.h"
+#include "stdafx.h"
+
+#pragma region 字符串编码处理
+
+#pragma region 字符转换
+
+char* CharConvert::StringTocharPtrA(string* sourceStr)
+{
+	char* ch = (LPSTR)(LPCTSTR)sourceStr;
+	return ch;
+}
+
+wchar_t* CharConvert::wstringToWchar_tPtrW(wstring ws)
+{
+	wchar_t* ptr = _wcsdup(ws.c_str());
+	return ptr;
+}
+
+#pragma endregion
+
+#pragma region Unicode和ANSI
+
+wstring CharConvert::GetWideCharW(char* multiByte)
+{
+	char* ch = multiByte;
+	int len = MultiByteToWideChar(CP_ACP, 0, ch, -1, NULL, 0);
+	wchar_t* wch = new wchar_t[len];
+	MultiByteToWideChar(CP_ACP, 0, ch, -1, wch, len);
+	return wch;
+}
+
+wstring CharConvert::GetWideCharW(string* multiByte)
+{
+	char* ch = (LPSTR)(LPCTSTR)multiByte;
+	wstring wch = GetWideCharW(ch);
+	return wch;
+}
+
+char* CharConvert::GetMultiByteW(wchar_t* wideChar)
+{
+	char* multiByte;
+	int iwstrLen = WideCharToMultiByte(CP_ACP, 0, wideChar, -1, 0, 0, 0, 0);
+	multiByte = new char[iwstrLen + 1];
+	memset(multiByte, 0, sizeof(char) * (iwstrLen + 1));
+	WideCharToMultiByte(CP_ACP, 0, wideChar, -1, multiByte, iwstrLen, 0, 0);
+	return multiByte;
+}
+
+char* CharConvert::GetMultiByteW(wstring wideStr)
+{
+	wchar_t* ptr = _wcsdup(wideStr.c_str());
+	char* multiByte = GetMultiByteW(ptr);
+	return multiByte;
+}
+
+std::wstring CharConvert::ReplaceSubStrW(wstring sourceStr, const wstring& oldSubStr, const wstring& newSubStr)
+{
+	wstring strRet = sourceStr;
+	size_t pos = 0;
+	int l_count = 0;
+	int count = -1;
+	if (-1 == count) // replace all
+		count = strRet.size();
+	while ((pos = strRet.find(oldSubStr, pos)) != wstring::npos)
+	{
+		strRet.replace(pos, oldSubStr.size(), newSubStr);
+		if (++l_count >= count) break;
+		pos += newSubStr.size();
+	}
+	return strRet;
+}
+
+#pragma endregion
+
+#pragma endregion
+

+ 40 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h

@@ -0,0 +1,40 @@
+#pragma once
+#include<string>
+using namespace std;
+
+#pragma region 字符串处理
+//说明:Unicode转换为ANSI,由于系统语言区域设置原因,目前只支持处理英文内容
+class CharConvert
+{
+
+#pragma region Unicode和ANSI
+
+	/// <summary>
+	/// 多字节字符转换为宽字符
+	/// </summary>
+	static wstring GetWideCharW(char* multiByte);
+
+	static wstring GetWideCharW(string* multiByte);
+
+	/// <summary>
+	/// 宽字符转换为多字节字符
+	/// </summary>
+	/// <param name="wideChar"></param>
+	/// <returns></returns>
+	static char* GetMultiByteW(wchar_t* wideChar);
+	static char* GetMultiByteW(wstring wideStr);
+
+	static wstring ReplaceSubStrW(wstring sourceStr, const wstring& oldSubStr, const wstring& newSubStr);
+
+#pragma endregion
+	
+
+#pragma region 字符转换
+
+	static char* StringTocharPtrA(string* sourceStr);
+	static wchar_t* wstringToWchar_tPtrW(wstring ws);
+
+#pragma endregion
+
+};
+#pragma endregion

+ 45 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/DefineUI.h

@@ -0,0 +1,45 @@
+#pragma once
+
+#pragma region 安装前
+
+#define UI_LayoutHome L"LayoutHome" //主页界面
+#define UI_BtnInstall L"Btninstall" ////安装按钮
+
+#define UI_LbInstallationfolderTitle L"InstallationfolderTitle" //选择文件夹按钮
+#define UI_BtnIconSelectFolder L"BtnIconSelectFolder" //选择文件夹图标按钮
+#define UI_BtnTextSelectFolder L"BtnTextSelectFolder" //选择文件夹按钮
+
+#define UI_TxtByClickInstall L"TxtByClickInstall"
+#define UI_BtnTermsService L"BtnTermsService"
+#define UI_TxtAnd L"TxtAnd"
+#define UI_BtnPrivacyPolicy L"BtnPrivacyPolicy"
+#define UI_TextShowContentLink L"TextShowContentLink"//超链接说明
+
+#define UI_CheckInstallSetting L"CheckInstallSetting"//自定义按钮
+#define UI_EdFilepath L"EdFilepath"//安装路径编辑框
+#define UI_Lbicon L"Lbicon"//自定义按钮icon▲
+#define UI_BtnClose L"BtnClose"//关闭按钮
+#define UI_containerCloseNone L"containerCloseNone"//关闭按钮右侧留空
+
+#pragma endregion
+
+
+#pragma region 安装中
+
+#define UI_LayoutInstalling L"LayoutInstalling" //安装中界面
+#define UI_InstallingProgress L"InstallingProgress" //安装进度条
+#define UI_tab_switch L"tab_switch" //切换Banner
+#define UI_ConNoNetWork L"ConNoNetWork" //无网络
+#define UI_installNotWork L"installNotWork"//网络
+#define UI_installingValue L"installingValue"//安装百分比值
+
+#pragma endregion
+
+
+#pragma region 安装后
+
+#define UI_LayoutInstalled L"LayoutInstalled" //安装完成界面
+#define UI_LbInstalledPath L"LbInstalledPath" //安装路径Lable
+#define UI_BtnOpenApp L"BtnOpenApp" //打开App按钮
+
+#pragma endregion

+ 77 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp

@@ -0,0 +1,77 @@
+#include "FileCore.h"
+#include "stdafx.h"
+
+#pragma region Îļþ¼Ð
+
+wstring FileCore::GetNewSaveFolder(wstring saveFilePath, wstring oldchar, wstring newchar)
+{
+	while (true)
+	{
+		size_t pos = saveFilePath.find(oldchar);
+		if (pos != wstring::npos)
+		{
+			WCHAR pBuf[1] = { L'\0' };
+			saveFilePath.replace(pos, oldchar.length(), pBuf, 0);
+			saveFilePath.insert(pos, newchar);
+		}
+		else
+		{
+
+			break;
+		}
+
+	}
+	return saveFilePath;
+}
+
+wstring FileCore::GetOrCreateFolderPath(wstring saveFilePath)
+{
+	wstring newSaveFolder = AppCore::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 isExist = PathFileExistsW(folderPath.c_str());
+	return isExist;
+}
+
+bool FileCore::IsRootDirectoryW(wstring folderPath)
+{ 
+	int first2 = folderPath.find(L"\\");  
+	if (first2 + 1 == folderPath.length())
+	{
+		return true;
+	}
+	else
+	{
+		return false;
+	}
+}
+
+wstring FileCore::CreateFolderFromRootDirW(wstring folderPath, wstring newSubFolderName)
+{
+	if (IsRootDirectoryW(folderPath))
+	{
+		int first = folderPath.find(L"\\");
+		std::wstring newStr = folderPath.substr(0, first + 1);
+		folderPath = newStr + newSubFolderName;
+	}
+	return folderPath;
+}
+
+#pragma endregion
+
+
+
+#pragma region Îļþ
+
+bool FileCore::IsExistTheFileW(wstring filePath)
+{
+	bool isExist = PathFileExistsW(filePath.c_str());
+	return isExist;
+}
+#pragma endregion

+ 28 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h

@@ -0,0 +1,28 @@
+#pragma once
+#include<string>
+using namespace std;
+
+class FileCore
+{
+#pragma region 文件
+
+	static bool IsExistTheFileW(wstring filePath);
+
+#pragma endregion
+
+
+#pragma region 文件夹
+
+	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);//从根目录下创建一个子文件夹
+
+#pragma endregion
+
+
+
+};
+

+ 3 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp

@@ -1,4 +1,5 @@
 #include "InstallPage.h"
+#include "KeyVar.h"
 
 InstallationPage::InstallationPage(CPaintManagerUI* m_pm)
 {
@@ -47,8 +48,8 @@ void InstallationPage::InitLanguage()
 	InstallationfolderTitle->SetText(UIstr(TextType::Text_InstallPath));
 	Btninstall->SetText(UIstr(TextType::Btn_Install));
 	BtnTextSelectFolder->SetText(UIstr(TextType::Btn_FilePath));
-	EdFilepath->SetText(AppCore::smPath_Install.c_str());
-	AppCore::GetOrCreateFolderPath(AppCore::smPath_Install);
+	EdFilepath->SetText(PathCore::smPath_Install.c_str());
+	AppCore::GetOrCreateFolderPath(PathCore::smPath_Install);
 	TextShowContentLink->SetText(UIstr(TextType::Link_Install));
 
 	CheckInstallSetting->SetText(UIstr(TextType::Btn_CutomInstall));

+ 1 - 18
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h

@@ -6,25 +6,8 @@
 #include "duilib.h"
 #include "resource.h"
 #include "AppCore.h"
+#include "DefineUI.h"
 
-#define UI_LayoutHome L"LayoutHome" //主页界面
-#define UI_BtnInstall L"Btninstall" ////安装按钮
-
-#define UI_LbInstallationfolderTitle L"InstallationfolderTitle" //选择文件夹按钮
-#define UI_BtnIconSelectFolder L"BtnIconSelectFolder" //选择文件夹图标按钮
-#define UI_BtnTextSelectFolder L"BtnTextSelectFolder" //选择文件夹按钮
-
-#define UI_TxtByClickInstall L"TxtByClickInstall"
-#define UI_BtnTermsService L"BtnTermsService"
-#define UI_TxtAnd L"TxtAnd"
-#define UI_BtnPrivacyPolicy L"BtnPrivacyPolicy"
-#define UI_TextShowContentLink L"TextShowContentLink"//超链接说明
-
-#define UI_CheckInstallSetting L"CheckInstallSetting"//自定义按钮
-#define UI_EdFilepath L"EdFilepath"//安装路径编辑框
-#define UI_Lbicon L"Lbicon"//自定义按钮icon▲
-#define UI_BtnClose L"BtnClose"//关闭按钮
-#define UI_containerCloseNone L"containerCloseNone"//关闭按钮右侧留空
 //安装主页界面
 #pragma region 文件说明
 

+ 3 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp

@@ -1,4 +1,5 @@
 #include "InstalledPage.h"
+#include "KeyVar.h"
 
 InstalledPage::InstalledPage(CPaintManagerUI* m_pm)
 {
@@ -18,7 +19,7 @@ InstalledPage::~InstalledPage()
 void InstalledPage::InitControls()
 {
 	LayoutInstalled = static_cast<CVerticalLayoutUI*>(m_pm->FindControl(UI_LayoutInstalled));
-	LbInstalledPath = static_cast<CRichEditUI*>(m_pm->FindControl(UI_LbInstalledPath));
+	LbInstalledPath = static_cast<CLabelUI*>(m_pm->FindControl(UI_LbInstalledPath));
 	BtnOpenApp = static_cast<CButtonUI*>(m_pm->FindControl(UI_BtnOpenApp));
 	
 }
@@ -26,7 +27,7 @@ void InstalledPage::InitControls()
 void InstalledPage::InitLanguage()
 {
 	BtnOpenApp->SetText(UIstr(TextType::Btn_OpenApp));
-	std::wstring ss = CLanguage::GetText(TextType::Btn_GoToFilesPath) + AppCore::smPath_Install;
+	std::wstring ss = CLanguage::GetText(TextType::Btn_GoToFilesPath) + PathCore::smPath_Install;
 	LbInstalledPath->SetText(ss.c_str());
 }
 

+ 2 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h

@@ -4,10 +4,7 @@
 #include "duilib.h"
 #include "resource.h"
 #include "AppCore.h"
-
-#define UI_LayoutInstalled L"LayoutInstalled" //安装完成界面
-#define UI_LbInstalledPath L"LbInstalledPath" //安装路径Lable
-#define UI_BtnOpenApp L"BtnOpenApp" //打开App按钮
+#include "DefineUI.h"
 
 //安装完成界面
 class InstalledPage
@@ -19,7 +16,7 @@ private:
 	CPaintManagerUI* m_pm;	
 public:
 	CVerticalLayoutUI* LayoutInstalled;
-	CRichEditUI* LbInstalledPath;
+	CLabelUI* LbInstalledPath;
 	CLabelUI* InstallationfolderTitle;
 	CButtonUI* BtnOpenApp;
 	CLabelUI* Lbicon;

+ 1 - 7
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h

@@ -6,13 +6,7 @@
 #include "duilib.h"
 #include "resource.h"
 #include "AppCore.h"
-
-#define UI_LayoutInstalling L"LayoutInstalling" //安装中界面
-#define UI_InstallingProgress L"InstallingProgress" //安装进度条
-#define UI_tab_switch L"tab_switch" //切换Banner
-#define UI_ConNoNetWork L"ConNoNetWork" //无网络
-#define UI_installNotWork L"installNotWork"//网络
-#define UI_installingValue L"installingValue"//安装百分比值
+#include "DefineUI.h"
 
 //安装中界面
 class InstallingPage

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyCore.cpp

@@ -1 +0,0 @@
-#include "KeyCore.h"

+ 0 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyCore.h

@@ -1,5 +0,0 @@
-#pragma once
-class KeyCore
-{
-};
-

+ 42 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.cpp

@@ -0,0 +1,42 @@
+#include "KeyVar.h"
+
+#pragma region 安装信息
+const wstring Product::URI_AppXml = L"https://www.pdfreaderpro.com/downloads/pdfreaderprocast_win_en_Us.xml";
+const wstring Product::URI_InstallPackge = L"https://pdfreaderpro.oss-cn-shanghai.aliyuncs.com/downloads/PDFReaderPro.exe";
+
+const wstring Product::smName_InstallPackage = L"PDFReaderPro.exe";
+const wstring Product::smName_Application = L"PDFReaderProWin.exe";
+
+#pragma endregion
+
+#pragma region 程序
+
+const wstring ExeCore::smName_ExeProcess = L"PDFReaderPro_Installer.exe";
+
+#pragma endregion
+
+#pragma region Banner信息
+
+const wstring BannerCore::URI_BannerJson = L"https://content.filmagepro.com/api/pictures/list";
+const wstring BannerCore::smName_BannerJson = L"Banner.json";
+int BannerCore::ShowBannerCount = 5;
+
+#pragma endregion
+
+
+#pragma region 路径
+
+wstring PathCore::smPath_Install = L"C:\\Program Files\\PDF Technologies, Inc";
+wstring PathCore::smPath_Temp = L"C:/Program Files(x86)/Temp";
+
+#pragma endregion
+
+#pragma region 注册表
+
+const wstring RegeditCore::smPath_ProductsInfo = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\S-1-5-18\\Products";
+const wstring RegeditCore::smPath_DefaultPDFOpen = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice";
+#pragma endregion
+
+
+
+

+ 62 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h

@@ -0,0 +1,62 @@
+#pragma once
+#include<string>
+using namespace std;
+#define TempFolderName L"InstallTemp"; //在缓存路径Temp文件夹里创建一个缓存文件夹,方便退出程序后,删除所有缓存文件
+#pragma region 安装信息
+static class Product
+{
+public:
+	static const wstring URI_AppXml;//产品XML文件
+	static const wstring URI_InstallPackge;//安装包下载链接
+
+	static const wstring smName_InstallPackage;//安装包名称
+	static const wstring smName_Application;//产品可运行的应用程序名称
+
+};
+
+#pragma region Banner信息
+static class BannerCore
+{
+public:
+	static int ShowBannerCount;//显示Banner图片个数
+	static const wstring URI_BannerJson;//解析获取图片链接
+	static const wstring smName_BannerJson;//Banner Json名称(带文件名后缀)
+};
+#pragma endregion
+
+
+#pragma endregion
+
+#pragma region 程序
+static class ExeCore
+{
+
+public:
+	static const wstring smName_ExeProcess;//后台任务管理器,主窗口进程名
+
+};
+#pragma endregion
+
+#pragma region 路径
+static class PathCore
+{
+
+public:
+	static wstring smPath_Temp;//缓存文件
+	static wstring smPath_Install;//安装路径
+
+};
+#pragma endregion
+
+
+#pragma region 注册表
+static class RegeditCore
+{
+
+public:
+	static const wstring smPath_ProductsInfo;//产品系列路径
+	static const wstring smPath_DefaultPDFOpen;
+};
+#pragma endregion
+
+

+ 8 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj

@@ -163,20 +163,24 @@
     <ClInclude Include="AppCore.h" />
     <ClInclude Include="CDownLoadFile.h" />
     <ClInclude Include="CFrameWnd.h" />
+    <ClInclude Include="CharConvert.h" />
     <ClInclude Include="CLanguage.h" />
     <ClInclude Include="CMsgWnd.h" />
     <ClInclude Include="CSystemInfo.h" />
     <ClInclude Include="CAdsBanner.h" />
     <ClInclude Include="DefineStr.h" />
+    <ClInclude Include="DefineUI.h" />
     <ClInclude Include="duilib.h" />
+    <ClInclude Include="FileCore.h" />
     <ClInclude Include="InstallPage.h" />
     <ClInclude Include="InstalledPage.h" />
     <ClInclude Include="InstallingPage.h" />
-    <ClInclude Include="KeyCore.h" />
+    <ClInclude Include="KeyVar.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" />
   </ItemGroup>
   <ItemGroup>
@@ -186,12 +190,14 @@
     <ClCompile Include="AppCore.cpp" />
     <ClCompile Include="CDownLoadFile.cpp" />
     <ClCompile Include="CFrameWnd.cpp" />
+    <ClCompile Include="CharConvert.cpp" />
     <ClCompile Include="CLanguage.cpp" />
     <ClCompile Include="CMsgWnd.cpp" />
     <ClCompile Include="CSystemInfo.cpp" />
     <ClCompile Include="CAdsBanner.cpp" />
+    <ClCompile Include="FileCore.cpp" />
     <ClCompile Include="InstallPage.cpp" />
-    <ClCompile Include="KeyCore.cpp" />
+    <ClCompile Include="KeyVar.cpp" />
     <ClCompile Include="tinyxml\tinystr.cpp" />
     <ClCompile Include="tinyxml\tinyxml.cpp" />
     <ClCompile Include="tinyxml\tinyxmlerror.cpp" />

+ 33 - 9
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters

@@ -13,12 +13,6 @@
       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
       <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
     </Filter>
-    <Filter Include="头文件\Core">
-      <UniqueIdentifier>{2c1621fb-6b68-4bea-a305-ab3817baa02a}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="源文件\Core">
-      <UniqueIdentifier>{27b54a45-d809-4540-bb6d-3cda7c262027}</UniqueIdentifier>
-    </Filter>
     <Filter Include="头文件\Layout">
       <UniqueIdentifier>{b09c09a8-053d-4fe1-8a30-785730354ab9}</UniqueIdentifier>
     </Filter>
@@ -55,6 +49,18 @@
     <Filter Include="Library\LibraryOrSystem">
       <UniqueIdentifier>{a1465ee9-d6bb-4e0d-be23-5beb1d874f06}</UniqueIdentifier>
     </Filter>
+    <Filter Include="头文件\CoreApp">
+      <UniqueIdentifier>{8f29bf79-1df7-4661-bba7-82332dea0322}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="源文件\CoreApp">
+      <UniqueIdentifier>{e497291e-503b-459a-b14d-5c38a57474ed}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="源文件\Core">
+      <UniqueIdentifier>{27b54a45-d809-4540-bb6d-3cda7c262027}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="头文件\Core">
+      <UniqueIdentifier>{2c1621fb-6b68-4bea-a305-ab3817baa02a}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="CAccessRegedit.h">
@@ -117,9 +123,21 @@
     <ClInclude Include="CMsgWnd.h">
       <Filter>头文件\Layout\UX</Filter>
     </ClInclude>
-    <ClInclude Include="KeyCore.h">
+    <ClInclude Include="UIwnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="FileCore.h">
+      <Filter>头文件\CoreApp</Filter>
+    </ClInclude>
+    <ClInclude Include="CharConvert.h">
+      <Filter>头文件\CoreApp</Filter>
+    </ClInclude>
+    <ClInclude Include="KeyVar.h">
+      <Filter>头文件\CoreApp</Filter>
+    </ClInclude>
+    <ClInclude Include="DefineUI.h">
+      <Filter>头文件\Layout\UI</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="CAccessRegedit.cpp">
@@ -203,8 +221,14 @@
     <ClCompile Include="XmlNode.cpp">
       <Filter>Library\LibraryOrSystem</Filter>
     </ClCompile>
-    <ClCompile Include="KeyCore.cpp">
-      <Filter>源文件</Filter>
+    <ClCompile Include="FileCore.cpp">
+      <Filter>源文件\CoreApp</Filter>
+    </ClCompile>
+    <ClCompile Include="CharConvert.cpp">
+      <Filter>源文件\CoreApp</Filter>
+    </ClCompile>
+    <ClCompile Include="KeyVar.cpp">
+      <Filter>源文件\CoreApp</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>

+ 0 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/UIwnd.h


+ 5 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp

@@ -1,5 +1,5 @@
 #include "CFrameWnd.h"
-
+#include "KeyVar.h"
 void CFrameWnd::Thread_LoadedBanner(ThreadData threadData)
 {
 	threadData.pFrame->GetBanner();
@@ -16,7 +16,7 @@ void CFrameWnd::GetBanner()
 	for (size_t i = 0; i < banner->BannerCollection.size(); i++)
 	{
 	
-		if (i <= AppCore::ShowBannerCount)
+		if (i <= BannerCore::ShowBannerCount)
 		{
 			char* ch = (LPSTR)(LPCTSTR)banner->BannerCollection[i].c_str();
 			std::wstring wch = AppCore::GetMultiByteToWideChar(ch);
@@ -49,9 +49,9 @@ void CFrameWnd::GetBanner()
 	HBITMAP hBitmap = NULL;
 
 	int count = 0;
-	if (AppCore::ShowBannerCount < banner->BannerCollection.size())
+	if (BannerCore::ShowBannerCount < banner->BannerCollection.size())
 	{
-		count = AppCore::ShowBannerCount;
+		count = BannerCore::ShowBannerCount;
 	}
 	else
 	{
@@ -108,7 +108,7 @@ void CFrameWnd::SetTimerBanner()
 void CFrameWnd::SetTimerBannerSwitch()
 {
 	currentImageNum++;
-	currentImageNum = currentImageNum >= AppCore::ShowBannerCount ? 0 : currentImageNum;
+	currentImageNum = currentImageNum >= BannerCore::ShowBannerCount ? 0 : currentImageNum;
 	m_InstallingPage->pTabSwitch->SelectItem(currentImageNum);
 }
 

+ 8 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstall.cpp

@@ -2,7 +2,7 @@
 //#include "duilib.h"
 
 #include "CFrameWnd.h"
-
+#include "KeyVar.h"
 
 #pragma region ³õʼ»¯
 
@@ -127,7 +127,7 @@ void CFrameWnd::WindowSize()
 
 bool CFrameWnd::IsSpaceDisk()
 {
-	auto cdDisk = AppCore::smPath_Install.substr(0, 1);
+	auto cdDisk = PathCore::smPath_Install.substr(0, 1);
 	wchar_t* ptr = _wcsdup(cdDisk.c_str());
 	char* ch = AppCore::GetWideCharToMultiByte(ptr);
 	string str = ch;
@@ -254,7 +254,6 @@ void CFrameWnd::SetSelectedFolder()
 	if (first2 + 1 == sFolder.length())
 	{
 		int first = sFolder.find(L"\\");
-
 		std::wstring newStr = sFolder.substr(0, first + 1);
 		sFolder = newStr + L"PDF Reader Pro";
 	}
@@ -262,8 +261,12 @@ void CFrameWnd::SetSelectedFolder()
 	{
 
 	}
-
-	AppCore::smPath_Install = sFolder;
+	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();
+	PathCore::smPath_Install = sFolder;
 	m_InstallationPage->EdFilepath->SetText(sFolder.c_str());
 }
 

+ 2 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalled.cpp

@@ -1,4 +1,5 @@
 #include "CFrameWnd.h"
+#include "KeyVar.h"
 
 void CFrameWnd::InitInstalledControls()
 {
@@ -42,7 +43,7 @@ void CFrameWnd::Thread_OpenApp( ThreadData threadData)
 
 	if (cmd.OpenAppcmd())
 	{
-		DeleteFile(AppCore::smPath_Install.c_str());
+		DeleteFile(PathCore::smPath_Install.c_str());
 	}
 	
 

+ 6 - 5
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp

@@ -1,5 +1,6 @@
 //#include "duilib.h"
 #include "CFrameWnd.h"
+#include "KeyVar.h"
 
 void CFrameWnd::InitInstallingControls()
 {
@@ -38,7 +39,7 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 	CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::DownLoading;
 
 
-	isDownloadSuccess = downLoadFile.GetInstallPackage(AppCore::smPath_Install.c_str());
+	isDownloadSuccess = downLoadFile.GetInstallPackage(PathCore::smPath_Install.c_str());
 
 	if (isDownloadSuccess == false)
 	{
@@ -58,7 +59,7 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 		if (cmd.Installcmd())
 		{
 			//如果安装失败,有可能是安装路径太长的问题,此处指令并不会返回失败的值;所以需要做个判断,是否需要返回安装前的页面
-			wstring exe = AppCore::smPath_Install + L"\\" + AppCore::smName_Application;
+			wstring exe = PathCore::smPath_Install + L"\\" + Product::smName_Application;
 
 			if (AppCore::IsExistFile(exe) == false && exe.length() > 190)
 			{
@@ -74,20 +75,20 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 			}
 			else if (AppCore::IsExistFile(exe) == false)
 			{
-				wstring installError = L"因特殊操作,安装失败!请找到该安装路径下的\"" + AppCore::smName_Application + L"\"安装包进行运行安装";
+				wstring installError = L"因特殊操作,安装失败!请找到该安装路径下的\"" + Product::smName_Application + L"\"安装包进行运行安装";
 				CMsgWnd::MessageBox(
 					threadData.pFrame->m_hWnd, _T(""), installError.c_str(),
 					L"打开安装路径"
 				);
 
-				wstring folderPath = L"start " + AppCore::smPath_Install;
+				wstring folderPath = L"start " + PathCore::smPath_Install;
 				char* ch = AppCore::GetWstringToCharPtr(folderPath);
 				system(ch);
 
 			}
 				threadData.pFrame->SelectLayout(LayoutType::Installed);
 				std::wstring path = L"";
-				path = CLanguage::GetText(TextType::Btn_GoToFilesPath).c_str() + AppCore::smPath_Install;
+				path = CLanguage::GetText(TextType::Btn_GoToFilesPath).c_str() + PathCore::smPath_Install;
 				threadData.pFrame->m_InstalledPage->LbInstalledPath->SetText(path.c_str());
 
 		}

+ 3 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/XmlNode.cpp

@@ -1,4 +1,5 @@
 #include "XmlNode.h"
+#include "KeyVar.h"
 XmlNode::XmlNode()
 {
 	pDocument = new TiXmlDocument();
@@ -12,8 +13,8 @@ XmlNode::~XmlNode()
 
 const char* XmlNode::GetInstallPageVersion()
 {
-	auto SaveFolder = AppCore::GetOrCreateFolderPath(AppCore::smPath_Temp) + L"/" + L"test.xml";
-	HRESULT Hfile = URLDownloadToFile(NULL, AppCore::URI_AppXml.c_str(), SaveFolder.c_str(), 0, NULL);
+	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;

+ 2 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp

@@ -23,7 +23,7 @@
 int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)
 {
 
-	//»ñÈ¡»º´æ·¾¶
+	//»ñÈ¡»º´æ·¾¶  
 	AppCore::InitAppTempPath();
 
 	string ss = "C:\\Users\\kdan\\Desktop\\1111111111111111111111111111111111112222222222222222222222222222222222\\22222222222222222222222222222222222222222222222222222222222\\3333333333333333333333333333333333333332222222222222222222222233333334567891011121\\PDFReaderPro_V2.0.0";
@@ -47,6 +47,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR
 	pFrame->ShowWindow();
 	CSystemInfo::isWriteAppProcessInfoToIni(pFrame->GetHWND());
 	CPaintManagerUI::MessageLoop();
+	
 	::CoUninitialize();
     return 0;
 }