Major rework: added Makefile, product.json.diff; added abbility to install extensions automatically; etc.

This commit is contained in:
2020-11-02 23:38:15 +01:00
committed by root
parent d4cee90c4a
commit 677c876dc8
7 changed files with 121 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ DefVar $CreateContextMenuEntry$
DefVar $ContextMenuArguments$
DefVar $CreateDesktopShortcut$
DefVar $DesktopShortcutArgument$
DefVar $ExtensionList$
[Aktionen]
ShowBitmap "%ScriptPath%\logo.png" "MDG Visual Studio Code"
@@ -13,12 +14,16 @@ Sub_GetProperties
Sub_ConfigureProperties
Sub_PrepareInstall
WinBatch_Setup
DosInAnIcon_AfterInstall
Sub_CopySettings
DosInAnIcon_Extensions
Sub_HandleExitCode
[Sub_GetProperties]
Set $Version$ = GetValue("productversion", GetProductMap)
Set $CreateContextMenuEntry$ = GetProductProperty("contextmenuentry", "false")
Set $CreateDesktopShortcut$ = GetProductProperty("desktopshortcut", "false")
Set $ExtensionList$ = GetProductProperty("extensions", "")
[Sub_ConfigureProperties]
if ($CreateContextMenuEntry$ = "true")
@@ -43,9 +48,29 @@ endif
[WinBatch_Setup]
%ScriptPath%\data\VSCodeSetup-x64-$Version$.exe /VERYSILENT /SUPPRESSMSGBOXES /MERGETASKS="!runcode$ContextMenuArguments$$DesktopShortcutArgument$" /LOG="%opsiLogDir%\vscode-install.log"
; VERYSILENT unterdrückt das Installationsfenster
; SUPPRESSMSGBOXES unterdrückt Benachrichtigungsfenster
; MERGETASKS verhindert das automatische Starten des Programms nach der Installation
[DosInAnIcon_AfterInstall]
; Apply patch to product.json
; 1. disables telemetry
; 2. removes "target": "system"
%ScriptPath%\utils\patch.exe "%ProgramFiles64Dir%\Microsoft VS Code\resources\app\product.json" %ScriptPath%\product.json.diff
; Create directory for user and extension data
mkdir "%ProgramFiles64Dir%\Microsoft VS Code\data"
icacls "%ProgramFiles64Dir%\Microsoft VS Code\data" /grant Benutzer:(OI)(CI)(M,DC) /T > nul
[Sub_CopySettings]
; Disables automatic updates
; Disables telemetry
if not (FileExists("%ProgramFiles64Dir%\Microsoft VS Code\data\user-data\User\settings.json"))
comment "Copying default config file"
Files_CopySettings
endif
[Files_CopySettings]
copy "%ScriptPath%\settings.json" "%ProgramFiles64Dir%\Microsoft VS Code\data\user-data\User"
[DosInAnIcon_Extensions]
"%ScriptPath%\generateExtensionArguments.bat" $ExtensionList$
[Sub_HandleExitCode]
; check return code