1
0
Fork 0
mirror of https://github.com/eliboa/TegraRcmGUI.git synced 2024-12-28 19:16:02 +00:00

Fixed libusbK.dll not found error

This commit is contained in:
eliboa 2018-05-17 19:46:51 +02:00
parent 441b6f325d
commit 4bd9e8dfd6
2 changed files with 17 additions and 1 deletions

View file

@ -74,6 +74,9 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
RCM_BITMAP2.SetBitmap(DRIVER_KO);
RCM_BITMAP3.SetBitmap(RCM_DETECTED);
BOOL isDriverInstalled = LookForDriver();
if (!isDriverInstalled) InstallDriver();
string value = GetPreset("AUTO_INJECT");
if (value == "TRUE")
{
@ -222,12 +225,15 @@ void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
this->GetDlgItem(IDC_INJECT)->EnableWindow(FALSE);
this->GetDlgItem(IDC_SHOFEL2)->EnableWindow(FALSE);
s = "lbusbK driver is needed !";
/*
if (!ASK_FOR_DRIVER)
{
ASK_FOR_DRIVER = TRUE;
InstallDriver();
}
*/
}
else
{
@ -244,7 +250,7 @@ void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
DELAY_AUTOINJECT = TRUE;
}
}
if (rc != RCM_STATUS)
{
CStatic*pCtrl0 = (CStatic*)GetDlgItem(RCM_PIC_4);
@ -534,3 +540,12 @@ void CTegraRcmGUIDlg::InstallDriver()
}
}
}
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;
}

View file

@ -63,4 +63,5 @@ public:
afx_msg string GetPreset(string param);
afx_msg void SetPreset(string param, string value);
afx_msg void InstallDriver();
afx_msg BOOL LookForDriver();
};