Ejemplo n.º 1
0
        public Main()
        {
            Logger.Trace("START");
            config = Config.Load();
            if (!config.Sections.ContainsSection("features"))
            {
                config["features"]["DesktopAFKStatus"] = "False";
            }
            if (Program.Arguments.Launcher.IgnoreSSLErrors.IsTrue)
            {
                Logger.Warn(Program.Arguments.Launcher.IgnoreSSLErrors.Name.Quote(), "is set, ignoring SSL Errors!");
                ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => true;
            }
            InitializeComponent();
            // var args = Program.args.Skip(1).ToArray();
            var gameInSameDir = Setup.Game.CheckForGame();

            if (!gameInSameDir)
            {
                SetupGame();
            }
            Setup.URIResponse regKeyCorrect = Setup.URI.CheckURIRegistryKey();
            Logger.Trace("match=", regKeyCorrect.match.ToString());
            if (regKeyCorrect.match != Setup.URIResponse.URIEnum.INSTALLED)
            {
                SetupURI(regKeyCorrect.expected, regKeyCorrect.key);
            }
            // richTextBox1.Text = "match: "+ regKeyCorrect.match.ToString() + "\n\nexpected: " + regKeyCorrect.expected + "\n\nkey: " + regKeyCorrect.key + "\n\n";
            selflog   = lst_log_launcher; gamelog = lst_log_game; statusBar = txt_status;
            webClient = new WebClient();
            Logger.Trace("END");
        }
Ejemplo n.º 2
0
        public static URIResponse CheckURIRegistryKey()
        {
            var ret = new URIResponse(URIResponse.URIEnum.UNKNOWN, "", "");

            ret.key = (string)Registry.GetValue(key, null, null);
            if (ret.key == null)
            {
                return(ret);
            }
            // Logger.Trace("key=", ret.key);
            var steamFile      = Path.Combine(Utils.Utils.getOwnPath().DirectoryName, "launch.bat");
            var expected_steam = $@"""{steamFile}"" ""%1"""; // ""{ownPath}""

            // Logger.Trace("expected_steam=", expected_steam);
            if (expected_steam == ret.key)
            {
                ret.match = URIResponse.URIEnum.DEFAULT; return(ret);
            }
            ret.expected = $@"""{Utils.Utils.getOwnPath().FullName}"" ""%1"""; // ""{ownPath}""
            // Logger.Trace("expected=", ret.expected);
            if (ret.key != ret.expected)
            {
                ret.match = URIResponse.URIEnum.WRONG;
            }
            else
            {
                ret.match = URIResponse.URIEnum.INSTALLED;
            }
            Logger.Debug(ret.ToJson());
            // "G:\Steam\steamapps\common\VRChat\launch.bat" "G:\Steam\steamapps\common\VRChat" "%1"
            return(ret);
        }