using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using Microsoft.Win32; namespace SCJMapper_V2 { /// /// Find the SC pathes and folders /// class SCPath { /// /// Try to locate the launcher under "App Paths" /// static private String SCLauncherPath1 { get { String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\StarCitizen Launcher.exe", "", null ); if ( scpath != null ) { return scpath; } return ""; } } /// /// Try to locate the launcher under "Uninstall" /// static private String SCLauncherPath2 { get { String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\StarCitizen", "DisplayIcon", null ); if ( scpath != null ) { return scpath; } return ""; } } /// /// Returns the base SC install path from something like "E:\G\StarCitizen\Launcher\StarCitizenLauncher.exe" /// static private String SCBasePath { get { String scp = SCLauncherPath1; if ( String.IsNullOrEmpty( scp ) ) { scp = SCLauncherPath2; if ( String.IsNullOrEmpty( scp ) ) { return ""; // sorry did not found a thing.. } } // found the launcher scp = Path.GetDirectoryName( scp ); // "E:\G\StarCitizen\Launcher" scp = Path.GetDirectoryName( scp ); // "E:\G\StarCitizen" return scp; } } /// /// Returns the SC installation path /// static public String SCInstallPath { get { return SCBasePath; } } /// /// Returns the SC ClientData path e.g. "E:\G\StarCitizen\CitizenClient\Data" /// static public String SCClientDataPath { get { String scp = SCBasePath; if ( String.IsNullOrEmpty( scp ) ) return ""; // scp = Path.Combine( scp, "CitizenClient" ); scp = Path.Combine( scp, "Data" ); return scp; } } /// /// Returns the SC ClientData path e.g. "E:\G\StarCitizen\CitizenClient\USER" /// static public String SCClientUSERPath { get { String scp = SCBasePath; if ( String.IsNullOrEmpty( scp ) ) return ""; // scp = Path.Combine( scp, "CitizenClient" ); scp = Path.Combine( scp, "USER" ); return scp; } } /// /// Returns the SC GameData.pak file path e.g. "E:\G\StarCitizen\CitizenClient\Data\GameData.pak" /// static public String SCGameData_pak { get { String scp = SCClientDataPath; if ( String.IsNullOrEmpty( scp ) ) return ""; // scp = Path.Combine( scp, "GameData.pak" ); return scp; } } /// /// Returns the relative path of DefaultProfile.xml /// static public String DefaultProfilePath_rel { get { return @"Libs\Config"; } } /// /// Returns the name of the DefaultProfile.xml /// static public String DefaultProfileName { get { return @"defaultProfile.xml"; } } } }