From b94042ef2134b6aab0378229a45f15c347559692 Mon Sep 17 00:00:00 2001 From: Kevin Dorner Date: Wed, 28 Oct 2020 00:18:46 +0100 Subject: [PATCH] the really initial commit --- control | 29 +++++++++++++++++++++++++++ install.ins | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ remove.ins | 31 +++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 control create mode 100644 install.ins create mode 100644 remove.ins diff --git a/control b/control new file mode 100644 index 0000000..f8fbcca --- /dev/null +++ b/control @@ -0,0 +1,29 @@ +[Product] +type: localboot +id: mdg-visual-studio-code +name: MDG Visual Studio Code +description: VSCode ist eine von Microsoft entwickelte, weit verbreitete Entwicklungsumgebung mit Unterstützung für eine Vielzahl an Erweiterungen. Der Großteil des Programms ist quelloffen. +advice: Erweiterungen werden im Verzeichnes %USERPROFILE%\.vscode\extensions und somit im Windows-Profil des Nutzers installiert. +version: 1.50.1 +packageVersion: 1.0 +setupScript: install.ins +uninstallScript: remove.ins + +[ProductDependency] +action: setup +requiredProduct: microsoft-dot-net-framework +requiredStatus: installed +requirementType: before + +[ProductProperty] +name: desktopshortcut +type: bool +description: Verknüpfung auf dem Windows Desktop erstellen +default: False + +[ProductProperty] +name: contextmenuentry +type: bool +description: Windows-Explorer Kontextmenüeintrag erstellen +helptext: Dieser Kontextmenüeintrag wird für Dateien und Ordner im Windows-Explorer erzeugt. +default: False diff --git a/install.ins b/install.ins new file mode 100644 index 0000000..b6da981 --- /dev/null +++ b/install.ins @@ -0,0 +1,57 @@ +[Initial] +Message=Installiere MDG Visual Studio Code... +DefVar $Version$ +DefVar $ExitCode$ +DefVar $CreateContextMenuEntry$ +DefVar $ContextMenuArguments$ +DefVar $CreateDesktopShortcut$ +DefVar $DesktopShortcutArgument$ + +[Aktionen] +ShowBitmap "%ScriptPath%\logo.png" "MDG Visual Studio Code" +Sub_GetProperties +Sub_ConfigureProperties +Sub_PrepareInstall +WinBatch_Setup +Sub_HandleExitCode + +[Sub_GetProperties] +Set $Version$ = GetValue("productversion", GetProductMap) +Set $CreateContextMenuEntry$ = GetProductProperty("contextmenuentry", "false") +Set $CreateDesktopShortcut$ = GetProductProperty("desktopshortcut", "false") + +[Sub_ConfigureProperties] +if ($CreateContextMenuEntry$ = "true") + Set $ContextMenuArguments$ = ", addcontextmenufiles, addcontextmenufolders" +else + Set $ContextMenuArguments$ = ", !addcontextmenufiles, !addcontextmenufolders" +endif + +if ($CreateDesktopShortcut$ = "true") + Set $DesktopShortcutArgument$ = ", desktopicon" +else + Set $DesktopShortcutArgument$ = ", !desktopicon" +endif + +[Sub_PrepareInstall] +if (processIsRunning("Code.exe")) + comment "Killing Process..." + Killtask "Code.exe" + sleepSeconds 3 +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 + +[Sub_HandleExitCode] +; check return code +Set $ExitCode$ = GetLastExitCode +comment "GetLastExitCode: " + $ExitCode$ +if not($ExitCode$ = "0") + LogError "Fatal: setup returned exit code " + $ExitCode$ + IsFatalError +endif diff --git a/remove.ins b/remove.ins new file mode 100644 index 0000000..8c22542 --- /dev/null +++ b/remove.ins @@ -0,0 +1,31 @@ +[Initial] +Message=Deinstalliere MDG Visual Studio Code... +DefVar $ExitCode$ + +[Aktionen] +ShowBitmap "%ScriptPath%\logo.png" "MDG Visual Studio Code" +Sub_PrepareRemove +WinBatch_Setup +Sub_HandleExitCode + +[Sub_PrepareRemove] +if (processIsRunning("Code.exe")) + comment "Killing Process..." + Killtask "Code.exe" + sleepSeconds 3 +endif + +[WinBatch_Setup] +"%ProgramFiles64Dir%\Microsoft VS Code\unins000.exe" /VERYSILENT /SUPPRESSMSGBOXES /LOG="%opsiLogDir%\vscode-uninstall.log" + +; VERYSILENT unterdrückt das Installationsfenster +; SUPPRESSMSGBOXES unterdrückt Benachrichtigungsfenster + +[Sub_HandleExitCode] +; check return code +Set $ExitCode$ = GetLastExitCode +comment "GetLastExitCode: " + $ExitCode$ +if not($ExitCode$ = "0") + LogError "Fatal: setup returned exit code " + $ExitCode$ + IsFatalError +endif