14

I found the option to install silently from command line (vscode-installer.exe /VERYSILENT), BUT it still opens automatically at the end of the installation, thus making unattended installation on multiple computers inconvenient.

I checked Inno Setup's documentation (that's what the Visual Studio Code installer uses), but there's nothing related to disabling Visual Studio Code autostart (even on very silent installation).

There might be a way by using /COMPONENTS, /TASKS or /MERGETASKS, but for that I need to know what is already available for use.

Is there a way to make it install completely silently?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Igor Popov
  • 9,795
  • 7
  • 55
  • 68
  • Related: [How to silently install Visual Studio Code on Windows?](https://stackoverflow.com/q/29973213/1364007) – Wai Ha Lee Jan 06 '22 at 14:14

4 Answers4

26

There's a hidden task runcode, that gets automatically selected for silent installations. To unselect the runcode task, use the /MERGETASKS=!runcode option.

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

(Credits for the /MERGETASKS=!runcode go to @RobertWigley)


The above is based on build/win32/code.iss in the GitHub repo:

[Tasks]
Name: "runcode"; Description: "{cm:RunAfter,{#NameShort}}"; \
    GroupDescription: "{cm:Other}"; Check: WizardSilent

[Run]
Filename: "{app}\{#ExeBasename}.exe"; \
    Description: "{cm:LaunchProgram,{#NameLong}}"; Tasks: runcode; \
    Flags: nowait postinstall; Check: ShouldRunAfterUpdate
Filename: "{app}\{#ExeBasename}.exe"; \
    Description: "{cm:LaunchProgram,{#NameLong}}"; \
    Flags: nowait postinstall; Check: WizardNotSilent
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
5

I found to run within Powershell I used Start-Process, Execute-Process seemed to be deprecated for me.

The below is the line I use.

Start-Process -FilePath "path/to/vscode/VSCodeUserSetup-x64.exe" -Argument "/VERYSILENT /MERGETASKS=!runcode"
boopzz
  • 53
  • 1
  • 3
  • 1
    I found some additional arguments helpful: '/verysilent /suppressmsgboxes /mergetasks=!runcode,desktopicon'. – DocOc Jan 08 '21 at 18:33
0

Execute-Process is a built-in function for PowerShell Application Deployment Toolkit (PSADT) and the -Parameters parameter is also not a standard parameter, but part of that custom function.

Instead, use Start-Process -FilePath "VSCode.exe" -ArgumentList "/VERYSILENT /MERGETASKS=!runcode"

You can pass any of the arguments in the -ArgumentList

-1

Execute-Process -Path "VSCodeUserSetup-x64-1.30.1.exe" -Parameters "/VERYSILENT /CLOSEAPPLICATIONS

you can use this for PowerShell installation.

krishna
  • 11
  • 7