public LaunchLogic() { LauncherName = Path.GetFileNameWithoutExtension(SetHnd.Paths.LauncherPath); GameName = Path.GetFileNameWithoutExtension(SetHnd.Paths.GamePath); MonitorPath = SettingsData.ValidatePath(SetHnd.Paths.MonitorPath) ? SetHnd.Paths.MonitorPath : ""; MonitorName = Path.GetFileNameWithoutExtension(MonitorPath); LauncherPathValid = SettingsData.ValidatePath(SetHnd.Paths.LauncherPath); LauncherURIMode = SettingsData.ValidateURI(SetHnd.Paths.LauncherURI); TrayUtil = new TrayIconUtil(); }
public ProcessLauncher(string procPath, string procArgs, // required string avoidProcName = "", int delayTime = 0, bool elevate = false, int avoidPID = 0, string monitorName = "") { ProcWrapper = new ProcessWrapper(); ExecPath = procPath; ExecArgs = procArgs; AvoidProcName = avoidProcName; Delay = delayTime; Elevated = elevate; MonitorName = monitorName; AvoidPID = avoidPID; // construct and save our ProcessWrapper if (SettingsData.ValidatePath(ExecPath) || SettingsData.ValidateURI(ExecPath)) { Process _procObj = new Process(); _procObj.StartInfo.UseShellExecute = true; _procObj.StartInfo.FileName = ExecPath; _procObj.StartInfo.Arguments = ExecArgs; if (!SettingsData.ValidateURI(ExecPath)) { _procObj.StartInfo.WorkingDirectory = Directory.GetParent(ExecPath).ToString(); } if (Elevated) { _procObj.StartInfo.Verb = "runas"; } // bind our process wrapper ProcWrapper = new ProcessWrapper(_procObj, avoidPID: AvoidPID, altName: MonitorName, avoidProcName: AvoidProcName ); } }