DeviceProduct.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include "CClasses.h"
  3. #include <string>
  4. #define _CRT_SECURE_NO_DEPRECATE
  5. #include <fstream>
  6. #include <urlmon.h>
  7. #pragma comment(lib, "urlmon.lib")
  8. #include <Shlwapi.h>
  9. #pragma comment(lib,"shlwapi.lib")
  10. #include <atlconv.h>
  11. #include <WinInet.h>
  12. #pragma comment(lib,"wininet.lib")
  13. #define MAXBLOCKSIZE 1024
  14. #include <shlobj.h>
  15. #include <atlstr.h>
  16. #include <json/reader.h>
  17. #include "KeyVar.h"
  18. #include <Windows.h>
  19. #include "CDownLoadFile.h"
  20. #include<profinfo.h>
  21. #include "CharConvert.h"
  22. #include "KeyVar.h"
  23. using namespace std;
  24. class DeviceProduct
  25. {
  26. public:
  27. DeviceProduct(wstring ProductName);
  28. ~DeviceProduct();
  29. private:
  30. DeviceProduct();
  31. private:
  32. wstring m_Version;
  33. wstring m_ProductName;
  34. wstring m_InstallLocation;
  35. wstring m_NETVersion;
  36. wstring m_NETTargetVersion;
  37. wstring m_VsCPulsPulsVersion;
  38. wstring m_VsCPulsPulsInstalled;
  39. public:
  40. //产品版本号
  41. wstring GetVersion();
  42. //产品安装路径
  43. wstring GetInstallLocation();
  44. wstring GetNETVersion();
  45. wstring GetNETTargetVersion();
  46. wstring GetVsCPulsPulsVersion();
  47. wstring GetVsCPulsPulsInstalled();
  48. private:
  49. //访问LocalMachine主键
  50. bool OpenLocalMachineRootKey(LPCTSTR productsInfoPath);
  51. //搜索所有产品
  52. bool SearchAllProducts(HKEY hKey, LPCTSTR productsInfoPath);
  53. //产找产品信息
  54. bool FindProductInfo(HKEY hKey, LPCTSTR lpSubKey);
  55. //访问LocalMachine下指定的路径
  56. bool OpenLocalMachineSubKey(wstring AppKey);
  57. bool FindNETFramework();
  58. bool FindVsCPulsPulsRedistributable();
  59. };