免互動安裝NRootWindowsInstallerx64、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Andrea.NRootx64 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Andrea.NRootx64 -e --silentwinget uninstall --id Andrea.NRootx64 -e --silent依安裝檔
64位元 · MSI · en-US
靜默安裝
msiexec /i NRootWindowsInstallerx64.msi /qn /norestart寫入記錄檔
msiexec /i NRootWindowsInstallerx64.msi /qn /norestart /l*v "%TEMP%\nrootwindowsinstallerx64-install.log"解除安裝
msiexec /x {D030448B-5062-42B1-9C7A-3EE0A68A8CF3} /qn /norestart- MSI產品代碼
- {D030448B-5062-42B1-9C7A-3EE0A68A8CF3}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D030448B-5062-42B1-9C7A-3EE0A68A8CF3}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-nrootwindowsinstallerx64.ps1
$url = 'https://github.com/NuggiDev/NRoot/releases/download/NRoot_1.0/NRootWindowsInstallerx64.msi'
$sha256 = '90998D2FB750DC126AE5D622E29A1127C076D74091861392FDC624A107F45D63'
$file = Join-Path $env:TEMP 'NRootWindowsInstallerx64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait