免互動安裝CC Switch、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id farion1231.CC-Switch -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id farion1231.CC-Switch -e --silentwinget uninstall --id farion1231.CC-Switch -e --silent依安裝檔
64位元 · MSI · 僅目前使用者 · en-US
靜默安裝
msiexec /i CC-Switch-v4.0.20-Windows.msi /qn /norestart寫入記錄檔
msiexec /i CC-Switch-v4.0.20-Windows.msi /qn /norestart /l*v "%TEMP%\cc-switch-install.log"解除安裝
msiexec /x {21721E2D-00C4-49C3-BF08-981E51E2975B} /qn /norestart- MSI產品代碼
- {21721E2D-00C4-49C3-BF08-981E51E2975B}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{21721E2D-00C4-49C3-BF08-981E51E2975B}
- UpgradeCode
- {55F90CA4-617A-5350-A7CF-F6F24252866B}
- 安裝資料夾
- %LocalAppData%/Programs/CC Switch
- DisplayVersion
- 4.0.20
ARM64 · MSI · 僅目前使用者 · en-US
靜默安裝
msiexec /i CC-Switch-v4.0.20-Windows-arm64.msi /qn /norestart寫入記錄檔
msiexec /i CC-Switch-v4.0.20-Windows-arm64.msi /qn /norestart /l*v "%TEMP%\cc-switch-install.log"解除安裝
msiexec /x {3CA6F599-2901-484F-9951-E638F97632FC} /qn /norestart- MSI產品代碼
- {3CA6F599-2901-484F-9951-E638F97632FC}
- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3CA6F599-2901-484F-9951-E638F97632FC}
- UpgradeCode
- {55F90CA4-617A-5350-A7CF-F6F24252866B}
- 安裝資料夾
- %LocalAppData%/Programs/CC Switch
- DisplayVersion
- 4.0.20
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-cc-switch.ps1
$url = 'https://github.com/farion1231/cc-switch/releases/download/v4.0.20/CC-Switch-v4.0.20-Windows.msi'
$sha256 = '332D7D8B8E8FF80E5BF64D70F119388B773D72A8A1B1152A6FF075745B1435B8'
$file = Join-Path $env:TEMP 'CC-Switch-v4.0.20-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 install-cc-switch.ps1
$url = 'https://github.com/farion1231/cc-switch/releases/download/v4.0.20/CC-Switch-v4.0.20-Windows-arm64.msi'
$sha256 = '97F99FD7938BDA46C10985D4D7EDC03E37B6F166CDE10406C50E28FF9D2FA847'
$file = Join-Path $env:TEMP 'CC-Switch-v4.0.20-Windows-arm64.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