Пример #1
0
        public bool Start()
        {
            switch (Utils.OS)
            {
            case OperatingSystemID.Windows:
                updater = new SparkleWin();
                break;

            case OperatingSystemID.OSX:
#if OSTYPE_OS_X
                updater = new SparkleOSX();
                break;
#else
                Log.Error("Sparkle backend for OS X not enabled in this build, define OSTYPE_OS_X");
                return(false);
#endif
            case OperatingSystemID.Linux:
                updater = new SimplifiedAppUpdater();
                break;
            }
            try {
                updater?.Start(companyName, App.Current.SoftwareName, App.Current.Version.ToString(),
                               feedURL, App.Current.baseDirectory);
                App.Current.DependencyRegistry.Register <IAppUpdater> (updater);
            } catch (Exception ex) {
                Log.Exception(ex);
                return(false);
            }
            return(true);
        }