forked from I2P_Developers/i2p.i2p
merge of '97f6b32a68c76e9cbe8832d250144facb6aa729e'
and 'd9b5e2fc62256d9dc0d320fe593d56f0252b7f48'
This commit is contained in:
@@ -7,21 +7,16 @@
|
|||||||
|
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
//BOOL MoveFontPropertiesFile(const char *path);
|
//BOOL MoveFontPropertiesFile(const char *path);
|
||||||
#ifdef _WIN32
|
|
||||||
void SetWorkingDirectory(char *path);
|
void SetWorkingDirectory(char *path);
|
||||||
#endif
|
|
||||||
void readOptions(char***, int*);
|
void readOptions(char***, int*);
|
||||||
//BOOL localJREExists(const char*);
|
//BOOL localJREExists(const char*);
|
||||||
//BOOL exist(const char*);
|
BOOL exist(const char*);
|
||||||
|
|
||||||
// defined in java.c
|
// defined in java.c
|
||||||
extern void* MemAlloc(size_t);
|
extern void* MemAlloc(size_t);
|
||||||
@@ -39,14 +34,10 @@ main(int argc, char** argv) {
|
|||||||
int new_argc;
|
int new_argc;
|
||||||
char** new_argv;
|
char** new_argv;
|
||||||
int i;
|
int i;
|
||||||
#ifdef _WIN32
|
|
||||||
char currentDirectory[MAX_PATH+1];
|
char currentDirectory[MAX_PATH+1];
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set/get the correct working directory.
|
// Set/get the correct working directory.
|
||||||
#ifdef _WIN32
|
|
||||||
SetWorkingDirectory(currentDirectory);
|
SetWorkingDirectory(currentDirectory);
|
||||||
#endif
|
|
||||||
|
|
||||||
// If there are command-line arguments, just use them
|
// If there are command-line arguments, just use them
|
||||||
if(argc > 1) {
|
if(argc > 1) {
|
||||||
@@ -83,26 +74,20 @@ main(int argc, char** argv) {
|
|||||||
case ERROR_COULDNT_FIND_JVM:
|
case ERROR_COULDNT_FIND_JVM:
|
||||||
case ERROR_COULDNT_INITIALIZE_JVM:
|
case ERROR_COULDNT_INITIALIZE_JVM:
|
||||||
case ERROR_COULDNT_LOAD_JVM:
|
case ERROR_COULDNT_LOAD_JVM:
|
||||||
#ifdef _WIN32
|
|
||||||
if (MessageBox(NULL, "I2P needs the Java Runtime Environment 5.0 or above. Click OK to go to www.java.com, where you can install Java.",
|
if (MessageBox(NULL, "I2P needs the Java Runtime Environment 5.0 or above. Click OK to go to www.java.com, where you can install Java.",
|
||||||
"I2P Launcher Error",
|
"I2P Launcher Error",
|
||||||
MB_ICONWARNING | MB_OKCANCEL) == IDOK)
|
MB_ICONWARNING | MB_OKCANCEL) == IDOK)
|
||||||
ShellExecute(NULL, NULL, "http://www.java.com/", "", "", SW_SHOWNORMAL);
|
ShellExecute(NULL, NULL, "http://www.java.com/", "", "", SW_SHOWNORMAL);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case ERROR_COULDNT_PARSE_ARGUMENTS:
|
case ERROR_COULDNT_PARSE_ARGUMENTS:
|
||||||
#ifdef _WIN32
|
|
||||||
MessageBox(NULL, "I2P failed to parse the commandline arguments to Java.\n"
|
MessageBox(NULL, "I2P failed to parse the commandline arguments to Java.\n"
|
||||||
"Please download and install I2P again.",
|
"Please download and install I2P again.",
|
||||||
"I2P Launcher Error", MB_OK);
|
"I2P Launcher Error", MB_OK);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case ERROR_STARTING_PROGRAM:
|
case ERROR_STARTING_PROGRAM:
|
||||||
#ifdef _WIN32
|
|
||||||
MessageBox(NULL, "I2P was unable to load.\n"
|
MessageBox(NULL, "I2P was unable to load.\n"
|
||||||
"Please download and install I2P again.",
|
"Please download and install I2P again.",
|
||||||
"I2P Launcher Error", MB_OK);
|
"I2P Launcher Error", MB_OK);
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -184,7 +169,6 @@ void readOptions(char*** options, int* size) {
|
|||||||
/*
|
/*
|
||||||
* Sets the current working directory to wherever I2P.exe is located
|
* Sets the current working directory to wherever I2P.exe is located
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
|
||||||
static void
|
static void
|
||||||
SetWorkingDirectory(char *path) {
|
SetWorkingDirectory(char *path) {
|
||||||
GetModuleFileName(NULL, path, MAX_PATH + 1);
|
GetModuleFileName(NULL, path, MAX_PATH + 1);
|
||||||
@@ -192,7 +176,6 @@ SetWorkingDirectory(char *path) {
|
|||||||
SetCurrentDirectory(path);
|
SetCurrentDirectory(path);
|
||||||
GetCurrentDirectory(MAX_PATH + 1, path);
|
GetCurrentDirectory(MAX_PATH + 1, path);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks to see if an app-installed JRE exists.
|
* Checks to see if an app-installed JRE exists.
|
||||||
@@ -226,14 +209,13 @@ MoveFontPropertiesFile(const char *path) {
|
|||||||
return copySucceeded;
|
return copySucceeded;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
BOOL exist(const char *filename) {
|
BOOL exist(const char *filename) {
|
||||||
struct stat s;
|
struct stat s;
|
||||||
return stat(filename, &s) == 0 ? TRUE : FALSE;
|
return stat(filename, &s) == 0 ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
__declspec(dllimport) char **__initenv;
|
__declspec(dllimport) char **__initenv;
|
||||||
|
|
||||||
int WINAPI
|
int WINAPI
|
||||||
@@ -252,4 +234,3 @@ WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user