Browse Source

优化 - 整理代码逻辑

chenrongqian 2 years ago
parent
commit
b3ff4ac344
42 changed files with 538 additions and 627 deletions
  1. BIN
      Bin1.rar
  2. 0 192
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp
  3. 0 89
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h
  4. 2 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp
  5. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h
  6. 19 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp
  7. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.h
  8. 98 74
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp
  9. 5 7
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.h
  10. 2 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp
  11. 1 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h
  12. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h
  13. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWndInit.cpp
  14. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp
  15. 6 20
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp
  16. 2 6
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.h
  17. 16 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.cpp
  18. 2 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h
  19. 4 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/ComparVersion.cpp
  20. 1 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/ComparVersion.h
  21. 0 17
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Documentation.h
  22. 72 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp
  23. 13 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h
  24. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp
  25. 1 4
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h
  26. 2 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp
  27. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h
  28. 0 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h
  29. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h
  30. 67 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Logini.cpp
  31. 19 0
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Logini.h
  32. 2 2
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.cpp
  33. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineProduct.cpp
  34. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineProduct.h
  35. 3 6
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj
  36. 50 15
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.bak
  37. 125 152
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters
  38. 5 4
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp
  39. 4 8
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalled.cpp
  40. 7 3
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp
  41. 1 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp
  42. 0 1
      PDFReaderPro_Installer/PDFReaderPro_Insrtaller/stdafx.h

BIN
Bin1.rar


+ 0 - 192
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.cpp

