#pragma once
#include "CClasses.h"
#include <string>



#define _CRT_SECURE_NO_DEPRECATE

#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>
#include "CharConvert.h"
#include "KeyVar.h"
using namespace std;
class DeviceProduct
{
public:
	DeviceProduct(wstring ProductName);
	~DeviceProduct();

private:
	DeviceProduct();
private:
	wstring m_Version;
	wstring m_ProductName;
	wstring m_InstallLocation;

	wstring m_NETVersion;
	wstring m_NETTargetVersion;

	wstring m_VsCPulsPulsVersion;
	wstring m_VsCPulsPulsInstalled;
public:
	//产品版本号
	wstring GetVersion();
	//产品安装路径
	wstring GetInstallLocation();
	wstring GetNETVersion();
	wstring GetNETTargetVersion();
	wstring GetVsCPulsPulsVersion();
	wstring GetVsCPulsPulsInstalled();
private:
	//访问LocalMachine主键
	bool OpenLocalMachineRootKey(LPCTSTR productsInfoPath);

	//搜索所有产品
	bool SearchAllProducts(HKEY hKey, LPCTSTR productsInfoPath);
	//产找产品信息
	bool FindProductInfo(HKEY hKey, LPCTSTR lpSubKey);
	//访问LocalMachine下指定的路径
	bool OpenLocalMachineSubKey(wstring AppKey);

	bool FindNETFramework();

	bool FindVsCPulsPulsRedistributable();

};
