1

In my current environment VsCode is being deployed to users through SCCM so they have the ability to install the app without admin rights. The current installation supports switches such as /Silent etc, but doesn't seem to have any other switches that would define auto updates to be off by default when the app is installed. The reason for this as I'm sure you're all aware VSCode will prompt the user letting them know there's an update avaliable. Done some digging already and as detailed, you can change the settings.Json file to disable the updates, which would be great if this was a 'system wide' i.e (C:\Program Files\Microsoft VS Code) settings file, but as detailed Here it points to %appdata% (User settings).

So, in theory you could query the user on the install and then just do some powershelly magic to chuck the required json data into that settings file and the user would be away and wouldn't have to manually turn off auto updates However SCCM installations install as an elevated account (system) not as the individual user running them so it doesn't appear feasible to manage it that way.

So fundamentally if there was a way/switch that would allow the auto update feature to be disabled on install or as a post install step I'd be very grateful for any clues on how to achieve this.

Thanks!

Isaac
  • 784
  • 10
  • 23
  • 1
    I agree that this should be done via a setup switch ideally so I post this only as comment not answer but sccm allows for installation with user rights and also for every user that logs in so you could in theory create a second program that sets the settings and deploy it afterwards. If everything else fails you could also wrap a short start script (preferably vbs because its silent) around your executable and set the setting at each program start (would also prevent users from changing that setting back for longer than one session) – Syberdoor Sep 17 '19 at 09:19
  • Could an .inf file be loaded in with the required configs also as it's an INNO installer? the only issue which I would then face would be targeting the user i.e not systems %appdata% – Isaac Sep 17 '19 at 12:36
  • I have no experience with this particular installer, only with sccm in general so I could not say. If there is any sort of template for the user config file you could just replace that so that in the future everything based on the template would already contain your settings, but I did a quick google search and found nothing in that direction so it might be impossible to do without some sort of workaround like the ones I described – Syberdoor Sep 18 '19 at 06:53

2 Answers2

1

To achieve this with SCCM you can do the following (I will describe this for a package\program it is however also possible to achieve with an application, the options are pretty similar there):

  1. Create a installer program the same way you would if you did not want to deploy settings (something like VSCodeSetup.exe /VERYSILENT /MERGETASKS=!runcode as your commandline and in the programs "Environment" tab select "Run with administrative rights")
  2. Create a second program that copies (or creates) a settings file in the way you want it to %appdata%
  3. In this second programs options in "Environment" set "Program can run:" to "Only when a user is logged on" and "Run mode" to "Run with user's rights"
  4. On the "Advanced" tab set "When this program is assigned to a computer:" to "Run once for every user who logs on"
  5. Deploy both programs to your collection

With this setup SCCM basically does what you want split into two different setups for the respective rights needed. There will be short times where the program is installed and the settings are not yet applied (can be shortened by setting "Run another program first:" in your config setup to the base setup but this makes things a little more complex and still if a new user logs in some time during a windows update job there will be delay until the settings are deployed) but the only way to guarantee that there is never a time where the settings are not applied is by replacing the default program start with a script that sets your options.

Syberdoor
  • 2,521
  • 1
  • 11
  • 14
  • I do like this solution and have implemented similar in the past. However, I've nearly always ended up having to create a new shortcut to the application .exe with a script, which checks for existence of the file in appdata and copies if required. This means any user could use the application on the system, a requirement for orgs which swap machines. – SolidSid Sep 24 '19 at 09:48
  • As long as you set to "Run once for _every_ user..." you can still swap - whoever logs on gets the file - but I agree as a practical solution I too might use a script just because it gives a lot more direct control. However as a general answer as to what is possible with sccm and what is not , I thought this should be noted – Syberdoor Sep 24 '19 at 10:37
  • This seems like the most plausible way of doing it! thanks for the explanation, I'll have a dig around and see what I can do. Back to my question ban it appears like as i got no upvotes. sad times. Thanks for your help @SolidSid & Syberdoor – Isaac Sep 26 '19 at 16:58
0

The settings JSON (likely the one which is being deployed with SCCM) just needs this entry:

"update.mode": "none"

While by default it has the auto-update channel enabled:

"update.mode": "default"

A post-install script could do that - but while it's located in %appdata%, the user still can change it.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216