source: release-kits/shared/windows/wrapper/cdrom-wrapper.cpp@ 19588

Last change on this file since 19588 was 19588, checked in by oranfry, 15 years ago

a little wrapper for the cdrom installer jar, has none of it's own resources, just run the external jar with the external jre

File size: 868 bytes
Line 
1#include <windows.h>
2
3#include <string>
4#include <shellapi.h>
5
6using namespace std;
7
8int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
9
10 int choice = MessageBox(NULL, "Install Greenstone?", "Greenstone", MB_OKCANCEL | MB_ICONQUESTION );
11 if ( choice != IDOK ) {
12 return 0;
13 }
14
15 STARTUPINFO si;
16 PROCESS_INFORMATION pi;
17 memset(&pi, 0, sizeof(pi));
18 memset(&si, 0, sizeof(si));
19 si.cb = sizeof(si);
20
21 DWORD dwExitCode = -1;
22 char* cmd = "Java\\Windows\\jre\\bin\\java.exe -jar Java\\Jars\\windows.jar";
23
24 bool result;
25 result = CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
26
27 WaitForSingleObject(pi.hProcess, INFINITE);
28 GetExitCodeProcess(pi.hProcess, &dwExitCode);
29 CloseHandle(pi.hThread);
30 CloseHandle(pi.hProcess);
31
32 return dwExitCode;
33
34}
Note: See TracBrowser for help on using the repository browser.