installationinno-setupvisual-studio-codesilent-installer

How to install Visual Studio Code silently (without auto open when installation ends)?


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?


Solution

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

    VSCodeUserSetup-x64-1.86.2.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