http://bugs.winehq.org/show_bug.cgi?id=5600
Summary: __argv[0] does not contain path of started executable Product: Wine Version: 0.9.16. Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-binary AssignedTo: wine-bugs@winehq.org ReportedBy: schroeder@stw-bonn.de
(sorry, don't know what component is appropriate, i had to select one) the following code to find the path of the executable (and from that the datafile kicker.sar) does not work in wine if the program is started like "wine kicker.exe".
std::string prgPath = __argv[0]; int pos = prgPath.find_last_of('\'); if (pos != prgPath.npos) prgPath.erase(pos+1);
std::string sar = prgPath + "kicker.sar";
example program that uses this code-fragment: http://spiele.download.t-online.de/dladvert/45943
manually setting that prgPath fixes the problem (there are still problems in that program e.g. that fonts are not displayed, but that's another problem). I have the full source code of that gamedemo - ask for further info if required.