mirror of
https://github.com/eliboa/TegraRcmGUI.git
synced 2024-11-24 19:22:04 +00:00
added APX driver install
This commit is contained in:
parent
da19dd05d1
commit
e1fae125e2
3 changed files with 37 additions and 9 deletions
BIN
TegraRcmGUI.rc
BIN
TegraRcmGUI.rc
Binary file not shown.
|
@ -21,6 +21,7 @@ BOOL WAITING_RECONNECT = FALSE;
|
|||
BOOL AUTOINJECT_CURR= FALSE;
|
||||
BOOL PREVENT_AUTOINJECT= TRUE;
|
||||
BOOL DELAY_AUTOINJECT = FALSE;
|
||||
BOOL ASK_FOR_DRIVER = FALSE;
|
||||
CString csPath;
|
||||
|
||||
// CTegraRcmGUIDlg dialog
|
||||
|
@ -59,6 +60,8 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
EnableActiveAccessibility();
|
||||
|
||||
TCHAR szPath[_MAX_PATH];
|
||||
VERIFY(::GetModuleFileName(AfxGetApp()->m_hInstance, szPath, _MAX_PATH));
|
||||
CString csPathf(szPath);
|
||||
|
@ -100,20 +103,14 @@ BOOL CTegraRcmGUIDlg::OnInitDialog()
|
|||
}
|
||||
}
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CTegraRcmGUIDlg::StartTimer();
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void CTegraRcmGUIDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
|
@ -224,8 +221,13 @@ void CTegraRcmGUIDlg::OnTimer(UINT nIDEvent)
|
|||
pCtrl3->ShowWindow(SW_HIDE);
|
||||
this->GetDlgItem(IDC_INJECT)->EnableWindow(FALSE);
|
||||
this->GetDlgItem(IDC_SHOFEL2)->EnableWindow(FALSE);
|
||||
s = "Install lbusbK driver (download Zadig)";
|
||||
|
||||
s = "lbusbK driver is needed !";
|
||||
if (!ASK_FOR_DRIVER)
|
||||
{
|
||||
ASK_FOR_DRIVER = TRUE;
|
||||
InstallDriver();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -507,3 +509,28 @@ void CTegraRcmGUIDlg::SetPreset(string param, string value)
|
|||
remove(rfile_c);
|
||||
rename(wfile_c, rfile_c);
|
||||
}
|
||||
|
||||
|
||||
void CTegraRcmGUIDlg::InstallDriver()
|
||||
{
|
||||
CString message = _T("APX device driver is missing. Do you want to install it now ?");
|
||||
const int result = MessageBox(message, _T("APX driver not found !"), MB_YESNOCANCEL | MB_ICONQUESTION);
|
||||
if (result == IDYES)
|
||||
{
|
||||
SHELLEXECUTEINFO shExInfo = { 0 };
|
||||
shExInfo.cbSize = sizeof(shExInfo);
|
||||
shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
shExInfo.hwnd = 0;
|
||||
shExInfo.lpVerb = _T("runas");
|
||||
CString exe_file = csPath + _T("\\apx_driver\\InstallDriver.exe");
|
||||
shExInfo.lpFile = exe_file;
|
||||
shExInfo.lpDirectory = 0;
|
||||
shExInfo.nShow = SW_SHOW;
|
||||
shExInfo.hInstApp = 0;
|
||||
|
||||
if (ShellExecuteEx(&shExInfo))
|
||||
{
|
||||
CloseHandle(shExInfo.hProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,4 +62,5 @@ public:
|
|||
afx_msg void OnBnClickedShofel2();
|
||||
afx_msg string GetPreset(string param);
|
||||
afx_msg void SetPreset(string param, string value);
|
||||
afx_msg void InstallDriver();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue