请访问原文链接:如何禁用 Microsoft Edge 自动更新 (macOS, Windows),查看最新版。转载请保留出处。
作者:gc(at)sysin.org,主页:www.sysin.org

如何禁用 Mozilla Firefox 自动更新 如何禁用 Microsoft Edge 自动更新 如何禁用 Google Chrome 自动更新

未经用户允许自动更新,也不提供选项禁用自动更新,属实不文明不举,以下方法可以禁用自动更新。

Microsoft Edge for Windows

Microsoft Edge 如何自动更新?
当前以 Edge 88.0 版本为例,新版本将来可能有所变更:
企业版使用以下方法进行自动更新

  1. 服务:
  2. Microsoft Edge 更新 服务 (edgeupdate)
  3. Microsoft Edge 更新 服务 (edgeupdatem)
  4. Microsoft Edge Elevation Service (MicrosoftEdgeElevationService)
  5. 任务计划:
  6. MicrosoftEdgeUpdateBrowserReplacementTask
  7. MicrosoftEdgeUpdateTaskMachineCore
  8. MicrosoftEdgeUpdateTaskMachineUA
  9. 安装路径:
  10. C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
  11. 更新程序路径:
  12. C:\Program Files (x86)\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe

巨硬阿三不讲究,无论 64-bit 还是 32-bit 的 Edge 都安装在 “Program Files (x86”) 目录下面(Chrome 没有这个问题)。
用户版使用以下方法自动更新

  1. 任务计划:
  2. MicrosoftEdgeUpdateTaskUser当前用户的SIDCore
  3. MicrosoftEdgeUpdateTaskUser当前用户的SIDUA
  4. 例如:
  5. MicrosoftEdgeUpdateTaskUserS-1-5-21-3860493963-3742860931-3732056798-500Core
  6. MicrosoftEdgeUpdateTaskUserS-1-5-21-3860493963-3742860931-3732056798-500UA
  7. 用户版安装路径:
  8. C:\Users\用户名\AppData\Local\Microsoft\Edge\Application\msedge.exe
  9. 自动更新程序路径:
  10. C:\Users\用户名\AppData\Local\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe

使用 PowerShell 禁用更新

  1. if ([Environment]::Is64BitOperatingSystem -eq True”) {
  2. #Write-Host "64-bit OS"
  3. $PF=${env:ProgramFiles(x86)}
  4. }
  5. else {
  6. #Write-Host "32-bit OS"
  7. $PF=$env:ProgramFiles
  8. }
  9. if ($(Test-Path "$PF\Microsoft\Edge\Application\msedge.exe") -eq "True") {
  10. # 结束进程
  11. taskkill /im MicrosoftEdgeUpdate.exe /f
  12. taskkill /im msedge.exe /f
  13. # Microsoft Edge 更新服务
  14. #这里也可以使用 sc.exe stop "service name"
  15. Stop-Service -Name "edgeupdate"
  16. Stop-Service -Name "edgeupdatem"
  17. Stop-Service -Name "MicrosoftEdgeElevationService"
  18. # Windows 10 默认 PS 版本 5.1 没有 Remove-Service 命令
  19. # This cmdlet was added in PS v6. See https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#cmdlet-updates.
  20. #Remove-Service -Name "edgeupdate"
  21. #Remove-Service -Name "edgeupdatem"
  22. #Remove-Service -Name "MicrosoftEdgeElevationService"
  23. # sc 在 PowerShell 中是 Set-Content 别名,所以要使用 sc.exe 否则执行后无任何效果
  24. sc.exe delete "edgeupdate"
  25. sc.exe delete "edgeupdatem"
  26. sc.exe delete "MicrosoftEdgeElevationService"
  27. # 任务计划企业版
  28. schtasks.exe /Delete /TN \MicrosoftEdgeUpdateBrowserReplacementTask /F
  29. schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskMachineCore /F
  30. schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskMachineUA /F
  31. # 移除更新程序
  32. Remove-Item "$PF\Microsoft\EdgeUpdate" -Recurse -Force
  33. Write-Output "Disable Microsoft Edge Enterprise Auto Update Successful!"
  34. }
  35. elseif ($(Test-Path "$env:USERPROFILE\AppData\Local\Microsoft\Edge\Application\msedge.exe") -eq "True") {
  36. # 结束进程
  37. taskkill /im MicrosoftEdgeUpdate.exe /f
  38. taskkill /im msedge.exe /f
  39. # 用户版没有创建服务
  40. # 获取SID方法
  41. function Get-CurrentUserSID {
  42. [CmdletBinding()]
  43. param(
  44. )
  45. Add-Type -AssemblyName System.DirectoryServices.AccountManagement
  46. return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value
  47. }
  48. # 用户版任务计划
  49. schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskUser$(Get-CurrentUserSID)Core /F
  50. schtasks.exe /Delete /TN \MicrosoftEdgeUpdateTaskUser$(Get-CurrentUserSID)UA /F
  51. # 移除更新程序
  52. Remove-Item "$env:USERPROFILE\AppData\Local\Microsoft\EdgeUpdate" -Recurse -Force
  53. Write-Output "Disable Microsoft Edge Users Setup Auto Update Successful!"
  54. }
  55. else {
  56. Write-Output "No Microsoft Edge Installation Detected!"
  57. }

效果图:
如何禁用 Microsoft Edge 自动更新 (macOS, Windows) - 图1

Microsoft Edge for Mac

在 macOS 中 Edge 使用 Microsoft AutoUpdate app 进行自动更新,只需要取消加载项和移除该 app 的执行权限(或者删除)即可。

  1. launchctl unload /Library/LaunchAgents/com.microsoft.update.agent.plist
  2. sudo chmod -R 644 /Library/Application\ Support/Microsoft/MAU2.0/Microsoft\ AutoUpdate.app
  3. # 或者直接删除更新程序
  4. sudo rm -rf /Library/Application\ Support/Microsoft/MAU2.0/

效果图:
如何禁用 Microsoft Edge 自动更新 (macOS, Windows) - 图2

资源

Microsoft Edge 策略配置
Microsoft Edge 下载