免互動安裝Paste Into File、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id PasteIntoFile.PasteIntoFile -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id PasteIntoFile.PasteIntoFile -e --silentwinget uninstall --id PasteIntoFile.PasteIntoFile -e --silent依安裝檔
32位元 · MSI · 僅目前使用者 · en-US
靜默安裝
msiexec /i PasteIntoFile_v5.6.1_installer_signed.msi /qn /norestart寫入記錄檔
msiexec /i PasteIntoFile_v5.6.1_installer_signed.msi /qn /norestart /l*v "%TEMP%\paste-into-file-install.log"解除安裝
msiexec /x {CA74FFE0-A1A2-42B6-8DD3-358725B79F9A} /qn /norestart- MSI產品代碼
- {CA74FFE0-A1A2-42B6-8DD3-358725B79F9A}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CA74FFE0-A1A2-42B6-8DD3-358725B79F9A}
- UpgradeCode
- {D3BEE3F0-4EC0-44CC-ADDC-E7A3E133B9D2}
- 安裝資料夾
- %ProgramFiles(x86)%\PasteIntoFile
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-paste-into-file.ps1
$url = 'https://github.com/eltos/PasteIntoFile/releases/download/v5.6.1/PasteIntoFile_v5.6.1_installer_signed.msi'
$sha256 = 'EC03659D9D52851D0ADE06EB32A02FA25ADAB88AFB6E0060DFC23A60A402927E'
$file = Join-Path $env:TEMP 'PasteIntoFile_v5.6.1_installer_signed.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