Skip to main content

Silent Installation of Microsoft Visual Studio Code 1.18




What is It?
Microsoft Visual Studio Code is a source code editor developed by Microsoft for WindowsLinux and macOS. It includes support for debugging, embedded Git control, syntax highlightingintelligent code completionsnippets, and code refactoring. It is also customizable, so users can change the editor's themekeyboard shortcuts, and preferences. It is free and open-source, although the official download is under a proprietary license.

The source is available for download here.


How to Install Silently?

To Install:

Step 1: Download the source from web and get the installer "VSCodeSetup-x64-1.18.0.exe"

Step 2: Run following command:
VSCodeSetup-x64-1.18.0.exe /VERYSILENT /NORESTART /LOADINF=setup.inf

                /VERYSILENT: for fully silent installation. /SILENT or /SP or /SUPRESSMSGBOXES are other varieties for different level of user interface
                  /NORESTART: to suppress any restart prompt
                  /LOADINF="path of inf file"
                  /LOG="path of log file"
                  /CLOSEAPPLICATIONS: to close all dependent applications before install initializes
                  /LANG: select your preferred language
                  /DIR: set your customized install directory

Note: With /LOADINF argument, many settings can be put altogether (like install directory, keeping Start Menu Shortcuts etc.) in the inf file.

To Uninstall:


Run following command:
"%ProgramFiles%\Microsoft VS Code\unins000.exe" /VERYSILENT /NORESTART

                /VERYSILENT: for silent installation
                /NORESTART: to suppress any restart prompts

Additional Notes:

  • Above mentioned install/uninstall instructions are created based on version 1.18 of Visual Studio Code in 64-bit machine.
  • Ensure that Visual Studio Code (code.exe) isn't running when installing the application, to avoid any data loss. Else as mentioned above, /CLOSEAPPLICATIONS argument also works.
Note: This can be taken care by a new feature introduced from SCCM 1702 onwards. "Install Behavior" option under "Deployment Method" enables process kill before install process executes. So, people using SCCM latest version, can use this feature rather than Taskkill in Windows.
  • Command executions are based on SCCM platform or used with tools like PsExec, to make them run in System Context only.
  • Suggested detection Method in SCCM:
Setting Type: Registry
Hive: HKLM
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA457B21-F73E-494C-ACAB-524FDE069978}_is1
Value: DisplayVersion
Data Type: String
Operator: Equals
Value: 1.18.0

Comments

  1. You mentioned making sure code isn't running to avoid data loss.

    "Ensure that Visual Studio Code (code.exe) isn't running when installing the application, to avoid any data loss. Else as mentioned above, /CLOSEAPPLICATIONS argument also works"

    Does using /closeapplications close code and save state of open files, or is that a setting that would need to be configured in the app, perhaps that could be configured in setup.inf?

    I want to force the app to update, but I don't want a developer who left the app open with files with unsaved changes to lose their work.

    Also, what is the purpose of /norestart? I assume you would want the user to restart if necessary (perhaps not immediately, I assume it can be deferred, but eventually).

    Thanks

    ReplyDelete

Post a Comment