private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

            try
            {
                if (!IPCService.StartService())
                {
                    throw new Exception(Language.Can_not_open_a_named_pipe_for_Inter_process_communication);
                }

                var profiles     = Profile.GetAllProfiles().ToArray();
                var profileIndex = !string.IsNullOrWhiteSpace(CommandLineOptions.Default.ProfileId) &&
                                   profiles.Length > 0
                    ? Array.FindIndex(profiles,
                                      p =>
                                      p.Id.Equals(CommandLineOptions.Default.ProfileId,
                                                  StringComparison.InvariantCultureIgnoreCase))
                    : -1;

                switch (CommandLineOptions.Default.Action)
                {
                case HeliosStartupAction.SwitchProfile:
                    SwitchProfile(profiles, profileIndex);

                    break;

                case HeliosStartupAction.EditProfile:
                    EditProfile(profiles, profileIndex);

                    break;

                case HeliosStartupAction.CreateShortcut:
                    CreateShortcut(profiles, profileIndex);

                    break;

                default:
                    IPCService.GetInstance().Status = InstanceStatus.User;
                    Application.Run(new MainForm());

                    break;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(
                    string.Format(Language.Operation_Failed, e.Message),
                    Language.Fatal_Error,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }