private void Initialize(ILauncherSettings settings) { Context = CreateContext(settings); if (Data.SoftwareVersion != null) { Data.SoftwareVersion.text = $"v{settings.SoftwareVersion}"; } Initialize(Context); }
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(); }
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); }
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); }
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); }
private void Initialize(ILauncherSettings settings) { Context = CreateContext(settings); Initialize(Context); }
protected abstract void OverrideSettings(ILauncherSettings settings);