[Bug 5600] New: __argv[0] does not contain path of started executable

Wine Bugs wine-bugs at winehq.org
Tue Jul 4 19:26:07 CDT 2006


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 at winehq.org
        ReportedBy: schroeder at 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.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list