|
Bugzilla – Bug 345 |
Fiji can not be launched as usual anymore |
Last modified: 2015-04-06 15:44:11 CDT |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
Hi, we used to start Fiji from within our LA Software from the command line. This worked fine, but recently something within Fiji changed. Now it requires the ".exe" extension somehow. Since I am not the expert, I askes one of our programmers, and here is what he answered: (I hope that helps) The problem seems to be that you can start Fiji without using the .exe extension, however, you then can't use the name provided by argv[0] in functions like GetShortPathName since the file fiji-win32 actually doesn't exist. new_argv[0] = dos_path(new_argv[0]); for (i = 0; i < j; i++) new_argv[i] = quote_win32(new_argv[i]); execve(new_argv[0], (char * const *)new_argv, NULL); [...] static char *dos_path(const char *path) { int size = GetShortPathName(path, NULL, 0); char *buffer = (char *)xmalloc(size); GetShortPathName(path, buffer, size); return buffer; } Here is a small test case to demonstrate the problem: fiji1.cpp: #include <Windows.h> int main(int argc, char* argv[]) { int size = GetShortPathName(argv[0], NULL, 0); char *buffer = (char *)calloc(size, 1); GetShortPathName(argv[0], buffer, size); printf("GetShortPathName: %s GetLastError: 0x%08X\n", buffer, GetLastError()); } $ fiji1.exe GetShortPathName: fiji1.exe GetLastError: 0x00000000 $ fiji1 GetShortPathName: ²²²² GetLastError: 0x00000002