Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working directory not specified!
#1
I wasn't sure this really fit in the bug reporting section, so I'm putting it here. The pcsx2 executable file doesn't seem to set the working directory before trying to do stuff, it just assumes the working directory is the executable path. Generally it's a good practice to specifically declare the working directory to ensure that things work as expected.

To see what I mean, try running the commands below. The first one runs as expected, because the working directory is forcefully changed before running the executable, but the second can't find the data folder, so it tries to reset the configs and can't find any of the plugins or other things from that path.

cd "C:\Program Files\PCSX2\" && pcsx2.exe
"C:\Program Files\PCSX2\pcsx2.exe"
Reply

Sponsored links

#2
Thanks for the tip. Forwarded to Jake.
Reply
#3
(01-02-2011, 07:07 AM)CyruzDraxs Wrote: The pcsx2 executable file doesn't seem to set the working directory before trying to do stuff, it just assumes the working directory is the executable path. Generally it's a good practice to specifically declare the working directory to ensure that things work as expected.

No, it's not generally a good idea. It disables a fundamentally useful feature to power users and developers alike, and will cause the program to behave in unexpected ways, as I will illustrate below.

In order to properly implement the behavior you are expecting, what PCSX2 should actually do (and this is what most other apps actually do) is rely on a single instance of ini settings; either stored in the User Documents folder, a ProgramData/AppData folder, or in the Registry. In turn, PCSX2's working directory remains consistent, and commands like such will execute as expected:

Code:
cd myIsoGames
"C:\Program Files\PCSX2\pcsx2.exe"  awesomeGame01.iso

... and the need for maintaining the CWD becomes even more important if you start utilizing command-line based plugin, ini file, etc. overrides.

We intentionally forced PCSX2 to re-run the wizard when run from unknown folders because it is a common scenario for users to have multiple copies of multiple versions of PCSX2 in different folders ("c:\program files\pcsx2 0.9.6" and "c:\program files\pcsx2 0.9.7", for example -- each with a different set of plugins, settings, and language files and what-not). Your suggestion wouldn't interfere with that particular behavior, but it would interfere with several basic tenants of CWD expectations that many other users (including myself) rely on.

Unfortunately, PCSX2 versioning hasn't been very strong recently; as most people have relied on beta releases and bleeding-edge SVN builds -- meaning that devs nor users could use version numbers to differentiate compatibility of plugin/ini files -- and that's why we had to have a generic "per-folder" settings system instead of a more sensible per-version settings system.

I'm hoping that has changed enough with our planned 0.9.8 release that I can finally create a proper remedy for this situation.

In short: 0.9.8 should fix your problem, just in a nicer way that forcefully overriding the CWD feature of your operating system.
Jake Stine (Air) - Programmer - PCSX2 Dev Team
Reply
#4
(01-02-2011, 07:07 AM)CyruzDraxs Wrote: The pcsx2 executable file doesn't seem to set the working directory before trying to do stuff, it just assumes the working directory is the executable path.

Actually, that's not quite true. It assumes the working directory is the directory you launched the program from. I just noticed this behavior when I was playing with command line and launching PCSX2 from the ISO directory.

If you try launching "C:\Program Files\PCSX2\pcsx2.exe" via the Run box, it works properly. So will a shortcut on the desktop. However, if you do:

Code:
cd "C:\random"
"C:\Program Files\PCSX2\pcsx2.exe"

It assumes the working directory is "C:\random" and you'll have to go through the set-up wizard again. Given that I currently have 5 PCSX2 folders with different versions and plugins, though, I'm fine with the way PCSX2 currently handles settings.

Edit: Lol, Jake beat me to it. Tongue2
Reply
#5
Anyway I just hope that "non blessed" C:\Program Files is not on Vista or Win7.

Being installed there is source of many problems not only for PCSX2 as many other games and applications. Mainly those which rely on 3rth party applications/features, like the moddable games.

Albeit not related to the original post, new users can see the thread and then learn to avoid those specially protected folders.
Imagination is where we are truly real
Reply




Users browsing this thread: 1 Guest(s)