1
0
Fork 0
mirror of https://github.com/eliboa/TegraRcmGUI.git synced 2024-11-28 13:12:05 +00:00

Fixed driver install prompt at every startup

This commit is contained in:
eliboa 2018-05-18 22:30:14 +02:00
parent ecb7c2b50f
commit eb672a9abf
2 changed files with 19 additions and 15 deletions

View file

@ -226,14 +226,9 @@ void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
this->GetDlgItem(IDC_SHOFEL2)->EnableWindow(FALSE);
s = "lbusbK driver is needed !";
/*
if (!ASK_FOR_DRIVER)
{
ASK_FOR_DRIVER = TRUE;
InstallDriver();
}
*/
if (!ASK_FOR_DRIVER) InstallDriver();
}
else
{
@ -539,13 +534,21 @@ void CTegraRcmGUIDlg::InstallDriver()
CloseHandle(shExInfo.hProcess);
}
}
ASK_FOR_DRIVER = TRUE;
}
typedef int(__cdecl *MYPROC)(LPWSTR);
BOOL CTegraRcmGUIDlg::LookForDriver()
{
CString LIBUSBKDLL = _T("C:\\Windows\\System32\\libusbK.dll");
std::ifstream infile(LIBUSBKDLL);
BOOL file_exists = infile.good();
return file_exists;
TCHAR system_dir[MAX_PATH];
HRESULT result = SHGetFolderPath(NULL, CSIDL_SYSTEM, NULL, SHGFP_TYPE_CURRENT, system_dir);
if (result != S_OK) return FALSE;
PathAppend(system_dir, _T("\\libusbK.dll"));
std::ifstream infile32(system_dir);
BOOL file_exists32 = infile32.good();
if (!file_exists32) return FALSE;
}

View file

@ -19,6 +19,7 @@
#include <array>
// CTegraRcmGUIDlg dialog
class CTegraRcmGUIDlg : public CDialog
{