免互動安裝OnionShare Dev、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id OnionShare.OnionShare.Dev -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id OnionShare.OnionShare.Dev -e --silentwinget uninstall --id OnionShare.OnionShare.Dev -e --silent依安裝檔
64位元 · MSI · 僅目前使用者
靜默安裝
msiexec /i OnionShare-win64-2.6.dev1.msi /qn /norestart寫入記錄檔
msiexec /i OnionShare-win64-2.6.dev1.msi /qn /norestart /l*v "%TEMP%\onionshare-dev-install.log"解除安裝
msiexec /x {0252D0FE-2569-4832-88A8-630DC04FD9CF} /qn /norestart- MSI產品代碼
- {0252D0FE-2569-4832-88A8-630DC04FD9CF}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0252D0FE-2569-4832-88A8-630DC04FD9CF}
32位元 · MSI · 僅目前使用者
靜默安裝
msiexec /i OnionShare-win32-2.6.dev1.msi /qn /norestart寫入記錄檔
msiexec /i OnionShare-win32-2.6.dev1.msi /qn /norestart /l*v "%TEMP%\onionshare-dev-install.log"解除安裝
msiexec /x {0108C458-0BEB-450F-9946-5D0AC018640C} /qn /norestart- MSI產品代碼
- {0108C458-0BEB-450F-9946-5D0AC018640C}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0108C458-0BEB-450F-9946-5D0AC018640C}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-onionshare-dev.ps1
$url = 'https://github.com/onionshare/onionshare/releases/download/v2.6.dev1/OnionShare-win64-2.6.dev1.msi'
$sha256 = '87004AFB13DE6587BC8C87FD3B806DBF44EB048A13D522900FC9A95FB9668EDD'
$file = Join-Path $env:TEMP 'OnionShare-win64-2.6.dev1.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 install-onionshare-dev.ps1
$url = 'https://github.com/onionshare/onionshare/releases/download/v2.6.dev1/OnionShare-win32-2.6.dev1.msi'
$sha256 = '46702A223453E582ED33140CFB3243C822624179F397D70FBE7F5E77D0516B6E'
$file = Join-Path $env:TEMP 'OnionShare-win32-2.6.dev1.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