62int main(
int argc,
char *argv[])
67#if (GNUSTEP_BASE_MAJOR_VERSION == 1 && (GNUSTEP_BASE_MINOR_VERSION == 24 && GNUSTEP_BASE_SUBMINOR_VERSION >= 9) || (GNUSTEP_BASE_MINOR_VERSION > 24)) || (GNUSTEP_BASE_MAJOR_VERSION > 1)
74 #define MAX_PATH_LEN 256
75 char currentWorkingDir[MAX_PATH_LEN];
76 char envVarString[2 * MAX_PATH_LEN];
77 DWORD bufferSize = MAX_PATH_LEN;
79 QueryFullProcessImageName(GetCurrentProcess(), 0, currentWorkingDir, &bufferSize);
81 char *probeString = strrchr(currentWorkingDir,
'\\');
82 if (probeString) *probeString =
'\0';
85 char finalPath[16 * MAX_PATH_LEN];
86 char *systemPath = SDL_getenv(
"PATH");
87 strcpy(finalPath, currentWorkingDir);
88 strcat(finalPath,
";");
89 strcat(finalPath, systemPath);
91 #define SETENVVAR(var, value) do {\
92 sprintf(envVarString, "%s=%s", (var), (value));\
93 SDL_putenv (envVarString);\
96 SETENVVAR(
"GNUSTEP_PATH_HANDLING",
"windows");
97 SETENVVAR(
"PATH", finalPath);
98 SETENVVAR(
"GNUSTEP_SYSTEM_ROOT", currentWorkingDir);
99 SETENVVAR(
"GNUSTEP_LOCAL_ROOT", currentWorkingDir);
100 SETENVVAR(
"GNUSTEP_NETWORK_ROOT", currentWorkingDir);
101 SETENVVAR(
"GNUSTEP_USERS_ROOT", currentWorkingDir);
102 SETENVVAR(
"HOMEPATH", currentWorkingDir);
104 SetCurrentDirectory(currentWorkingDir);
110 setlocale(LC_ALL,
"C");
115 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
124 for (i = 1; i < argc; i++)
126 if (strcmp(
"-load", argv[i]) == 0)
142 @catch (NSException *exception)
144 OOLogERR(
kOOLogException,
@"Root exception handler hit - terminating. This is an internal error, please report it. Exception name: %@, reason: %@", [exception name], [exception reason]);