Remove Microsoft store (fix #674)
This commit is contained in:
@@ -89,7 +89,6 @@ pub enum Step {
|
|||||||
Mas,
|
Mas,
|
||||||
Micro,
|
Micro,
|
||||||
MicrosoftAutoUpdate,
|
MicrosoftAutoUpdate,
|
||||||
MicrosoftStore,
|
|
||||||
Myrepos,
|
Myrepos,
|
||||||
Nix,
|
Nix,
|
||||||
Node,
|
Node,
|
||||||
|
|||||||
@@ -145,9 +145,6 @@ fn run() -> Result<()> {
|
|||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
runner.execute(Step::MicrosoftStore, "Windows App Store", || {
|
|
||||||
windows::upgrade_store_apps(&ctx)
|
|
||||||
})?;
|
|
||||||
runner.execute(Step::Chocolatey, "Chocolatey", || windows::run_chocolatey(&ctx))?;
|
runner.execute(Step::Chocolatey, "Chocolatey", || windows::run_chocolatey(&ctx))?;
|
||||||
runner.execute(Step::Scoop, "Scoop", || windows::run_scoop(config.cleanup(), run_type))?;
|
runner.execute(Step::Scoop, "Scoop", || windows::run_scoop(config.cleanup(), run_type))?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
use crate::execution_context::ExecutionContext;
|
||||||
use crate::executor::{CommandExt, RunType};
|
use crate::executor::{CommandExt, RunType};
|
||||||
use crate::powershell;
|
use crate::powershell;
|
||||||
use crate::terminal::print_separator;
|
use crate::terminal::print_separator;
|
||||||
use crate::utils::require;
|
use crate::utils::require;
|
||||||
use crate::{error::SkipStep, steps::git::Repositories};
|
use crate::{error::SkipStep, steps::git::Repositories};
|
||||||
use crate::{execution_context::ExecutionContext, utils::require_option};
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
@@ -85,17 +85,6 @@ pub fn windows_update(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
ctx.run_type().execute(&usoclient).arg("StartInstall").check_run()
|
ctx.run_type().execute(&usoclient).arg("StartInstall").check_run()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn upgrade_store_apps(ctx: &ExecutionContext) -> Result<()> {
|
|
||||||
let powershell = powershell::Powershell::windows_powershell();
|
|
||||||
|
|
||||||
let path = powershell.path().as_ref().unwrap();
|
|
||||||
let sudo = require_option(ctx.sudo().as_ref(), String::from("Sudo is required"))?;
|
|
||||||
print_separator("Microsoft Store");
|
|
||||||
println!("Updating Microsoft Store applications in the background");
|
|
||||||
|
|
||||||
ctx.run_type().execute("cmd").arg("/c").args(&[sudo, path]).args(&["-NoProfile", "-Command", "(Get-WmiObject -Namespace 'root\\cimv2\\mdm\\dmmap' -Class 'MDM_EnterpriseModernAppManagement_AppManagement01').UpdateScanMethod() > $null"]).check_run()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn reboot() {
|
pub fn reboot() {
|
||||||
Command::new("shutdown").args(&["/R", "/T", "0"]).spawn().ok();
|
Command::new("shutdown").args(&["/R", "/T", "0"]).spawn().ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,6 @@ impl Powershell {
|
|||||||
Powershell { path, profile }
|
Powershell { path, profile }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
|
||||||
pub fn path(&self) -> &Option<PathBuf> {
|
|
||||||
&self.path
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub fn windows_powershell() -> Self {
|
pub fn windows_powershell() -> Self {
|
||||||
Powershell {
|
Powershell {
|
||||||
|
|||||||
Reference in New Issue
Block a user