Exemple #1
0
 public static void OpenSteamGame(
     HeliosStartupAction action = HeliosStartupAction.None,
     Profile profile            = null,
     uint steamAppId            = 0)
 {
     try
     {
         Helios.OpenSteamGame(action, profile, steamAppId);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString(), string.Format(Language.Failed_to_execute_action_Error_Message, e.Message),
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #2
0
 public static void Open(
     HeliosStartupAction action = HeliosStartupAction.None,
     Profile profile            = null,
     string programAddress      = null,
     bool asAdmin = false)
 {
     try
     {
         Helios.Open(action, profile, programAddress, asAdmin);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString(), string.Format(Language.Failed_to_execute_action_Error_Message, e.Message),
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public static void Open(HeliosStartupAction action = HeliosStartupAction.None,
                         Profile profile            = null,
                         string programAddress      = null, bool asAdmin = false)
 {
     try
     {
         if (!IsInstalled)
         {
             return;
         }
         var args = new List <string> {
             $"-a {action}"
         };
         if (profile != null)
         {
             args.Add($"-p \"{profile.Name}\"");
         }
         if (!string.IsNullOrWhiteSpace(programAddress))
         {
             args.Add($"-e \"{programAddress}\"");
         }
         var processInfo = new ProcessStartInfo(Address, string.Join(" ", args))
         {
             UseShellExecute = true
         };
         if (asAdmin)
         {
             processInfo.Verb = @"runas";
         }
         Process.Start(processInfo);
     }
     catch (Exception e)
     {
         // Check if operation canceled by user
         if ((e as Win32Exception)?.NativeErrorCode == 1223)
         {
             return;
         }
         throw;
     }
 }
 public static void OpenSteamGame(
     HeliosStartupAction action = HeliosStartupAction.None, Profile profile = null,
     uint steamAppId            = 0)
 {
     try
     {
         if (!IsInstalled)
         {
             return;
         }
         var args = new List <string> {
             $@"-a {action}"
         };
         if (profile != null)
         {
             args.Add($"-p \"{profile.Name}\"");
         }
         if (steamAppId > 0)
         {
             args.Add($"-s \"{steamAppId}\"");
         }
         var processInfo = new ProcessStartInfo(Address, string.Join(" ", args))
         {
             UseShellExecute = true
         };
         Process.Start(processInfo);
     }
     catch (Exception e)
     {
         // Check if operation canceled by user
         if ((e as Win32Exception)?.NativeErrorCode == 1223)
         {
             return;
         }
         throw;
     }
 }