예제 #1
0
        private void Initialize(ILauncherSettings settings)
        {
            Context = CreateContext(settings);

            if (Data.SoftwareVersion != null)
            {
                Data.SoftwareVersion.text = $"v{settings.SoftwareVersion}";
            }

            Initialize(Context);
        }
예제 #2
0
        public UpdatingContext(ILauncherSettings settings, IProgress <UpdateProgress> progress)
        {
            _isDirty          = false;
            _dirtyReasons     = new List <string>();
            _isRepairNeeded   = false;
            Settings          = settings;
            _progressReporter = progress;
            PatchesPath       = new List <PatchDefinition>();

            Runner     = new UpdateRunner();
            Downloader = new FileDownloader();
        }
예제 #3
0
        protected UpdatingContext CreateContext(ILauncherSettings settings)
        {
            var progress = new ProgressReporter();

            progress.ProgressChanged.AddListener(Data.UpdateProgressChanged);

            var context = new UpdatingContext(settings, progress);

            context.Logger            = new MHLab.Patch.Utilities.Logging.Logger(settings.GetLogsFilePath());
            context.Serializer        = new NewtonsoftSerializer();
            context.LocalizedMessages = new EnglishUpdaterLocalizedMessages();

            return(context);
        }
예제 #4
0
        private UpdatingContext CreateContext(ILauncherSettings settings)
        {
            var progress = new ProgressReporter();

            progress.ProgressChanged.AddListener(Data.UpdateProgressChanged);

            var context = new UpdatingContext(settings, progress);

            context.Logger            = new SimpleLogger(context.FileSystem, settings.GetLogsFilePath(), settings.DebugMode);
            context.Serializer        = new JsonSerializer();
            context.LocalizedMessages = new EnglishUpdaterLocalizedMessages();

            return(context);
        }
예제 #5
0
        protected override void OverrideSettings(ILauncherSettings settings)
        {
            string rootPath = string.Empty;

#if UNITY_EDITOR
            rootPath = Path.Combine(Path.GetDirectoryName(Application.dataPath), LauncherData.WorkspaceFolderName, "TestLauncher");
            Directory.CreateDirectory(rootPath);
#elif UNITY_STANDALONE_WIN
            rootPath = Directory.GetParent(Application.dataPath).FullName;
#elif UNITY_STANDALONE_LINUX
            rootPath = Directory.GetParent(Application.dataPath).FullName;
#elif UNITY_STANDALONE_OSX
            rootPath = Directory.GetParent(Directory.GetParent(Application.dataPath).FullName).FullName;
#endif

            settings.RootPath = FilesManager.SanitizePath(rootPath);
        }
예제 #6
0
        private void Initialize(ILauncherSettings settings)
        {
            Context = CreateContext(settings);

            Initialize(Context);
        }
예제 #7
0
 protected abstract void OverrideSettings(ILauncherSettings settings);