Beispiel #1
0
 private static void SaveInstallInfo(IInstall install)
 {
     BlobCache.LocalMachine.InsertObject("install", install switch
     {
         SteamInstall => new SavedInstall(SavedInstallType.Steam, install.Directory()),
         ManualInstall => new SavedInstall(SavedInstallType.Manual, install.Directory())
     });
        public FormConfiguration()
        {
            InitializeComponent();

            IUnityContainer container = new UnityContainer();

            container.RegisterType <IInfrastructureFactory, InfrastructureFactory>();

            _appDownload = container.Resolve <Download>();
            _appInstall  = container.Resolve <Install>();
        }
        public PatcherViewModel(IInstall install)
        {
            Router    = new RoutingState();
            Activator = new ViewModelActivator();

            this.install = install;
            this.WhenActivated(disposables =>
            {
                Router
                .Navigate
                .Execute(new PatcherURLInputViewModel(install.Directory(), this))
                .Subscribe()
                .DisposeWith(disposables);
            });
        }
        public static void PrepareUpgrade(IInstall instance)
        {
            var settingsPath = Path.Combine(instance.GetLocation(), "settings.json");
            byte[] settingsData = null;

            if (File.Exists(settingsPath))
                settingsData = File.ReadAllBytes(settingsPath);

            instance.Uninstall();

            Directory.CreateDirectory(instance.GetLocation());

            if (settingsData != null)
                File.WriteAllBytes(settingsPath, settingsData);
        }
Beispiel #5
0
 static Helper()
 {
     switch (Settings.OS)
     {
         case Settings.OSType.Mac:
             Instance = new MacInstall();
             break;
         case Settings.OSType.Linux:
             Instance = new LinuxInstall();
             break;
         default:
             Instance = new WindowsInstall();
             break;
     }
 }
Beispiel #6
0
        static Helper()
        {
            switch (Settings.OS)
            {
            case Settings.OSType.Mac:
                Instance = new MacInstall();
                break;

            case Settings.OSType.Linux:
                Instance = new LinuxInstall();
                break;

            default:
                Instance = new WindowsInstall();
                break;
            }
        }