Exemple #1
0
        void UnregisterPrig(ConsoleViewModel vm)
        {
            var umwPkg = new MachineWideUninstallation(Resources.NuGetRootPackageVersion);

            umwPkg.Preparing += () => vm.BeginMachineWideProcessProgress(MachineWideProcesses.Uninstalling);
            umwPkg.ProfilerStatusChecking           += profLoc => vm.ReportProfilerStatusCheckingProgress(profLoc);
            umwPkg.ProfilerUnregistering            += profLoc => vm.ReportProfilerProcessingProgress(profLoc);
            umwPkg.ProfilerUnregistered             += stdout => vm.ReportProfilerProcessedProgress(stdout);
            umwPkg.EnvironmentVariableUnregistering += name => vm.ReportEnvironmentVariableProcessingProgress(name, null);
            umwPkg.EnvironmentVariableUnregistered  += name => vm.ReportEnvironmentVariableProcessedProgress();
            umwPkg.NuGetSourceUnregistering         += name => vm.ReportNuGetSourceProcessingProgress(name, null);
            umwPkg.NuGetSourceUnregistered          += stdout => vm.ReportNuGetSourceProcessedProgress(stdout);
            umwPkg.Completed += result => OnCompletedUnregisterPrig(vm, result);

            MachineWideInstaller.Uninstall(umwPkg);
        }
Exemple #2
0
        void RegisterPrig(ConsoleViewModel vm)
        {
            var mwInstl = new MachineWideInstallation(Resources.NuGetRootPackageVersion);

            mwInstl.IsPrigSourceInstallationDisabled = true;
            mwInstl.Preparing += () => vm.BeginMachineWideProcessProgress(MachineWideProcesses.Installing);
            mwInstl.ProfilerStatusChecking         += profLoc => vm.ReportProfilerStatusCheckingProgress(profLoc);
            mwInstl.NuGetPackageCreating           += pkgName => vm.ReportNuGetPackageCreatingProgress(pkgName);
            mwInstl.NuGetPackageCreated            += stdout => vm.ReportNuGetPackageCreatedProgress(stdout);
            mwInstl.NuGetSourceRegistering         += (path, name) => vm.ReportNuGetSourceProcessingProgress(path, name);
            mwInstl.NuGetSourceRegistered          += stdout => vm.ReportNuGetSourceProcessedProgress(stdout);
            mwInstl.EnvironmentVariableRegistering += (name, value) => vm.ReportEnvironmentVariableProcessingProgress(name, value);
            mwInstl.EnvironmentVariableRegistered  += (name, value) => vm.ReportEnvironmentVariableProcessedProgress();
            mwInstl.ProfilerRegistering            += profLoc => vm.ReportProfilerProcessingProgress(profLoc);
            mwInstl.ProfilerRegistered             += stdout => vm.ReportProfilerProcessedProgress(stdout);
            mwInstl.Completed += result => OnCompletedRegisterPrig(vm, result);

            MachineWideInstaller.Install(mwInstl);
        }