removed libwdi.. too much UAC headaches..

users will use zadig just like with dolphin
This commit is contained in:
Jack Andersen
2015-05-01 20:14:36 -10:00
parent f0dc0451fd
commit 570396b76c
6 changed files with 34 additions and 79 deletions

View File

@@ -59,11 +59,39 @@ public:
}
#if _WIN32
extern "C" int genWin32ShellExecute(const wchar_t* AppFullPath,
const wchar_t* Verb,
const wchar_t* Params,
bool ShowAppWindow,
bool WaitToFinish);
static int genWin32ShellExecute(const wchar_t* AppFullPath,
const wchar_t* Verb,
const wchar_t* Params,
bool ShowAppWindow,
bool WaitToFinish)
{
int Result = 0;
// Setup the required structure
SHELLEXECUTEINFO ShExecInfo;
memset(&ShExecInfo, 0, sizeof(SHELLEXECUTEINFO));
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = Verb;
ShExecInfo.lpFile = AppFullPath;
ShExecInfo.lpParameters = Params;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = (ShowAppWindow ? SW_SHOW : SW_HIDE);
ShExecInfo.hInstApp = NULL;
// Spawn the process
if (ShellExecuteEx(&ShExecInfo) == FALSE)
{
Result = -1; // Failed to execute process
} else if (WaitToFinish)
{
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
}
return Result;
}
#include <libwdi/libwdi.h>
static void scanWinUSB()
{
@@ -81,7 +109,7 @@ static void scanWinUSB()
!strcmp(device->driver, "HidUsb"))
{
printf("GC adapter detected; installing driver\n");
genWin32ShellExecute(L"WinUsbInstaller.exe", L"", L"", false, true);
}
}
wdi_destroy_list(list);