4

我发现从命令行(vscode-installer.exe /VERYSILENT),但是静默安装的选项它仍会在安装结束时自动打开,从而使多台计算机上的无人值守安装变得不方便。如何静默安装Visual Studio代码(安装结束时不自动打开)?

我检查了Inno Setup's documentation(这是Visual Studio代码安装程序使用的),但没有任何与禁用Visual Studio代码自动启动(即使在非常安静的安装)相关。

有可能通过使用/COMPONENTS/TASKS/MERGETASKS,但为此我需要知道什么是可用的。

有没有办法让它安装完全静默?

回答

3

有一个隐藏任务runcode,那就会自动进行静默安装选择:

[Run] 
Filename: "{app}\Code.exe"; Description: "{cm:LaunchProgram,Visual Studio Code}"; \ 
    Tasks: runcode; Check: "WizardSilent"; MinVersion: 0.0,6.01.7600; \ 
    Flags: postinstall nowait 
Filename: "{app}\Code.exe"; Description: "{cm:LaunchProgram,Visual Studio Code}"; \ 
    Check: "WizardNotSilent"; MinVersion: 0.0,6.01.7600; Flags: postinstall nowait 

[Tasks] 
Name: "runcode"; Description: "{cm:RunAfter,Code}"; GroupDescription: "{cm:Other}"; \ 
    Check: "WizardSilent"; MinVersion: 0.0,6.01.7600; 

要取消的runcode任务,使用/MERGETASKS=!runcode option

VSCodeSetup-1.10.1.exe /VERYSILENT /MERGETASKS=!runcode 

(现金为/MERGETASKS=!runcode去@RobertWigley)

+2

使用感叹号将取消选择一个特定的任务,即'mergetasks =!runco​​de'。这也适用于组件。 –

+1

@RobertWigley谢谢!我已经修改了我的答案。 –