08-01-2010, 11:32 PM
I am trying to write code that auto-detects the patches folder in the PCSX2 directory. Is there an easy way to do this? I.e. is some sort of registry entry that points to the directory created when PCSX2 is installed?
Currently my code does the following:
1. Loop through all drives on the machine and look for the "Program Files" directory.
2. If Program Files exists, look for a subdirectory that contains "pcsx2" (case insensitive) in its name and has a subdirectory called "patches". If it is found, return the path and stop searching.
So this will find the PCSX2 directory as long as
a) it is in the Program Files directory in the root of one of the computer's drives
b) it has the string "pcsx2" in its name
c) it contains a subdirectory called patches
d) the search doesn't find a false positive first
I am just wondering if there is a better way.
Currently my code does the following:
1. Loop through all drives on the machine and look for the "Program Files" directory.
2. If Program Files exists, look for a subdirectory that contains "pcsx2" (case insensitive) in its name and has a subdirectory called "patches". If it is found, return the path and stop searching.
So this will find the PCSX2 directory as long as
a) it is in the Program Files directory in the root of one of the computer's drives
b) it has the string "pcsx2" in its name
c) it contains a subdirectory called patches
d) the search doesn't find a false positive first
I am just wondering if there is a better way.