ACR_ServerMisc.ACR_ServerMisc.ExecuteUpdaterScript C# (CSharp) Method

ExecuteUpdaterScript() private method

This method is called to execute the server updater script, if one existed.
private ExecuteUpdaterScript ( ) : bool
return bool
        private bool ExecuteUpdaterScript()
        {
            string UpdaterScriptPath = SystemInfo.GetNWNX4InstallationDirectory() + "ACR_UpdaterScript.cmd";

            if (!File.Exists(UpdaterScriptPath))
            {
                WriteTimestampedLogEntry(String.Format(
                    "ACR_ServerMisc.ExecuteUpdaterScript(): Updater script '{0}' doesn't exist.",
                    UpdaterScriptPath));
                return false;
            }

            try
            {
                ProcessStartInfo StartInfo = new ProcessStartInfo(UpdaterScriptPath);

                StartInfo.CreateNoWindow = true;
                StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                StartInfo.LoadUserProfile = false;
                StartInfo.UseShellExecute = false;

                Process.Start(StartInfo);
            }
            catch (Exception e)
            {
                WriteTimestampedLogEntry(String.Format(
                    "ACR_ServerMisc.ExecuteUpdaterScript(): Exception '{0}' starting updater script '{1}'.",
                    e,
                    UpdaterScriptPath));
                return false;
            }

            return true;
        }