Bug Description

Relative file names put on the command line for the
Windows (XP SP2) version of Inkscape are taken to be
relative to the Inkscape installation directory rather
than the current directory.

The name of the file to be opened has to be fully
qualified otherwise it's not found. If the name of the
file for the --export-png option does not have any
directory specification then the exported file is put
in the Inkscape directory (e.g., C:\Program
Files\Inkscape 0.43) rather than the current directory.

This is a right pain if you want to create a make file
which is portable across multiple systems.

This problem doesn't seem to apply on Linux (Ubuntu)
where the current directory is used correctly.

This is the relevant snippet of code from main() in main.cpp. What should be done instead is that _win32_getExePath should be called whenever a resource is requested. This isn't a trivial change since it requires refctoring how Inkscape's datafiles are accessed.

#ifdef WIN32
/*
Set the current directory to the directory of the
executable. This seems redundant, but is needed for
when inkscape.exe is executed from another directory.
We use relative paths on win32.
HKCR\svgfile\shell\open\command is a good example
*/
Glib::ustring homedir = _win32_getExePath();
SetCurrentDirectory(homedir.c_str());
_win32_set_inkscape_env(homedir);
RegistryTool rt;
rt.setPathInfo();
#endif

Another way it could be done (I'd been thinking of doing it for my PortableApps.com applications, especially Inkscape incidentally) is by just analysing the command line, and seeing if it's a file which exists. If it is, use the shlwapi.dll PathCombine DLL call (there may be a better way of doing it, but I doubt it). I believe that PathCombine will work even if it's an absolute path, but if not you'd need to do something like, does it start with \\ or is the second character : or something like that.

Chris Morgan: this would still be an ugly hack. We need to reduce the number of hacks in Inkscape, because we already at the brink of collapse into unmaintainability. All that needs to be done is to modify the profile_path function.