@@ -1,192 +0,0 @@
-
-#include "stdafx.h"
-#include "AppCore.h"
-#include "KeyVar.h"
-
-#pragma region 文件路径
-
-wstring AppCore::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 AppCore::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;
-}
-
-wstring AppCore::SetSHGetFolderPath(_In_ int csidl)
-{
-	TCHAR szPath[MAX_PATH];
-	if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, szPath)))
-	{
-		wstring temp(szPath);
-		return temp;
-	}
-	return L"";
-}
-
-wstring AppCore::GetAppTempPath()
-{
-	 if (PathCore::smPath_Temp == L"")
-	 {
-		 PathCore::smPath_Temp = PathCore::smPath_Install;
-	 }
-	 return PathCore::smPath_Temp;
-}
-
-void AppCore::InitAppTempPath()
- {
-	 wchar_t strTmpDir[MAX_PATH] = { 0 };
-	 GetTempPathW(MAX_PATH, strTmpDir);
-	 wstring temp = wstring(strTmpDir);
-	 temp = L"";
-	 if (temp.empty() == false && temp != L"")
-	 {
-		 temp = temp + TempFolderName;//Temp缓存文件
-	 }
-	 else
-	 {
-		 temp = SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + TempFolderName;//文档
-	 }
-
-	 BOOL isCreate = True;
-	 if (!PathIsDirectoryW(temp.c_str()))
-		 isCreate = CreateDirectory((temp.c_str()), NULL);
-
-	 if (isCreate == FALSE)
-		 temp = L"";
-
-	 /*temp = temp+L"\\";*/
-// PathCore::smPath_Temp = AppCore::ReplaceSubStr(temp, L"\\", L"/");
-	 PathCore::smPath_Temp = temp;
-
-	 isCreate = True;
-
-	 if (!PathIsDirectoryW(PathCore::smPath_Install.c_str()))
-		 isCreate = CreateDirectory((PathCore::smPath_Install.c_str()), NULL);
-
-	 if (isCreate)
-	 {
-		 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);
-
-		 PathCore::smPath_DefaultInstall = PathCore::smPath_Install;
-	 }
- }
-
-void AppCore::ClearAllTempFolder()
-{
-	    RemoveDirectory(PathCore::smPath_Temp.c_str());
-		wstring installPathFile = PathCore::smPath_Install + L"\\" + Product::smName_InstallPackage;
-		DeleteFile(installPathFile.c_str());
-}
-
-
-char* AppCore::GetWstringToCharPtr(wstring ws)
-{
-	wchar_t* ptr = _wcsdup(ws.c_str());
-	char* ch = AppCore::GetWideCharToMultiByte(ptr);
-	return ch;
-}
-
-BOOL AppCore::IsExistFile(wstring filePath, BOOL bIsDirCheck)
-{
-
-	DWORD dwAttributes = ::GetFileAttributes(filePath.c_str());
-	if (INVALID_FILE_ATTRIBUTES == dwAttributes)
-	{
-		//不存在这个路径,或非法路径
-		return FALSE;
-	}
-	return TRUE;
-	//因测试条件限制(测试环境受限,测试用例少),不能轻易拆分更细的判断条件
-	////是目录
-	//if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
-	//{
-	//	if (bIsDirCheck) //当前检测的也是目录
-	//	{
-	//		return TRUE;
-	//	}
-	//	else
-	//		return FALSE;
-	//}
-	//else //是文件
-	//{
-	//	if (bIsDirCheck)
-	//	{
-	//		return FALSE;
-	//	}
-	//	else
-	//		return TRUE;
-	//}
-}
-
-#pragma endregion
-
-
-
-#pragma region 字符串编码处理
-
-wstring AppCore::GetMultiByteToWideChar(char* multiByte)
-{
-	//Todo:	char* ch = (LPSTR)(LPCTSTR)multiByte;//当multiByte为std::string类型时
-	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;
-}
-
-char* AppCore::GetWideCharToMultiByte(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;
-}
-
-std::wstring AppCore::ReplaceSubStr(wstring sourceSrc, const wstring& oldSubStr, const wstring& newSubStr)
-{
-	wstring strRet = sourceSrc;
-	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
-
-

+ 0 - 89
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/AppCore.h

@@ -1,89 +0,0 @@
-#pragma once
-#include<string>
-using namespace std;
-#include "stdafx.h"
-#include "duilib.h"
-#include <Shlwapi.h>
-#pragma region 使用说明
-
-//文件的作用:
-//    1.网页链接:获取安装包信息的链接,安装包资源的链接;获取Banner json链接等
-//     作用:获取在线资源到本地;
-//     命名规范:Url_xxx;
-// 
-//    2.文件名称:安装包包名称,安装后的程序名称;创建Banner json文件名称等
-//     作用:根据名称,用于对对应名称的资源进行操作处理;
-//     命名规范:smName_xxx;
-// 
-//    3.默认路径:默认安装程序的路径;存放Banner轮播图片的路径;
-//     作用:作为文件缓存路径;退出下载器后,用于删除缓存文件;
-//     命名规范:smPath_xxx;
-// 
-//    4.函数:创建文件夹,字符串编码格式转换等
-//     作用:可通用任何范围
-//     命名规范:Get_xxx,Set_xxx;
-// 
-//    5.备注:由于通用其他产品的下载器,以下字符串变量会以"(对应产品)"来备注说明为:该项目改为用于其他产品的下载器时,必须要替换为对应产品的字符串内容
-
-#pragma endregion
-
-/// <summary>
-/// 方便修改和使用,重要的处理的字符串变量和公共函数;
-/// </summary>
-static class AppCore
-{
-public:
-
-public:
-	static void ClearAllTempFolder();
-
-
-public:
-	static wstring GetNewSaveFolder(std::wstring saveFilePath, std::wstring oldchar, std::wstring newchar);
-	static wstring GetOrCreateFolderPath(std::wstring saveFilePath);
-	/// <summary>
-	/// 获取系统路径
-	/// </summary>
-	/// <param name="csidl">系统指定的路径名称,例如user\\kdan\\文档</param>
-	/// <returns>系统路径</returns>
-	static wstring  SetSHGetFolderPath(_In_ int csidl);
-
-	/// <summary>
-	/// 获取缓存路径,并在缓存路径下创建一个文件夹
-	/// </summary>
-	/// <returns>如果获取不到缓存路径,就更换为文档路径;若两个路径都获取不到,就返回空字符串</returns>
-	static wstring  GetAppTempPath();
-
-	static void InitAppTempPath();
-	/// <summary>
-	/// 判断文件是否存在
-	/// </summary>
-	/// <param name="filePath">文件或目录</param>
-	/// <param name="bIsDirCheck">False为文件,TRUE为目录</param>
-	/// <returns></returns>
-	static BOOL IsExistFile(wstring filePath, BOOL bIsDirCheck = FALSE);
-
-#pragma region 字符串处理
-
-	/// <summary>
-	/// 多字节字符转换为宽字符
-	/// </summary>
-	static wstring GetMultiByteToWideChar(char* multiByte);
-
-	/// <summary>
-	/// 宽字符转换为多字节字符
-	/// </summary>
-	/// <param name="wideChar"></param>
-	/// <returns></returns>
-	static char* GetWideCharToMultiByte(wchar_t* wideChar);
-
-	static wstring ReplaceSubStr(wstring sourceSrc, const wstring& oldSubStr, const wstring& newSubStr);
-
-	static char* GetWstringToCharPtr(wstring ws);
-
-#pragma endregion
-
-	
-};
-
-

+ 2 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.cpp

@@ -179,7 +179,7 @@ std::wstring CAccessRegedit::GetVersionFromXML()
 {
 	OnlineProduct xmlNode;
 	char* newstr = const_cast<char*>(xmlNode.GetInstallPageVersion(L""));
-	VersionFromXML = AppCore::GetMultiByteToWideChar(newstr);
+	VersionFromXML = CharConvert::GetWideCharW(newstr);
 	return VersionFromXML;
 }
 
@@ -214,7 +214,7 @@ std::vector<std::string> CAccessRegedit::GetBannerlinkFromJson(std::wstring st)
 	DownloadProgress progress;
 	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
 
-	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
+	auto SaveFolder = FolderCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
 	HRESULT Hfile = URLDownloadToFile(NULL, BannerCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0, static_cast<IBindStatusCallback*>(&progress));
 
 	//¿í×Ö·ûת¶à×Ö½Ú×Ö·û

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAccessRegedit.h

@@ -1,9 +1,9 @@
 #pragma once
 #include<string>
 #include<windows.h>
-#include "AppCore.h"
 #include "CClasses.h"
 #include<vector>
+#include "FileCore.h"
 
 typedef struct _URL_INFO
 {

+ 19 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.cpp

@@ -1,5 +1,6 @@
 #include "CAdsBanner.h"
 #include "KeyVar.h"
+#include "CLanguage.h"
 CAdsBanner::CAdsBanner()
 {
 
@@ -7,7 +8,7 @@ CAdsBanner::CAdsBanner()
 
 std::vector<std::string> CAdsBanner::GetBannerlinkFromJson(std::wstring st)
 {
-	auto SaveFolder = AppCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
+	auto SaveFolder = FolderCore::GetOrCreateFolderPath(st) + L"/" + BannerCore::smName_BannerJson;
 	HRESULT Hfile = URLDownloadToFile(NULL, BannerCore::URI_BannerJson.c_str(), SaveFolder.c_str(), 0,NULL);
 
 	//¿í×Ö·ûת¶à×Ö½Ú×Ö·û
@@ -31,8 +32,24 @@ std::vector<std::string> CAdsBanner::ReadJsonFromFile(const char* file)
 		BannerCollection.clear();
 		if (reader.parse(is, root))
 		{
+			Json::Value val_image;
+			LanguageType type = CLanguage::GetLocalLanguage(false);
+			switch (type)
+			{
+			case LanguageType::EN_US:
+				val_image = root["url"]["en"];
+				break;
+			case LanguageType::ZH_CN:
+				val_image = root["url"]["zh-cn"];
+				break;
+			case LanguageType::ZH_TW:
+				val_image = root["url"]["zh-tw"];
+				break;
+			default:
+				val_image = root["url"]["en"];
+				break;
+			}
 
-			Json::Value val_image = root["url"]["en"];
 			int image_size = val_image.size();
 			for (int j = 0; j < image_size; ++j)
 			{

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CAdsBanner.h

@@ -1,9 +1,9 @@
 //#pragma once
-#include "AppCore.h"
 #include <shlobj.h>
 #include <atlstr.h>
 #include <json/reader.h>
 #include <fstream>
+#include "FileCore.h"
 class CAdsBanner
 {
 public:

+ 98 - 74
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.cpp

@@ -1,6 +1,7 @@
 #include "CCmd.h"
-#include <time.h>
 #include "KeyVar.h"
+#include <ShlObj.h>
+#include "Logini.h"
 #pragma region cmd指令说明
 // 【/k】:调用cmd进程时,必须调用此参数
 // //  【x:】:x为x盘符,cd到不同盘符下的文件夹路径之前,必须要要调用此参数,否则cd指令不生效;
@@ -24,7 +25,7 @@ BOOL CCmd::Installcmd()
 	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);
+	LogIni::GetLogToIni("Install cmd", cmd);
 	TCHAR* tc = (TCHAR*)(&cmd[0]);
 	return Executecmd(tc);
 }
@@ -47,7 +48,7 @@ BOOL CCmd::InstallNetcmd()
 
 	std::wstring cmd = L"";
 	cmd = L"/k cd " + netframe + L" & aspnet_regiis.exe -i /qb /qn /norestart";
-	WriteInIniFile("NET Framework4.0", cmd);
+	LogIni::GetLogToIni("NET Framework4.0", cmd);
 	TCHAR* tc = (TCHAR*)(&cmd[0]);
 	return Executecmd(tc);
 }
@@ -60,38 +61,12 @@ BOOL CCmd::OpenAppcmd()
 
 		cmd = L"/k " + cdDisk + L"cd \"" + PathCore::smPath_Install + L"\"" + L" & start/wait " + Product::smName_Application;
 
-	WriteInIniFile("Start App cmd", cmd);
+    LogIni::GetLogToIni("Start App cmd", cmd);
 	TCHAR* tc = (TCHAR*)(&cmd[0]);
    return Executecmd(tc);
 }
 
-
-void CCmd::WriteInIniFile(string contentType,wstring cmdContent)
-{
-	//文件:存放在文档里
-	wstring wPath = AppCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + L"SilentInstallationLog.ini";
-	wchar_t* ptrPath = _wcsdup(wPath.c_str());
-	std::string sPath = AppCore::GetWideCharToMultiByte(ptrPath);
-
-	time_t t;
-	tm tmp;
-	time(&t);
-	localtime_s(&tmp, &t);
-	string  strTime = to_string(tmp.tm_year + 1900) +"/" + to_string(tmp.tm_mon + 1) + "/" + to_string(tmp.tm_mday) + "--" + to_string(tmp.tm_hour) + ":" + to_string(tmp.tm_min) + ":" + to_string(tmp.tm_sec);
-	char* chTime = (LPSTR)(LPCTSTR)strTime.c_str();
-	AppCore::GetMultiByteToWideChar(chTime);
-
-	wstring cmdStr = cmdContent;
-	wchar_t* cmdptr = _wcsdup(cmdStr.c_str());
-	char* cmdCh = AppCore::GetWideCharToMultiByte(cmdptr);
-
-	char* chcontentType = (LPSTR)(LPCTSTR)contentType.c_str();
-
-	DWORD pidIni = WritePrivateProfileStringA(chTime, chcontentType, cmdCh, sPath.c_str());
-}
-
-
-BOOL CCmd::Executecmd(TCHAR pszCmdLine[])
+BOOL CCmd::Executecmd(TCHAR pszCmdLine[],bool isVBA)
 {
 		char Buffer[4096];
 		STARTUPINFO sInfo;//新进程的主窗口特性
@@ -115,8 +90,17 @@ BOOL CCmd::Executecmd(TCHAR pszCmdLine[])
 		sInfo.hStdError = hWrite;   //将管道的写端交给子进程
 		sInfo.hStdOutput = hWrite;
 		memset(&pInfo, 0, sizeof(pInfo));
-		
-		if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", pszCmdLine , NULL, NULL, TRUE, 0, NULL, NULL, &sInfo, &pInfo)) 
+		wstring cmdPath = L"";
+		if(isVBA == false)
+		{
+		 cmdPath = L"c:\\windows\\system32\\cmd.exe";
+		}
+		else
+		{
+			wstring Installpath = PathCore::smPath_Install + L"\\install.bat";
+			cmdPath = Installpath;
+		}
+		if (!CreateProcessW(cmdPath.c_str(), pszCmdLine, NULL, NULL, TRUE, 0, NULL, NULL, &sInfo, &pInfo))
 		{
 			CloseHandle(hWrite);
 			CloseHandle(hRead);
@@ -149,86 +133,126 @@ BOOL CCmd::Executecmd(TCHAR pszCmdLine[])
 		return TRUE;
 
 }
+bool CCmd::GetVBA() 
+{
+	
+	std::wstring cmdd = L"";
+	std::wstring echoc = L"ECHO.";
+	cmdd = L"@echo off\n" +
+		echoc + L"\n" +
+		PathCore::smPath_Install.substr(0, 1) + L": & " + L"cd " + L"%~dp0" + L"\n" +
+		echoc + L"\n" +
+		echoc + L"\n" +
+		L"start/wait " + Product::smName_InstallPackage + L" APPDIR=\""+ PathCore::smPath_Install +L"\" /qb /qn" + L"\n" +
+		echoc + L"\n" +
+		L"EXIT";
+	wstring Installpath = PathCore::smPath_Install + L"\\install.bat";
+	HANDLE hDevice = CreateFileW(Installpath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0,
+		OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
 
-//其他执行cmd的方式
-//	//system("cmd.exe /k start/wait C:\\Users\\kdan\\Desktop\\Demo\\PDFReaderPro.exe /qb /qn /norestart");
-//	SHELLEXECUTEINFO ShExecInfo = { 0 };
-//	ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
-//	ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
-//	ShExecInfo.hwnd = NULL;
-//	ShExecInfo.lpVerb = NULL;
-//	ShExecInfo.lpFile = L"cmd.exe";//调用的程序名
-//	ShExecInfo.lpParameters = L"/k start/wait C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro\\PDFReaderPro.exe APPDIR=C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro APPDATADIR=C:\\Users\\kdan\\Desktop\\ceshi\\PDFReaderPro /qn";///qb调用程序的命令行参数
-//	ShExecInfo.lpDirectory = NULL;
-//	ShExecInfo.nShow = SW_HIDE;//窗口状态为隐藏
-//	ShExecInfo.hInstApp = NULL;
-//	ShellExecuteEx(&ShExecInfo); //启动新的程序
-//	WaitForSingleObject(ShExecInfo.hProcess, INFINITE);////等到该进程结束
-////C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
-//	/*Start - Process - FilePath C : \Users\kdan\Desktop\Demo\PDFReaderPro.exe / qn*/
-//	return true;
-
-string CCmd::GetVBAContent()
+	if (hDevice == INVALID_HANDLE_VALUE)
+	{
+		DWORD errorCode = GetLastError();
+		return false;
+	}
+	
+	//char* chBuffer = d2;
+	DWORD dwWriteSize = 0;
+	auto chBuffer =cmdd.c_str();
+	DWORD nBytes;
+	WORD a = 0xFEFF;
+	WriteFile(hDevice, &a, sizeof(a), &nBytes, NULL);
+	BOOL bRet = WriteFile(hDevice, chBuffer, lstrlen(chBuffer) * sizeof(wchar_t), &nBytes, NULL);
+	//BOOL bRet = WriteFile(hDevice, chBuffer, cmdd.length(), &dwWriteSize, NULL);
+	//BOOL bRet = WriteFile(hDevice, chBuffer, cmdd.length(), &dwWriteSize, NULL);
+	if (bRet)
+	{
+
+	}
+	FlushFileBuffers(hDevice);   //将缓冲区数据写入磁盘
+
+	LONG IDistance = 0;
+	DWORD dwPtr = SetFilePointer(hDevice, IDistance, NULL, FILE_BEGIN);  //调整文件指针到文件开头
+	DWORD dwSize = GetFileSize(hDevice, NULL);
+	//bRet = ReadFile(hDevice, chBuffer, dwSize, &dwSize, NULL);
+	//if (bRet)
+	//{
+	//	//printf("chbuffer is %s /n", chBuffer);
+	//}
+	CloseHandle(hDevice);
+	Executecmd(nullptr,true);
+}
+
+bool CCmd::GetVBAContent()
 {
 
-	std::wstring bat = L"";
-	std::wstring echo = L"ECHO.";
-	bat = L"@echo off\u79c1" +
-		echo + L"\u79c1" +
-		L"cd " + PathCore::smPath_Install.substr(0, 1) + L":" + L"%~dp0" + L"\u79c1" +
-		echo + L"\u79c1" +
-		echo + L"\u79c1" +
-		L"start/wait " + Product::smName_InstallPackage + L" APPDIR=%cd% /qb /qn" + L"\u79c1" +
-		echo + L"\u79c1" +
-		L"EXIT";
+	//std::wstring bat = L"";
+	//std::wstring echo = L"ECHO.";
+	//bat = L"@echo off\n" +
+	//	echo + L"\n" +
+	//	L"cd " + PathCore::smPath_Install.substr(0, 1) + L":" + L"%~dp0" + L"\n" +
+	//	echo + L"\n" +
+	//	echo + L"\n" +
+	//	L"start/wait " + Product::smName_InstallPackage + L" APPDIR=%cd% /qb /qn" + L"\n" +
+	//	echo + L"\n" +
+	//	L"EXIT";
 
-	LPCWSTR sss = _T("C:\\Program Files\\PDF Technologies, Inc\\PDF Reader Pro\\install.bat");
+	wstring Installpath = PathCore::smPath_Install + L"\\install.bat";
+	LPCWSTR Installpathstr = Installpath.c_str();
 
 	wchar_t* rootptr = _wcsdup(PathCore::smPath_Install.substr(0, 1).c_str());
-	auto rootch = AppCore::GetWideCharToMultiByte(rootptr);
+	auto rootch = CharConvert::GetMultiByteW(rootptr);
 
-	wchar_t* ptrInstallPackage = _wcsdup(Product::smName_InstallPackage.substr(0, 1).c_str());
-	auto InstallPackagech = AppCore::GetWideCharToMultiByte(ptrInstallPackage);
+	wchar_t* rootptr22 = _wcsdup(PathCore::smPath_Install.c_str());
+	auto rootch22 = CharConvert::GetMultiByteW(rootptr22);
+
+
+	wchar_t* ptrInstallPackage = _wcsdup(Product::smName_InstallPackage.c_str()/*.substr(0, 1).c_str()*/);
+	auto InstallPackagech = CharConvert::GetMultiByteW(ptrInstallPackage);
 
 	std::string cmdd = "";
 	std::string echoc = "ECHO.";
 	cmdd = "@echo off\n" +
 		echoc + "\n" +
-		"cd " + rootch + ":" + "%~dp0" + "\n" +
+		rootch + ": & " + "cd " +  "%~dp0" + "\n" +
 		echoc + "\n" +
 		echoc + "\n" +
-		"start/wait " + InstallPackagech + " APPDIR=%cd% /qb /qn" + "\n" +
+		"start/wait " + InstallPackagech + " APPDIR=%cd%"+  +" /qb /qn" + "\n" +
 		echoc + "\n" +
 		"EXIT";
 	char* chBuffer = &cmdd[0];
 
-	HANDLE hDevice = CreateFile(sss, GENERIC_READ | GENERIC_WRITE, 0, 0,
+	HANDLE hDevice = CreateFile(Installpathstr, GENERIC_READ | GENERIC_WRITE, 0, 0,
 		OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
 
 	if (hDevice == INVALID_HANDLE_VALUE)
 	{
 		DWORD errorCode = GetLastError();
-		return 0;
+		return false;
 	}
 	DWORD dwSize = GetFileSize(hDevice, NULL);
 	//char* chBuffer = d2;
 	DWORD dwWriteSize = 0;
-	BOOL bRet = WriteFile(hDevice, chBuffer, cmdd.length(), &dwWriteSize, NULL);
+	WORD a = 0xFEFF;
+	WriteFile(hDevice, &a, sizeof(a), &dwWriteSize, NULL);
+	 BOOL bRet = WriteFile(hDevice, chBuffer, lstrlenA(chBuffer) * sizeof(char), &dwWriteSize, NULL);
+	//BOOL bRet = WriteFile(hDevice, chBuffer, cmdd.length(), &dwWriteSize, NULL);
 	if (bRet)
 	{
-
+		return false;
 	}
 	FlushFileBuffers(hDevice);   //将缓冲区数据写入磁盘
 
 	LONG IDistance = 0;
 	DWORD dwPtr = SetFilePointer(hDevice, IDistance, NULL, FILE_BEGIN);  //调整文件指针到文件开头
 	DWORD dwReadSize = 0;
-	bRet = ReadFile(hDevice, chBuffer, 10, &dwReadSize, NULL);
+	/*bRet = ReadFile(hDevice, chBuffer, 10, &dwReadSize, NULL);
 	if (bRet)
 	{
 		printf("chbuffer is %s /n", chBuffer);
-	}
+	}*/
 	CloseHandle(hDevice);
 
+	return Executecmd(nullptr, true);;
 
 }

+ 5 - 7
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CCmd.h

@@ -1,10 +1,10 @@
 #pragma once
 #include<string>
-#include "AppCore.h"
 #include <tchar.h>
 #include <windows.h>
 #include "CCmd.h"
-
+#include "CharConvert.h"
+#include "FileCore.h"
 
 
 class CCmd
@@ -17,11 +17,9 @@ public:
 	 BOOL Installcmd();
 	//打开App指令
 	 BOOL OpenAppcmd();
-	 BOOL Executecmd(TCHAR pszCmdLine[]);
-	 //测试代码:事件日志
-	 void WriteInIniFile(string contentType, wstring cmdContent);
-	 string GetVBAContent();
-
+	 BOOL Executecmd(TCHAR pszCmdLine[], bool isVBA = false);
+	 bool GetVBAContent();
+	 bool GetVBA();
 	 BOOL InstallNetcmd();
 };
 

+ 2 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.cpp

@@ -1,6 +1,7 @@
 #include "CDownLoadFile.h"
 #include <WinInet.h>
 #include "KeyVar.h"
+#include <Shlwapi.h>
 
 double DownloadProgress::Currentpercentage = 0;
 double DownloadProgress::pro_value = 0;
@@ -13,7 +14,7 @@ bool CDownLoadFile::GetInstallPackage(std::wstring SaveFolder)
 	DownloadProgress progress;
 	IBindStatusCallback* callback = (IBindStatusCallback*)&progress;
 
-	SaveFolder = AppCore::GetOrCreateFolderPath(SaveFolder) + L"/" + Product::smName_InstallPackage;
+	SaveFolder = FolderCore::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)

+ 1 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CDownLoadFile.h

@@ -1,10 +1,9 @@
 #pragma once
-#include "AppCore.h"
 #include <winerror.h>
 #include<BASETYPS.H>
 #include <urlmon.h>
 #pragma comment(lib, "urlmon.lib")
-
+#include "FileCore.h"
 
 class DownloadProgress : public IBindStatusCallback
 {

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWnd.h

@@ -24,7 +24,7 @@
 #include "KeyVar.h"
 #include "FileCore.h"
 #include "ComparVersion.h"
-
+#include "CharConvert.h"
  class CFrameWnd : public WindowImplBase
 {
 

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CFrameWndInit.cpp

@@ -144,7 +144,7 @@ LRESULT CFrameWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam,
 	case WM_DESTROY:
 	{
 		::PostQuitMessage(0);
-		AppCore::ClearAllTempFolder();
+		FolderCore::ClearAllTempFolder();
 		break;
 	}
 

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CLanguage.cpp

@@ -10,7 +10,7 @@ std::wstring CLanguage::GetContent(TextType textType)
     switch (textType)
     {
     case TextType::Btn_Install:
-        content = LoadLanguage(L"Install", L"¿ªÊ¼°²×°", L"é_ʼ°²Ñb");
+        content = LoadLanguage(L"Install\n", L"¿ªÊ¼°²×°\n", L"é_ʼ°²Ñb\n");
         break;
 
     case TextType::Btn_CutomInstall:

+ 6 - 20
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.cpp

@@ -1,6 +1,5 @@
 #include "CSystemInfo.h"
 #include <string>
-#include "stdafx.h"
 
 #define APPCONFIG L"config.ini"
 #define THREADPROCESS "ThreadProcess"
@@ -18,7 +17,7 @@ bool CSystemInfo::IsHanvedCurrentWindow()
 {
 	std::wstring ss1 = PathCore::smPath_Temp + L"\\" + APPCONFIG;
 	wchar_t* ptr = _wcsdup(ss1.c_str());
-	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
+	std::string ss = CharConvert::GetMultiByteW(ptr);
 	HANDLE h = ::CreateMutex(NULL, TRUE, ExeCore::smName_ExeProcess.c_str());
 
 	if (h != NULL)
@@ -26,8 +25,8 @@ bool CSystemInfo::IsHanvedCurrentWindow()
 		if (GetLastError() == ERROR_ALREADY_EXISTS)
 		{
 			
-			DWORD pidIni = ReadIntFromini(THREADPROCESS, PID, 0, ss.c_str());
-		    DWORD TheardIdIni = ReadIntFromini(THREADPROCESS, THREADID, 0, ss.c_str());
+			DWORD pidIni = LogIni::ReadIntFromini(THREADPROCESS, PID, 0, ss.c_str());
+		    DWORD TheardIdIni = LogIni::ReadIntFromini(THREADPROCESS, THREADID, 0, ss.c_str());
 
 			HWND hWnd = ::GetTopWindow(0);
 			while (hWnd)
@@ -54,7 +53,6 @@ bool CSystemInfo::IsHanvedCurrentWindow()
 
 			}
 
-
 			CloseHandle(h);
 			h = NULL;
 			return true;
@@ -69,23 +67,11 @@ bool CSystemInfo::IsHanvedCurrentWindow()
 {
 	std::wstring ss1 = PathCore::smPath_Temp + L"\\" + APPCONFIG;
 	wchar_t* ptr = _wcsdup(ss1.c_str());
-	std::string ss = AppCore::GetWideCharToMultiByte(ptr);
+	std::string ss = CharConvert::GetMultiByteW(ptr);
 	DWORD pid = 0;
 	DWORD dwTheardId = ::GetWindowThreadProcessId(hwnd, &pid);
-	BOOL readpid = CSystemInfo::WriteIntToini(THREADPROCESS, PID, pid, ss.c_str());
-	BOOL readTheardId = CSystemInfo::WriteIntToini(THREADPROCESS, THREADID, dwTheardId, ss.c_str());
+	BOOL readpid = LogIni::WriteIntToini(THREADPROCESS, PID, pid, ss.c_str());
+	BOOL readTheardId = LogIni::WriteIntToini(THREADPROCESS, THREADID, dwTheardId, ss.c_str());
 
 	return (readpid > 0 && readTheardId > 0);
 }
-
-DWORD CSystemInfo::WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
-{
-	char _Buf[64];
-	_CSTD sprintf_s(_Buf, sizeof(_Buf), "%u", nDefault);
-	return WritePrivateProfileStringA(lpAppNam, lpKeyName, _Buf, lpFileName);
-}
-
-DWORD CSystemInfo::ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
-{
-	return  GetPrivateProfileIntA(lpAppNam, lpKeyName, nDefault, lpFileName);
-}

+ 2 - 6
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CSystemInfo.h

@@ -1,6 +1,6 @@
 #pragma once
-#include "windows.h"
-
+#include "CharConvert.h"
+#include "LogIni.h"
 class CSystemInfo
 {
 public:
@@ -8,9 +8,5 @@ public:
 	static bool IsHanvedCurrentWindow();//是否已显示当前窗口
 
 	static bool isWriteAppProcessInfoToIni(HWND hwnd);//记录程序进程PID和线程ID,用来识别窗口句柄
-
-	static DWORD WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);//写入ini内容
-	static DWORD ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);//读取ini内容
-
 };
 

+ 16 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.cpp

@@ -17,6 +17,12 @@ wchar_t* CharConvert::wstringToWchar_tPtrW(wstring ws)
 	return ptr;
 }
 
+char* CharConvert::GetWstringToCharPtr(wstring ws)
+{
+	wchar_t* ptr = _wcsdup(ws.c_str());
+	char* ch = CharConvert::GetMultiByteW(ptr);
+	return ch;
+}
 #pragma endregion
 
 #pragma region UnicodeºÍANSI
@@ -49,6 +55,16 @@ char* CharConvert::GetMultiByteW(wchar_t* wideChar)
 	return multiByte;
 }
 
+char* CharConvert::GetMultiByteUTF8W(wchar_t* wideChar)
+{
+	char* multiByte;
+	int iwstrLen = WideCharToMultiByte(CP_UTF8, 0, wideChar, -1, 0, 0, 0, 0);
+	multiByte = new char[iwstrLen + 1];
+	memset(multiByte, 0, sizeof(char) * (iwstrLen + 1));
+	WideCharToMultiByte(CP_UTF8, 0, wideChar, -1, multiByte, iwstrLen, 0, 0);
+	return multiByte;
+}
+
 char* CharConvert::GetMultiByteW(wstring wideStr)
 {
 	wchar_t* ptr = _wcsdup(wideStr.c_str());

+ 2 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/CharConvert.h

@@ -23,6 +23,7 @@ public:
 	/// <returns></returns>
 	static char* GetMultiByteW(wchar_t* wideChar);
 	static char* GetMultiByteW(wstring wideStr);
+	static char* GetMultiByteUTF8W(wchar_t* wideChar);
 
 	static wstring ReplaceSubStrW(wstring sourceStr, const wstring& oldSubStr, const wstring& newSubStr);
 
@@ -33,7 +34,7 @@ public:
 
 	static char* StringTocharPtrA(string* sourceStr);
 	static wchar_t* wstringToWchar_tPtrW(wstring ws);
-
+	static char* GetWstringToCharPtr(wstring ws);
 #pragma endregion
 
 };

+ 4 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/ComparVersion.cpp

@@ -1,5 +1,6 @@
 #include "ComparVersion.h"
 #include "CCmd.h"
+#include "Logini.h"
 VertionResultType ComparVersion::GetProductInfo(wstring productName,wstring productUrl)
 {
 	DeviceProduct deviceProduct = DeviceProduct(productName);
@@ -19,9 +20,9 @@ VertionResultType ComparVersion::GetProductInfo(wstring productName,wstring prod
 }
 VertionResultType ComparVersion::GetCompareVersion(wstring deviceVersion,wstring onlineVersion)
 {
-	CCmd  cmd;
-	wstring test = L"DeviceVersion:" + deviceVersion + L"--OnlineVersion:" + onlineVersion;
-	cmd.WriteInIniFile("DeviceVersion:", test);
+	std::map<wstring, wstring> map{ {L"DeviceVersion", deviceVersion}, { L"OnlineVersion",onlineVersion }};
+	LogIni::GetLogToIniMaps(map);
+
 	VertionResultType state = VertionResultType::None;
 	if (deviceVersion.find(onlineVersion) != -1)
 	{

+ 1 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/ComparVersion.h

@@ -24,6 +24,7 @@ public:
 	//对比版本:架上版本号、设备已安装版本号
 	VertionResultType GetCompareVersion(wstring deviceVersion, wstring onlineVersion);
 public:
+	//检查设备Net框架
 	static int GetCompareNETFramework(wstring minVersion, wstring maxVersion);
 };
 

+ 0 - 17
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Documentation.h

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

+ 72 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.cpp

@@ -1,6 +1,7 @@
 #include "FileCore.h"
 #include "stdafx.h"
 #include "KeyVar.h"
+#include <Shlwapi.h>
 
 #pragma region Îļþ
 
@@ -108,6 +109,77 @@ wstring FolderCore::FolderBrowser(HWND m_hWnd)
 	std::wstring sFolder(strFolder);
 	return sFolder;
 }
+
+wstring FolderCore::SetSHGetFolderPath(_In_ int csidl)
+{
+	TCHAR szPath[MAX_PATH];
+	if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, szPath)))
+	{
+		wstring temp(szPath);
+		return temp;
+	}
+	return L"";
+}
+
+
+void FolderCore::InitAppTempPath()
+{
+	wchar_t strTmpDir[MAX_PATH] = { 0 };
+	GetTempPathW(MAX_PATH, strTmpDir);
+	wstring temp = wstring(strTmpDir);
+	temp = L"";
+	if (temp.empty() == false && temp != L"")
+	{
+		temp = temp + TempFolderName;//Temp»º´æÎļþ
+	}
+	else
+	{
+		temp = SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + TempFolderName;//Îĵµ
+	}
+
+	BOOL isCreate = True;
+	if (!PathIsDirectoryW(temp.c_str()))
+		isCreate = CreateDirectory((temp.c_str()), NULL);
+
+	if (isCreate == FALSE)
+		temp = L"";
+
+	/*temp = temp+L"\\";*/
+// PathCore::smPath_Temp = AppCore::ReplaceSubStr(temp, L"\\", L"/");
+	PathCore::smPath_Temp = temp;
+
+	isCreate = True;
+
+	if (!PathIsDirectoryW(PathCore::smPath_Install.c_str()))
+		isCreate = CreateDirectory((PathCore::smPath_Install.c_str()), NULL);
+
+	if (isCreate)
+	{
+		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);
+
+		PathCore::smPath_DefaultInstall = PathCore::smPath_Install;
+	}
+}
+
+wstring FolderCore::GetAppTempPath()
+{
+	if (PathCore::smPath_Temp == L"")
+	{
+		PathCore::smPath_Temp = PathCore::smPath_Install;
+	}
+	return PathCore::smPath_Temp;
+}
+
+void FolderCore::ClearAllTempFolder()
+{
+	RemoveDirectory(PathCore::smPath_Temp.c_str());
+	wstring installPathFile = PathCore::smPath_Install + L"\\" + Product::smName_InstallPackage;
+	DeleteFile(installPathFile.c_str());
+}
+
+
 #pragma endregion
 
 #pragma region ´ÅÅÌ

+ 13 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/FileCore.h

@@ -27,6 +27,19 @@ public:
 	static wstring AddSubFolderFromRootDirW(wstring folderPath, wstring newSubFolderName);
 	//文件夹选择器
 	static wstring FolderBrowser(HWND m_hWnd);
+	/// <summary>
+/// 获取系统路径
+/// </summary>
+/// <param name="csidl">系统指定的路径名称,例如user\\kdan\\文档</param>
+/// <returns>系统路径</returns>
+	static wstring  SetSHGetFolderPath(_In_ int csidl);
+	static void InitAppTempPath();
+	/// <summary>
+	/// 获取缓存路径,并在缓存路径下创建一个文件夹
+	/// </summary>
+	/// <returns>如果获取不到缓存路径,就更换为文档路径;若两个路径都获取不到,就返回空字符串</returns>
+	static wstring  GetAppTempPath();
+	static void ClearAllTempFolder();
 #pragma endregion
 
 

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.cpp

@@ -48,7 +48,7 @@ void InstallationPage::InitLanguage()
 	Btninstall->SetText(UIstr(TextType::Btn_Install));
 	BtnTextSelectFolder->SetText(UIstr(TextType::Btn_FilePath));
 	EdFilepath->SetText(PathCore::smPath_Install.c_str());
-	AppCore::GetOrCreateFolderPath(PathCore::smPath_Install);
+	FolderCore::GetOrCreateFolderPath(PathCore::smPath_Install);
 	TextShowContentLink->SetText(UIstr(TextType::Link_Install));
 
 	CheckInstallSetting->SetText(UIstr(TextType::Btn_CutomInstall));

+ 1 - 4
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallPage.h

@@ -1,13 +1,10 @@
 #pragma once
 #include "CLanguage.h"
-//#include "CConstString.h"
 #include "CClasses.h"
-//#include "CAccessRegedit.h"
 #include "duilib.h"
 #include "resource.h"
-#include "AppCore.h"
 #include "DefineUI.h"
-
+#include "FileCore.h"
 //°²×°Ö÷Ò³½çÃæ
 #pragma region Îļþ˵Ã÷
 

+ 2 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.cpp

@@ -39,9 +39,9 @@ void InstalledPage::RefreshInstalledPath(wstring sFolder)
 {
 	LbInstalledPath->SetToolTipWidth(LbInstalledPath->GetWidth());
 	//路径超过一定的长度,字符串末尾显示省略号
-	if (sFolder.length() > 90)
+	if (sFolder.length() > 70)
 	{
-		wstring str = sFolder.substr(0, 90) + L"...";
+		wstring str = sFolder.substr(0, 70) + L"...";
 		LbInstalledPath->SetToolTip(sFolder.c_str());
 		LbInstalledPath->SetText(str.c_str());
 	}

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstalledPage.h

@@ -3,7 +3,6 @@
 #include "CClasses.h"
 #include "duilib.h"
 #include "resource.h"
-#include "AppCore.h"
 #include "DefineUI.h"
 
 //°²×°Íê³É½çÃæ

+ 0 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/InstallingPage.h

@@ -1,11 +1,8 @@
 #pragma once
 #include "CLanguage.h"
-//#include "CConstString.h"
 #include "CClasses.h"
-//#include "CAccessRegedit.h"
 #include "duilib.h"
 #include "resource.h"
-#include "AppCore.h"
 #include "DefineUI.h"
 
 //°²×°ÖнçÃæ

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/KeyVar.h

@@ -13,7 +13,7 @@ public:
 	static const wstring smName_Application;//产品可运行的应用程序名称
 	
 	static const unsigned int unFreeDiskMinSize;//安装的磁盘可用空间要求至少的大小,单位为兆(M)
-	static const int InstallPathMaxLength;//最长度限制安装路径
+	static const int InstallPathMaxLength;//最长度限制安装路径
 };
 
 #pragma region Banner信息

+ 67 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Logini.cpp

@@ -0,0 +1,67 @@
+#include "Logini.h"
+
+
+void LogIni::GetLogToIni(string contentType, wstring cmdContent)
+{
+	//文件:存放在文档里
+	wstring wPath = FolderCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + Product::smName_Application + L"Log.ini";
+	wchar_t* ptrPath = _wcsdup(wPath.c_str());
+	std::string sPath = CharConvert::GetMultiByteW(ptrPath);
+
+	time_t t;
+	tm tmp;
+	time(&t);
+	localtime_s(&tmp, &t);
+	string  strTime = to_string(tmp.tm_year + 1900) + "/" + to_string(tmp.tm_mon + 1) + "/" + to_string(tmp.tm_mday) + "--" + to_string(tmp.tm_hour) + ":" + to_string(tmp.tm_min) + ":" + to_string(tmp.tm_sec);
+	char* chTime = (LPSTR)(LPCTSTR)strTime.c_str();
+	CharConvert::GetWideCharW(chTime);
+
+	wstring cmdStr = cmdContent;
+	wchar_t* cmdptr = _wcsdup(cmdStr.c_str());
+	char* cmdCh = CharConvert::GetMultiByteW(cmdptr);
+
+	char* chcontentType = (LPSTR)(LPCTSTR)contentType.c_str();
+
+	DWORD pidIni = WritePrivateProfileStringA(chTime, chcontentType, cmdCh, sPath.c_str());
+}
+
+void LogIni::GetLogToIniMaps(std::map<wstring, wstring> maps)
+{
+
+	//路径
+	wstring wPath = FolderCore::SetSHGetFolderPath(CSIDL_PERSONAL) + L"\\" + Product::smName_Application + L"Log.ini";
+	//当前系统时间
+	time_t t;
+	tm tmp;
+	time(&t);
+	localtime_s(&tmp, &t);
+	wstring  strTime = to_wstring(tmp.tm_year + 1900) + L"/" + to_wstring(tmp.tm_mon + 1) + L"/" + to_wstring(tmp.tm_mday) + L"--" + to_wstring(tmp.tm_hour) + L":" + to_wstring(tmp.tm_min) + L":" + to_wstring(tmp.tm_sec);
+	maps.insert(pair<wstring,wstring>(L"-----", L"----"));
+
+	std::map<wstring, wstring>::iterator iterRead;
+	for (iterRead = maps.begin(); iterRead != maps.end(); iterRead++)
+	{
+		wstring cmdStr = iterRead->second;
+		wchar_t* cmdptr = _wcsdup(cmdStr.c_str());
+
+		DWORD pidIni = WritePrivateProfileString(strTime.c_str(), iterRead->first.data(), cmdptr, wPath.c_str());
+	}
+
+}
+
+#pragma region ini读写操作
+
+DWORD LogIni::WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
+{
+	char _Buf[64];
+	_CSTD sprintf_s(_Buf, sizeof(_Buf), "%u", nDefault);
+	return WritePrivateProfileStringA(lpAppNam, lpKeyName, _Buf, lpFileName);
+}
+
+DWORD LogIni::ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName)
+{
+	return  GetPrivateProfileIntA(lpAppNam, lpKeyName, nDefault, lpFileName);
+}
+
+#pragma endregion
+

+ 19 - 0
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/Logini.h

@@ -0,0 +1,19 @@
+#pragma once
+#include "windows.h"
+#include "stdafx.h"
+#include "FileCore.h"
+#include "CharConvert.h"
+#include "KeyVar.h"
+#include <time.h>
+class LogIni
+{
+public:
+	//写入ini内容
+	static DWORD WriteIntToini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);
+	//读取ini内容
+	static DWORD ReadIntFromini(LPCSTR lpAppNam, LPCSTR lpKeyName, INT nDefault, LPCSTR lpFileName);
+	//写入Ini文件里
+	static void GetLogToIni(string contentType, wstring cmdContent);
+	static void GetLogToIniMaps(std::map<wstring, wstring> maps);
+};
+

