用于免交互安装Command Code、卸载以及在部署工具中检测安装状态的命令。只列出确定可用的命令:来自清单文件,或来自安装程序技术的官方默认参数。
相关教程: 静默安装参数大全:MSI、NSIS、Inno Setup · 用注册表或PowerShell卸载程序
使用winget
PowerShell
winget install --id CommandCode.CommandCodeDesktop -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id CommandCode.CommandCodeDesktop -e --silentwinget uninstall --id CommandCode.CommandCodeDesktop -e --silent按安装包
64位 · EXE(NSIS) · 仅当前用户
静默安装
CommandCode-0.1.58-x64-setup.exe /S自定义安装目录
CommandCode-0.1.58-x64-setup.exe /S /D=C:\Apps\command-code- 卸载注册表项
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\b46e7766-e5c9-54ed-a8b3-18e11b17c52b
- 安装目录
- %LocalAppData%\Programs\Command Code
64位 · EXE(NSIS) · 所有用户
静默安装
CommandCode-0.1.58-x64-setup.exe /S自定义安装目录
CommandCode-0.1.58-x64-setup.exe /S /D=C:\Apps\command-code- 卸载注册表项
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\b46e7766-e5c9-54ed-a8b3-18e11b17c52b
- 安装目录
- %ProgramFiles%\Command Code
PowerShell:下载、校验、安装
下载官方文件,校验SHA256后静默安装。
install-command-code.ps1
$url = 'https://github.com/CommandCodeAI/desktop/releases/latest/download/CommandCode-0.1.58-x64-setup.exe'
$sha256 = 'A91676207FD01F37E26F66D13E0B51A3FC45DC57719177889C7D11208565D49C'
$file = Join-Path $env:TEMP 'CommandCode-0.1.58-x64-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-command-code.ps1
$url = 'https://github.com/CommandCodeAI/desktop/releases/latest/download/CommandCode-0.1.58-x64-setup.exe'
$sha256 = 'A91676207FD01F37E26F66D13E0B51A3FC45DC57719177889C7D11208565D49C'
$file = Join-Path $env:TEMP 'CommandCode-0.1.58-x64-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