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)
73 #define OO_SHOW_MSG(ooMsg, ooMsgTitle, ooMsgFlags) MessageBox(NULL, ooMsg, ooMsgTitle, ooMsgFlags)
76 #define TABS3 "\t\t\t"
80 #define MAX_PATH_LEN 256
81 char currentWorkingDir[MAX_PATH_LEN];
82 char envVarString[2 * MAX_PATH_LEN];
83 DWORD bufferSize = MAX_PATH_LEN;
85 QueryFullProcessImageName(GetCurrentProcess(), 0, currentWorkingDir, &bufferSize);
87 char *probeString = strrchr(currentWorkingDir,
'\\');
88 if (probeString) *probeString =
'\0';
91 char finalPath[16 * MAX_PATH_LEN];
92 char *systemPath = SDL_getenv(
"PATH");
93 strcpy(finalPath, currentWorkingDir);
94 strcat(finalPath,
";");
95 strcat(finalPath, systemPath);
97 #define SETENVVAR(var, value) do {\
98 sprintf(envVarString, "%s=%s", (var), (value));\
99 SDL_putenv (envVarString);\
102 SETENVVAR(
"GNUSTEP_PATH_HANDLING",
"windows");
103 SETENVVAR(
"PATH", finalPath);
104 SETENVVAR(
"GNUSTEP_SYSTEM_ROOT", currentWorkingDir);
105 SETENVVAR(
"GNUSTEP_LOCAL_ROOT", currentWorkingDir);
106 SETENVVAR(
"GNUSTEP_NETWORK_ROOT", currentWorkingDir);
107 SETENVVAR(
"GNUSTEP_USERS_ROOT", currentWorkingDir);
108 SETENVVAR(
"HOMEPATH", currentWorkingDir);
110 SetCurrentDirectory(currentWorkingDir);
116 setlocale(LC_ALL,
"C");
119 #define OO_SHOW_MSG(ooMsg, ooTitle, ooFlags) fprintf(stdout, ooMsg)
121 #define TABS2 "\t\t\t"
122 #define TABS3 "\t\t\t\t"
128 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
137 for (i = 1; i < argc; i++)
139 if (strcmp(
"-load", argv[i]) == 0)
146 if (!strcmp(
"-help", argv[i]) || !strcmp(
"--help", argv[i]))
148 char const *processName = [[[NSProcessInfo processInfo] processName] UTF8String];
150 snprintf(s,
sizeof(s),
"Usage: %s [options]\n\n"
151 "Options can be any of the following: \n\n"
152 "--compile-sysdesc"TABS2
"Compile system descriptions *\n"
153 "--export-sysdesc"TABS2
"Export system descriptions *\n"
155 "-hdr"TABS3
"Start up in HDR mode\n"
157 "-load [filepath]"TABS2
"Load commander from [filepath]\n"
158 "-message [messageString]"TABS1
"Display [messageString] at startup\n"
159 "-noshaders"TABS2 TABS4
"Start up with shaders disabled\n"
160 "-nosplash "TABS2 TABS4
"Force disable splash screen on startup\n"
161 "-nosound "TABS2 TABS4
"Start up with sound disabled\n"
162 "-novsync"TABS3
"Force disable V-Sync\n"
163 "--openstep"TABS2 TABS4
"When compiling or exporting\n"TABS3 TABS4
"system descriptions, use openstep\n"TABS3 TABS4
"format *\n"
164 "-showversion"TABS2 TABS4
"Display version at startup screen\n"
165 "-splash"TABS3 TABS4
"Force splash screen on startup\n"
166 "-verify-oxp [filepath] "TABS1
"Verify OXP at [filepath] *\n"
167 "--xml"TABS3 TABS4
"When compiling or exporting\n"TABS3 TABS4
"system descriptions, use xml\n"TABS3 TABS4
"format *\n"
169 "Options marked with \"*\" are available only in Test Release configuration.\n\n", processName);
170 OO_SHOW_MSG(s, processName, MB_OK);
171 OOLog(
@"process.args",
@"%s option detected, exiting after help page has been displayed.", argv[i]);
184 @catch (NSException *exception)
186 OOLogERR(
kOOLogException,
@"Root exception handler hit - terminating. This is an internal error, please report it. Exception name: %@, reason: %@", [exception name], [exception reason]);