免互動安裝Second Desk、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Ryanisgood.SecondDesk -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Ryanisgood.SecondDesk -e --silentwinget uninstall --id Ryanisgood.SecondDesk -e --silent依安裝檔
64位元 · EXE(NSIS) · 僅目前使用者
靜默安裝
SecondDesk-v1.3.3-Windows-Setup.exe /S自訂安裝資料夾
SecondDesk-v1.3.3-Windows-Setup.exe /S /D=C:\Apps\second-desk- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Second Desk
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i SecondDesk-v1.3.3-Windows.msi /qn /norestart寫入記錄檔
msiexec /i SecondDesk-v1.3.3-Windows.msi /qn /norestart /l*v "%TEMP%\second-desk-install.log"解除安裝
msiexec /x {680A4F7E-4A5B-4AB1-9A3B-90869CE1D150} /qn /norestart- MSI產品代碼
- {680A4F7E-4A5B-4AB1-9A3B-90869CE1D150}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{680A4F7E-4A5B-4AB1-9A3B-90869CE1D150}
- UpgradeCode
- {1F4FB4E3-59D7-52F0-A521-9B5EE2A36837}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-second-desk.ps1
$url = 'https://github.com/Ryanisgood/SecondDesk/releases/download/v1.3.3/SecondDesk-v1.3.3-Windows-Setup.exe'
$sha256 = '2C1ACAE452F6332147BCD92BB4D0F209323A52AAFF37CB2E0C88BC5AF335A1AA'
$file = Join-Path $env:TEMP 'SecondDesk-v1.3.3-Windows-Setup.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '/S' -Wait install-second-desk.ps1
$url = 'https://github.com/Ryanisgood/SecondDesk/releases/download/v1.3.3/SecondDesk-v1.3.3-Windows.msi'
$sha256 = '8187DD74042867E97513A775DE7BBB03BF72FA1CDCD40118B53865E9B53243C7'
$file = Join-Path $env:TEMP 'SecondDesk-v1.3.3-Windows.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