Parent Directory | Revision Log
Revision 2096 - (view) (download)
1 : | Isibaar | 2096 | #include <windows.h> |
2 : | |||
3 : | int CALLBACK WinMain( | ||
4 : | __in HINSTANCE hInstance, | ||
5 : | __in HINSTANCE hPrevInstance, | ||
6 : | __in LPSTR lpCmdLine, | ||
7 : | __in int nCmdShow | ||
8 : | ) | ||
9 : | { | ||
10 : | CHAR path[MAX_PATH]; | ||
11 : | DWORD lExitCode = 0; | ||
12 : | |||
13 : | GetModuleFileNameA(NULL, path, ARRAYSIZE(path)); | ||
14 : | path[strlen(path)-15]='\0'; | ||
15 : | |||
16 : | CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); | ||
17 : | |||
18 : | SHELLEXECUTEINFOA ShExecInfo = {0}; | ||
19 : | ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); | ||
20 : | ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; | ||
21 : | ShExecInfo.hwnd = NULL; | ||
22 : | ShExecInfo.lpVerb = NULL; | ||
23 : | ShExecInfo.lpFile = strcat(path, "autoupdate-windows.exe"); | ||
24 : | ShExecInfo.lpParameters = " --mode unattended"; | ||
25 : | ShExecInfo.lpDirectory = NULL; | ||
26 : | ShExecInfo.nShow = SW_SHOW; | ||
27 : | ShExecInfo.hInstApp = NULL; | ||
28 : | |||
29 : | ShellExecuteExA(&ShExecInfo); | ||
30 : | WaitForSingleObject(ShExecInfo.hProcess, INFINITE); | ||
31 : | GetExitCodeProcess(ShExecInfo.hProcess, &lExitCode); | ||
32 : | |||
33 : | if (lExitCode == 0) { | ||
34 : | MessageBox(0, L"A new version of Xvid is available!\nYou can run the Updater now to install it.", L"Xvid AutoUpdate", MB_ICONINFORMATION); | ||
35 : | ShellExecuteA(0, "open", path, 0,0,SW_SHOWNORMAL); | ||
36 : | } | ||
37 : | |||
38 : | return 0; | ||
39 : | } | ||
40 : |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |