- #include <iostream>
- #include <stdlib.h>
- #include <windows.h>
- using namespace std;
- int WINAPI WinMain (HINSTANCE hThisInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpszArgument,
- int nFunsterStil)
- {
- HKEY hKey;
- LPCTSTR subkey="SOFTWARE\\\\Microsoft\\\\.NETFramework\\\\v2.0.50727";
- //打开注册表键,查看系统是否安装了.net Frameworkv2.0
- LONG lResult=RegOpenKeyEx(HKEY_LOCAL_MACHINE,subkey,0,KEY_READ,&hKey);
- RegCloseKey(hKey);
- if(lResult != ERROR_SUCCESS)
- {
- //MessageBox(NULL,"由于是用飞信的.net虚拟机加载启动的\\n所以启动会有点慢,请稍候几秒钟\\n\\n请\\"确认\\"后继续","Hello",MB_OK);
- WinExec("FetionVM.exe DNFsweet.exe", SW_SHOW);
- }
- else
- {
- WinExec("Run.exe",SW_SHOW);
- }
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/23112012617.html
来源: http://www.codesnippet.cn/detail/23112012617.html