+ 2 - 2
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/MessageBoxWnd.cpp

@@ -67,10 +67,10 @@ int MessageBoxWnd::Show(HWND m_hWnd, MessageContentType Content, wstring paramet
 	switch (Content)
 	{
 	case MessageContentType::InstallingFailed:
-		result = CMsgWnd::MessageBox(
+		/*result = CMsgWnd::MessageBox(
 			m_hWnd, _T(""), parameter.c_str(),
 			L"´ò¿ª°²×°Â·¾¶"
-		);
+		);*/
 		break;
 	default:
 		break;

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineProduct.cpp

@@ -14,7 +14,7 @@ OnlineProduct::~OnlineProduct()
 const char* OnlineProduct::GetInstallPageVersion(wstring productUrl)
 {
 	//ÏÂÔØxmlÎļþ
-	wstring SaveFolder = AppCore::GetOrCreateFolderPath(PathCore::smPath_Temp) + L"\\" + L"test.xml";
+	wstring SaveFolder = FolderCore::GetOrCreateFolderPath(PathCore::smPath_Temp) + L"\\" + L"test.xml";
 	HRESULT Hfile = URLDownloadToFile(NULL, productUrl.c_str(), SaveFolder.c_str(), 0, NULL);
 
 	char* pStr = CharConvert::GetMultiByteW(SaveFolder.c_str());

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/OnlineProduct.h

@@ -1,8 +1,8 @@
 #pragma once
-#include "AppCore.h"
 #include "tinyxml/tinyxml.h"
 #include "KeyVar.h"
 #include "CharConvert.h"
+#include "FileCore.h"
 class OnlineProduct
 {
 private:

+ 3 - 6
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj

@@ -160,7 +160,6 @@
     <ClInclude Include="CAccessRegedit.h" />
     <ClInclude Include="CClasses.h" />
     <ClInclude Include="CCmd.h" />
-    <ClInclude Include="AppCore.h" />
     <ClInclude Include="CDownLoadFile.h" />
     <ClInclude Include="CFrameWnd.h" />
     <ClInclude Include="CharConvert.h" />
@@ -179,19 +178,18 @@
     <ClInclude Include="InstalledPage.h" />
     <ClInclude Include="InstallingPage.h" />
     <ClInclude Include="KeyVar.h" />
+    <ClInclude Include="Logini.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="Documentation.h" />
     <ClInclude Include="OnlineProduct.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="CAccessRegedit.cpp" />
     <ClCompile Include="CClasses.cpp" />
     <ClCompile Include="CCmd.cpp" />
-    <ClCompile Include="AppCore.cpp" />
     <ClCompile Include="CDownLoadFile.cpp" />
     <ClCompile Include="CFrameWnd.cpp" />
     <ClCompile Include="CFrameWndInit.cpp" />
@@ -206,6 +204,7 @@
     <ClCompile Include="FileCore.cpp" />
     <ClCompile Include="InstallPage.cpp" />
     <ClCompile Include="KeyVar.cpp" />
+    <ClCompile Include="Logini.cpp" />
     <ClCompile Include="MessageBoxWnd.cpp" />
     <ClCompile Include="tinyxml\tinystr.cpp" />
     <ClCompile Include="tinyxml\tinyxml.cpp" />
@@ -217,9 +216,7 @@
     <ClCompile Include="WndInstall.cpp" />
     <ClCompile Include="WndInstalling.cpp" />
     <ClCompile Include="InstallingPage.cpp" />
-    <ClCompile Include="main.cpp">
-      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/utf-8 %(AdditionalOptions)</AdditionalOptions>
-    </ClCompile>
+    <ClCompile Include="main.cpp" />
     <ClCompile Include="src\lib_json\json_reader.cpp" />
     <ClCompile Include="src\lib_json\json_value.cpp" />
     <ClCompile Include="src\lib_json\json_writer.cpp" />

+ 50 - 15
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.bak

@@ -31,12 +31,13 @@
     <UseDebugLibraries>true</UseDebugLibraries>
     <PlatformToolset>v143</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
+    <VCToolsVersion>14.31.31103</VCToolsVersion>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <PlatformToolset>v143</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -72,15 +73,15 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\DuiLib;$(IncludePath)</IncludePath>
-    <LibraryPath>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\Lib;$(LibraryPath)</LibraryPath>
+    <IncludePath>DuiLib;$(IncludePath)</IncludePath>
+    <LibraryPath>Lib;$(LibraryPath)</LibraryPath>
     <OutDir>$(SolutionDir)bin\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <OutDir>$(SolutionDir)bin\</OutDir>
-    <IncludePath>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\DuiLib;$(IncludePath)</IncludePath>
-    <LibraryPath>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\Lib;$(LibraryPath)</LibraryPath>
+    <IncludePath>$(SolutionDir)PDFReaderPro_Insrtaller\DuiLib;$(IncludePath)</IncludePath>
+    <LibraryPath>$(SolutionDir)Lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
@@ -98,7 +99,7 @@
       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <AdditionalIncludeDirectories>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\include;C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\include\json;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>include;include\json;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -114,7 +115,8 @@
       <SDLCheck>true</SDLCheck>
       <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ConformanceMode>true</ConformanceMode>
-      <AdditionalIncludeDirectories>C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\include;C:\Users\kdan\source\repos\PDFReaderPro_Insrtaller\PDFReaderPro_Insrtaller\include\json;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)PDFReaderPro_Insrtaller\include;$(SolutionDir)PDFReaderPro_Insrtaller\include\json;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -158,38 +160,71 @@
     <ClInclude Include="CAccessRegedit.h" />
     <ClInclude Include="CClasses.h" />
     <ClInclude Include="CCmd.h" />
-    <ClInclude Include="CConstString.h" />
+    <ClInclude Include="AppCore.h" />
     <ClInclude Include="CDownLoadFile.h" />
     <ClInclude Include="CFrameWnd.h" />
+    <ClInclude Include="CharConvert.h" />
     <ClInclude Include="CLanguage.h" />
+    <ClInclude Include="CMainPage.h" />
     <ClInclude Include="CMsgWnd.h" />
+    <ClInclude Include="ComparVersion.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="InstallationPage.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="Documentation.h" />
+    <ClInclude Include="OnlineProduct.h" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="CAccessRegedit.cpp" />
     <ClCompile Include="CClasses.cpp" />
     <ClCompile Include="CCmd.cpp" />
-    <ClCompile Include="CConstString.cpp" />
+    <ClCompile Include="AppCore.cpp" />
     <ClCompile Include="CDownLoadFile.cpp" />
-    <ClCompile Include="CFrameOftenDoIt.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="ComparVersion.cpp" />
     <ClCompile Include="CSystemInfo.cpp" />
     <ClCompile Include="CAdsBanner.cpp" />
-    <ClCompile Include="Installed.cpp" />
-    <ClCompile Include="InstallHome.cpp" />
-    <ClCompile Include="Installing.cpp" />
-    <ClCompile Include="main.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" />
+    <ClCompile Include="tinyxml\tinyxmlparser.cpp" />
+    <ClCompile Include="WndBanner.cpp" />
+    <ClCompile Include="WndInstalled.cpp" />
+    <ClCompile Include="InstalledPage.cpp" />
+    <ClCompile Include="WndInstall.cpp" />
+    <ClCompile Include="WndInstalling.cpp" />
+    <ClCompile Include="InstallingPage.cpp" />
+    <ClCompile Include="main.cpp">
+      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/utf-8 %(AdditionalOptions)</AdditionalOptions>
+    </ClCompile>
     <ClCompile Include="src\lib_json\json_reader.cpp" />
     <ClCompile Include="src\lib_json\json_value.cpp" />
     <ClCompile Include="src\lib_json\json_writer.cpp" />
     <ClCompile Include="stdafx.cpp" />
+    <ClCompile Include="OnlineProduct.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="PDFReaderPro_Insrtaller.rc" />

+ 125 - 152
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/PDFReaderPro_Insrtaller.vcxproj.filters

@@ -13,30 +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="头文件\Layout">
-      <UniqueIdentifier>{b09c09a8-053d-4fe1-8a30-785730354ab9}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="源文件\Layout">
-      <UniqueIdentifier>{98c5694d-770f-4cae-b18d-85db9c736581}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="源文件\strings">
-      <UniqueIdentifier>{8892cc10-d0c4-405a-86aa-04767dc3f206}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="头文件\strings">
-      <UniqueIdentifier>{8717e26d-dab7-4343-aef7-843926af5d9f}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="源文件\Layout\UI">
-      <UniqueIdentifier>{19eee284-558a-49b2-baa3-c42c78b5aeb7}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="源文件\Layout\UX">
-      <UniqueIdentifier>{0918cb3e-4f5d-4544-b90d-c354da3b04d3}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="头文件\Layout\UI">
-      <UniqueIdentifier>{7315e727-5117-45bf-9d61-c6e3ab76a9d8}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="头文件\Layout\UX">
-      <UniqueIdentifier>{1ab2e973-0935-440f-a383-1707d3448fb7}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Library">
       <UniqueIdentifier>{c7d5a308-6146-4c17-923e-03fbd3fb4d67}</UniqueIdentifier>
     </Filter>
@@ -46,53 +22,35 @@
     <Filter Include="Library\json">
       <UniqueIdentifier>{7dc9b2f1-a10d-44ab-96ad-34efcd6651f2}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Library\LibraryOrSystem">
-      <UniqueIdentifier>{a1465ee9-d6bb-4e0d-be23-5beb1d874f06}</UniqueIdentifier>
+    <Filter Include="Product">
+      <UniqueIdentifier>{e6b21246-65d1-4760-87eb-6c947f35c6af}</UniqueIdentifier>
     </Filter>
-    <Filter Include="头文件\CoreApp">
-      <UniqueIdentifier>{8f29bf79-1df7-4661-bba7-82332dea0322}</UniqueIdentifier>
+    <Filter Include="Language">
+      <UniqueIdentifier>{319c101e-987a-4943-b8bd-d63bd02bb5c4}</UniqueIdentifier>
     </Filter>
-    <Filter Include="源文件\CoreApp">
-      <UniqueIdentifier>{e497291e-503b-459a-b14d-5c38a57474ed}</UniqueIdentifier>
+    <Filter Include="AppCore">
+      <UniqueIdentifier>{8455af82-f0d3-4dfa-8d85-32c220b14df0}</UniqueIdentifier>
     </Filter>
-    <Filter Include="源文件\Core">
-      <UniqueIdentifier>{27b54a45-d809-4540-bb6d-3cda7c262027}</UniqueIdentifier>
+    <Filter Include="doString">
+      <UniqueIdentifier>{da1753f8-fb1f-4d1c-a481-02d32b162c5b}</UniqueIdentifier>
     </Filter>
-    <Filter Include="头文件\Core">
-      <UniqueIdentifier>{2c1621fb-6b68-4bea-a305-ab3817baa02a}</UniqueIdentifier>
+    <Filter Include="Layout">
+      <UniqueIdentifier>{b09c09a8-053d-4fe1-8a30-785730354ab9}</UniqueIdentifier>
     </Filter>
-    <Filter Include="头文件\Core\Product">
-      <UniqueIdentifier>{027a50e4-aaab-42f0-bc7b-6cb08909667e}</UniqueIdentifier>
+    <Filter Include="Layout\UI">
+      <UniqueIdentifier>{7315e727-5117-45bf-9d61-c6e3ab76a9d8}</UniqueIdentifier>
     </Filter>
-    <Filter Include="源文件\Core\Product">
-      <UniqueIdentifier>{e94d04c5-58e5-4427-ad97-88bb27919ee5}</UniqueIdentifier>
+    <Filter Include="Layout\UX">
+      <UniqueIdentifier>{1ab2e973-0935-440f-a383-1707d3448fb7}</UniqueIdentifier>
     </Filter>
-    <Filter Include="头文件\Core\Log">
-      <UniqueIdentifier>{a5b5c087-560f-40ab-93f7-30e1a5c19132}</UniqueIdentifier>
+    <Filter Include="Library\Librarys">
+      <UniqueIdentifier>{a1465ee9-d6bb-4e0d-be23-5beb1d874f06}</UniqueIdentifier>
     </Filter>
-    <Filter Include="源文件\Core\Log">
-      <UniqueIdentifier>{20abcaa6-ab7b-4a21-8656-74f2046aba5d}</UniqueIdentifier>
+    <Filter Include="ExeLog">
+      <UniqueIdentifier>{952e848d-ac17-4bdc-b978-f61358d727ec}</UniqueIdentifier>
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="CAccessRegedit.h">
-      <Filter>头文件\Core</Filter>
-    </ClInclude>
-    <ClInclude Include="CCmd.h">
-      <Filter>头文件\Core</Filter>
-    </ClInclude>
-    <ClInclude Include="AppCore.h">
-      <Filter>头文件\strings</Filter>
-    </ClInclude>
-    <ClInclude Include="CClasses.h">
-      <Filter>头文件\strings</Filter>
-    </ClInclude>
-    <ClInclude Include="CLanguage.h">
-      <Filter>头文件\strings</Filter>
-    </ClInclude>
-    <ClInclude Include="DefineStr.h">
-      <Filter>头文件\strings</Filter>
-    </ClInclude>
     <ClInclude Include="tinyxml\tinystr.h">
       <Filter>Library\tinyxml</Filter>
     </ClInclude>
@@ -100,85 +58,85 @@
       <Filter>Library\tinyxml</Filter>
     </ClInclude>
     <ClInclude Include="stdafx.h">
-      <Filter>Library\LibraryOrSystem</Filter>
+      <Filter>Library\Librarys</Filter>
     </ClInclude>
     <ClInclude Include="resource.h">
-      <Filter>Library\LibraryOrSystem</Filter>
+      <Filter>Library\Librarys</Filter>
     </ClInclude>
     <ClInclude Include="duilib.h">
-      <Filter>Library\LibraryOrSystem</Filter>
+      <Filter>Library\Librarys</Filter>
     </ClInclude>
     <ClInclude Include="InstalledPage.h">
-      <Filter>头文件\Layout\UI</Filter>
+      <Filter>Layout\UI</Filter>
     </ClInclude>
     <ClInclude Include="InstallingPage.h">
-      <Filter>头文件\Layout\UI</Filter>
+      <Filter>Layout\UI</Filter>
     </ClInclude>
     <ClInclude Include="InstallPage.h">
-      <Filter>头文件\Layout\UI</Filter>
+      <Filter>Layout\UI</Filter>
     </ClInclude>
     <ClInclude Include="CFrameWnd.h">
-      <Filter>头文件\Layout\UX</Filter>
+      <Filter>Layout\UX</Filter>
     </ClInclude>
     <ClInclude Include="CMsgWnd.h">
-      <Filter>头文件\Layout\UX</Filter>
+      <Filter>Layout\UX</Filter>
     </ClInclude>
-    <ClInclude Include="FileCore.h">
-      <Filter>头文件\CoreApp</Filter>
-    </ClInclude>
-    <ClInclude Include="CharConvert.h">
-      <Filter>头文件\CoreApp</Filter>
+    <ClInclude Include="DefineUI.h">
+      <Filter>Layout\UI</Filter>
     </ClInclude>
-    <ClInclude Include="KeyVar.h">
-      <Filter>头文件\CoreApp</Filter>
+    <ClInclude Include="CAdsBanner.h">
+      <Filter>Product</Filter>
     </ClInclude>
-    <ClInclude Include="DefineUI.h">
-      <Filter>头文件\Layout\UI</Filter>
+    <ClInclude Include="CDownLoadFile.h">
+      <Filter>Product</Filter>
     </ClInclude>
-    <ClInclude Include="Documentation.h">
-      <Filter>头文件\strings</Filter>
+    <ClInclude Include="ComparVersion.h">
+      <Filter>Product</Filter>
     </ClInclude>
     <ClInclude Include="DeviceProduct.h">
-      <Filter>头文件\Core\Product</Filter>
+      <Filter>Product</Filter>
     </ClInclude>
     <ClInclude Include="OnlineProduct.h">
-      <Filter>头文件\Core\Product</Filter>
+      <Filter>Product</Filter>
     </ClInclude>
-    <ClInclude Include="CDownLoadFile.h">
-      <Filter>头文件\Core\Product</Filter>
+    <ClInclude Include="CLanguage.h">
+      <Filter>Language</Filter>
     </ClInclude>
-    <ClInclude Include="CAdsBanner.h">
-      <Filter>头文件\Core\Product</Filter>
+    <ClInclude Include="KeyVar.h">
+      <Filter>AppCore</Filter>
+    </ClInclude>
+    <ClInclude Include="CharConvert.h">
+      <Filter>doString</Filter>
+    </ClInclude>
+    <ClInclude Include="FileCore.h">
+      <Filter>doString</Filter>
     </ClInclude>
     <ClInclude Include="CSystemInfo.h">
-      <Filter>头文件\Core\Log</Filter>
+      <Filter>ExeLog</Filter>
     </ClInclude>
-    <ClInclude Include="CMainPage.h">
-      <Filter>头文件</Filter>
+    <ClInclude Include="CCmd.h">
+      <Filter>AppCore</Filter>
     </ClInclude>
-    <ClInclude Include="ComparVersion.h">
-      <Filter>头文件\Core\Product</Filter>
+    <ClInclude Include="CClasses.h">
+      <Filter>doString</Filter>
+    </ClInclude>
+    <ClInclude Include="DefineStr.h">
+      <Filter>doString</Filter>
     </ClInclude>
     <ClInclude Include="MessageBoxWnd.h">
-      <Filter>头文件\strings</Filter>
+      <Filter>doString</Filter>
+    </ClInclude>
+    <ClInclude Include="CMainPage.h">
+      <Filter>Layout\UX</Filter>
+    </ClInclude>
+    <ClInclude Include="CAccessRegedit.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="Logini.h">
+      <Filter>ExeLog</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="CAccessRegedit.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
-    <ClCompile Include="CCmd.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
-    <ClCompile Include="CLanguage.cpp">
-      <Filter>源文件\strings</Filter>
-    </ClCompile>
-    <ClCompile Include="CClasses.cpp">
-      <Filter>源文件\strings</Filter>
-    </ClCompile>
-    <ClCompile Include="AppCore.cpp">
-      <Filter>源文件\strings</Filter>
-    </ClCompile>
     <ClCompile Include="src\lib_json\json_reader.cpp">
       <Filter>Library\json</Filter>
     </ClCompile>
@@ -188,9 +146,6 @@
     <ClCompile Include="src\lib_json\json_writer.cpp">
       <Filter>Library\json</Filter>
     </ClCompile>
-    <ClCompile Include="main.cpp">
-      <Filter>源文件\Core</Filter>
-    </ClCompile>
     <ClCompile Include="tinyxml\tinystr.cpp">
       <Filter>Library\tinyxml</Filter>
     </ClCompile>
@@ -203,71 +158,89 @@
     <ClCompile Include="tinyxml\tinyxmlparser.cpp">
       <Filter>Library\tinyxml</Filter>
     </ClCompile>
-    <ClCompile Include="InstalledPage.cpp">
-      <Filter>源文件\Layout\UI</Filter>
-    </ClCompile>
-    <ClCompile Include="InstallingPage.cpp">
-      <Filter>源文件\Layout\UI</Filter>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>Library\Librarys</Filter>
     </ClCompile>
-    <ClCompile Include="InstallPage.cpp">
-      <Filter>源文件\Layout\UI</Filter>
+    <ClCompile Include="CAdsBanner.cpp">
+      <Filter>Product</Filter>
     </ClCompile>
-    <ClCompile Include="CFrameWnd.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="CDownLoadFile.cpp">
+      <Filter>Product</Filter>
     </ClCompile>
-    <ClCompile Include="CMsgWnd.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="ComparVersion.cpp">
+      <Filter>Product</Filter>
     </ClCompile>
-    <ClCompile Include="WndBanner.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="DeviceProduct.cpp">
+      <Filter>Product</Filter>
     </ClCompile>
-    <ClCompile Include="WndInstall.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="OnlineProduct.cpp">
+      <Filter>Product</Filter>
     </ClCompile>
-    <ClCompile Include="WndInstalled.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="CLanguage.cpp">
+      <Filter>Language</Filter>
     </ClCompile>
-    <ClCompile Include="WndInstalling.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+    <ClCompile Include="KeyVar.cpp">
+      <Filter>AppCore</Filter>
     </ClCompile>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Library\LibraryOrSystem</Filter>
+    <ClCompile Include="CharConvert.cpp">
+      <Filter>doString</Filter>
     </ClCompile>
     <ClCompile Include="FileCore.cpp">
-      <Filter>源文件\CoreApp</Filter>
-    </ClCompile>
-    <ClCompile Include="CharConvert.cpp">
-      <Filter>源文件\CoreApp</Filter>
+      <Filter>doString</Filter>
     </ClCompile>
-    <ClCompile Include="KeyVar.cpp">
-      <Filter>源文件\CoreApp</Filter>
+    <ClCompile Include="CSystemInfo.cpp">
+      <Filter>ExeLog</Filter>
     </ClCompile>
-    <ClCompile Include="DeviceProduct.cpp">
-      <Filter>源文件\Core\Product</Filter>
+    <ClCompile Include="CCmd.cpp">
+      <Filter>AppCore</Filter>
     </ClCompile>
-    <ClCompile Include="CDownLoadFile.cpp">
-      <Filter>源文件\Core\Product</Filter>
+    <ClCompile Include="main.cpp">
+      <Filter>AppCore</Filter>
     </ClCompile>
-    <ClCompile Include="CAdsBanner.cpp">
-      <Filter>源文件\Core\Product</Filter>
+    <ClCompile Include="CClasses.cpp">
+      <Filter>doString</Filter>
     </ClCompile>
-    <ClCompile Include="CSystemInfo.cpp">
-      <Filter>源文件\Core\Log</Filter>
+    <ClCompile Include="MessageBoxWnd.cpp">
+      <Filter>doString</Filter>
     </ClCompile>
     <ClCompile Include="CMainPage.cpp">
-      <Filter>源文件</Filter>
+      <Filter>Layout\UX</Filter>
+    </ClCompile>
+    <ClCompile Include="CFrameWnd.cpp">
+      <Filter>Layout\UX</Filter>
     </ClCompile>
     <ClCompile Include="CFrameWndInit.cpp">
-      <Filter>源文件\Layout\UX</Filter>
+      <Filter>Layout\UX</Filter>
     </ClCompile>
-    <ClCompile Include="OnlineProduct.cpp">
-      <Filter>源文件\Core\Product</Filter>
+    <ClCompile Include="CMsgWnd.cpp">
+      <Filter>Layout\UX</Filter>
     </ClCompile>
-    <ClCompile Include="ComparVersion.cpp">
-      <Filter>源文件\Core\Product</Filter>
+    <ClCompile Include="WndBanner.cpp">
+      <Filter>Layout\UX</Filter>
     </ClCompile>
-    <ClCompile Include="MessageBoxWnd.cpp">
-      <Filter>源文件\strings</Filter>
+    <ClCompile Include="WndInstall.cpp">
+      <Filter>Layout\UX</Filter>
+    </ClCompile>
+    <ClCompile Include="WndInstalled.cpp">
+      <Filter>Layout\UX</Filter>
+    </ClCompile>
+    <ClCompile Include="WndInstalling.cpp">
+      <Filter>Layout\UX</Filter>
+    </ClCompile>
+    <ClCompile Include="InstallPage.cpp">
+      <Filter>Layout\UI</Filter>
+    </ClCompile>
+    <ClCompile Include="InstallingPage.cpp">
+      <Filter>Layout\UI</Filter>
+    </ClCompile>
+    <ClCompile Include="InstalledPage.cpp">
+      <Filter>Layout\UI</Filter>
+    </ClCompile>
+    <ClCompile Include="CAccessRegedit.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="Logini.cpp">
+      <Filter>ExeLog</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>

+ 5 - 4
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndBanner.cpp

@@ -8,7 +8,7 @@ void CFrameWnd::Thread_LoadedBanner(ThreadData threadData)
 
 void CFrameWnd::GetBanner()
 {
-	std::wstring tempPath = AppCore::GetAppTempPath();
+	std::wstring tempPath = FolderCore::GetAppTempPath();
 	banner->GetBannerlinkFromJson(tempPath);
 
 	auto imgFilePath = tempPath + L"/" + std::to_wstring(0) + L".png";
@@ -19,7 +19,7 @@ void CFrameWnd::GetBanner()
 		if (i <= BannerCore::ShowBannerCount)
 		{
 			char* ch = (LPSTR)(LPCTSTR)banner->BannerCollection[i].c_str();
-			std::wstring wch = AppCore::GetMultiByteToWideChar(ch);
+			std::wstring wch = CharConvert::GetWideCharW(ch);
 			imgFilePath = tempPath + L"/" + to_wstring(i) + L".png";
 
 			banner->GetImage(wch, imgFilePath, i);
@@ -88,9 +88,10 @@ void CFrameWnd::SetTimerBanner()
 	if (m_bOnline)
 	{
 		KillAllTimer();
-
+		StartTimer(TIMER_BANNER_ID);
+		StartTimer(TIMER_INSTALL_ID);
 		CFrameWnd::m_SilenceInstallingType = SilenceInstallingType::DownLoading;
-		m_InstallingPage->NetWorkUI(false);
+		m_InstallingPage->NetWorkUI(m_bOnline);
 
 		if (banner->BannerCollection.size() == 0)
 			GetBanner();

+ 4 - 8
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalled.cpp

@@ -34,17 +34,13 @@ LRESULT CFrameWnd::InstalledMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOO
 {
 	thread first(Thread_OpenApp, m_threadData);
 	first.detach();
-	::DestroyWindow(m_hWnd);
+
 }
 
 void CFrameWnd::Thread_OpenApp( ThreadData threadData)
 {
 	CCmd cmd;
-
-	if (cmd.OpenAppcmd())
-	{
-		DeleteFile(PathCore::smPath_Install.c_str());
-	}
-	
-
+	wstring s = /*L"start " + */PathCore::smPath_Install + L"\\" + Product::smName_Application;
+	auto histance = ShellExecute(NULL, L"open", s.c_str(), NULL, NULL, SW_SHOWNORMAL);
+	::DestroyWindow(threadData.pFrame->m_hWnd);
 }

+ 7 - 3
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/WndInstalling.cpp

@@ -62,9 +62,9 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 		threadData.pFrame->SetBannerOnTimer();
 		return;
 	}
-		
-
+	
 	CCmd cmd;
+
 	if (threadData.pFrame->m_State.m_NetFrameworkType == InstallNetFrameworkType::V40_46)
 	{
 		cmd.InstallNetcmd();
@@ -92,6 +92,10 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 				FileCore::SourceFileMoveToDestionPath(installPackgeAbePath, PathCore::smPath_DefaultInstall);
 				if (cmd.Installcmd() == false)
 				{
+					if (FileCore::IsExistProductAppPath() == false)
+					{
+						cmd.GetVBAContent();
+					}
 					DownloadProgress::Currentpercentage = 0;
 					threadData.pFrame->KillAllTimer();
 				}
@@ -103,7 +107,7 @@ void CFrameWnd::Thread_Installing(ThreadData threadData)
 		{
 			MessageBoxWnd::Show(threadData.pFrame->m_hWnd, MessageContentType::InstallingFailed);
 			wstring folderPath = L"start " + PathCore::smPath_Install;
-			char* ch = AppCore::GetWstringToCharPtr(folderPath);
+			char* ch = CharConvert::GetWstringToCharPtr(folderPath);
 			system(ch);
 		}
 

+ 1 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/main.cpp

@@ -38,7 +38,7 @@ bool LoadedResources(HINSTANCE hInstance)
 int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)
 {
 
-	AppCore::InitAppTempPath();
+	FolderCore::InitAppTempPath();
 
 	// ³õʼ»¯UI¹ÜÀíÆ÷
 	if (LoadedResources(hInstance) == false)

+ 0 - 1
PDFReaderPro_Installer/PDFReaderPro_Insrtaller/stdafx.h

@@ -16,6 +16,5 @@
 #include <malloc.h>
 #include <memory.h>
 #include <tchar.h>
-#include "AppCore.h"
 #include "CLanguage.h"
 // TODO: 在此处引用程序需要的其他头文件