Skip to content

Commit

Permalink
Merge pull request #1031 from chocolatey/vscode
Browse files Browse the repository at this point in the history
(visualstudiocode) name changed to vscode and refactored
  • Loading branch information
majkinetor committed May 13, 2018
2 parents 14780e7 + f5cbd85 commit 3794c7d
Show file tree
Hide file tree
Showing 9 changed files with 190 additions and 0 deletions.
28 changes: 28 additions & 0 deletions automatic/vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# <img src="https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/db78e656a60aca25d4faddbe60721094609b846f/icons/visualstudiocode.png" width="48" height="48"/> [vscode](https://chocolatey.org/packages/vscode)


Build and debug modern web and cloud applications. Code is free and available on your favorite platform - Linux, Mac OSX, and Windows.

## Features

* **Meet IntelliSense:** Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
* **Print statement debugging is a thing of the past:** Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
* **Git commands built-in:** Working with Git has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted Git service.
* **Extensible and customizable:** Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won't slow down your editor.

## Package parameters

* `/NoDesktopIcon` - Don't add a desktop icon.
* `/NoQuicklaunchIcon` - Don't add an icon to the QuickLaunch area.
* `/NoContextMenuFiles` - Don't add an _Open with Code_ entry to the context menu for files.
* `/NoContextMenuFolders` - Dont't add an _Open with Code_ entry to the context menu for folders.
* `/DontAddToPath` - Don't add Visual Studio Code to the system PATH.

## Notes

* The package uses default install options except that it adds context menu entries and Visual Studio Code isn't started after installation.
* For disabling the auto-update functionality see the [Visual Studio Code Auto Update Deactivation package](https://chocolatey.org/packages/visualstudiocode-disableautoupdate).


![screenshot](https://rawgit.com/chocolatey/chocolatey-coreteampackages/master/automatic/vscode/screenshot.png)

Binary file added automatic/vscode/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions automatic/vscode/tools/ChocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$ErrorActionPreference = 'Stop'

$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
. $toolsPath\helpers.ps1

$pp = Get-PackageParameters
Close-VSCode

$packageArgs = @{
packageName = 'vscode'
fileType = 'exe'
url = 'https://az764295.vo.msecnd.net/stable/d0182c3417d225529c6d5ad24b7572815d0de9ac/VSCodeSetup-ia32-1.23.1.exe'
url64bit = 'https://az764295.vo.msecnd.net/stable/d0182c3417d225529c6d5ad24b7572815d0de9ac/VSCodeSetup-x64-1.23.1.exe'

softwareName = 'Microsoft Visual Studio Code'

checksum = '0c8cfd65f9303ddbfa76277123eacc869b7e33c47642f5a33d3de5edb661a98a'
checksumType = 'sha256'
checksum64 = 'e93b72baedf6fc1234e1da751b03d67631e150f4d93573db83c9f205b632e0bd'
checksumType64 = 'sha256'

silentArgs = '/verysilent /suppressmsgboxes /mergetasks="{0}" /log="{1}\install.log"' -f (Get-MergeTasks), (Get-PackageCacheLocation)
validExitCodes = @(0, 3010, 1641)
}

Install-ChocolateyPackage @packageArgs
17 changes: 17 additions & 0 deletions automatic/vscode/tools/helpers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function Get-MergeTasks {
$t = "!runCode"
$t += ', ' + '!'*$pp.NoDesktopIcon + 'desktopicon'
$t += ', ' + '!'*$pp.NoQuicklaunchIcon + 'quicklaunchicon'
$t += ', ' + '!'*$pp.NoContextMenuFiles + 'addcontextmenufiles'
$t += ', ' + '!'*$pp.NoContextMenuFolders + 'addcontextmenufolders'
$t += ', ' + '!'*$pp.DontAddToPath + 'addtopath'

Write-Host "Merge Tasks: $t"
$t
}

function Close-VSCode {
Get-Process code -ea 0 | ForEach-Object { $_.CloseMainWindow() | Out-Null }
Start-Sleep 1
Get-Process code -ea 0 | Stop-Process #in case gracefull shutdown did not succeed, try hard kill
}
34 changes: 34 additions & 0 deletions automatic/vscode/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import-module au
import-module "$PSScriptRoot\..\..\extensions\chocolatey-core.extension\extensions\chocolatey-core.psm1"

$releases32 = 'https://vscode-update.azurewebsites.net/api/update/win32/stable/VERSION'
$releases64 = 'https://vscode-update.azurewebsites.net/api/update/win32-x64/stable/VERSION'

function global:au_SearchReplace {
@{
'tools\chocolateyInstall.ps1' = @{
"(?i)(^\s*packageName\s*=\s*)('.*')" = "`$1'$($Latest.PackageName)'"
"(?i)(^\s*url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(?i)(^\s*url64bit\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(?i)(^\s*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(?i)(^\s*checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
}
}
}

function global:au_GetLatest {
$json32 = Invoke-WebRequest -UseBasicParsing -Uri $releases32 | ConvertFrom-Json
$json64 = Invoke-WebRequest -UseBasicParsing -Uri $releases64 | ConvertFrom-Json

if ($json32.productVersion -ne $json64.productVersion) {
throw "Different versions for 32-Bit and 64-Bit detected."
}

@{
Version = $json32.productVersion
URL32 = $json32.Url
URL64 = $json64.Url
}
}

update
56 changes: 56 additions & 0 deletions automatic/vscode/vscode.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>vscode</id>
<title>Visual Studio Code</title>
<version>1.23.1.20180513</version>
<authors>Microsoft</authors>
<owners>chocolatey</owners>
<projectUrl>https://code.visualstudio.com</projectUrl>
<projectSourceUrl>https://github.com/Microsoft/vscode</projectSourceUrl>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/vscode</packageSourceUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/db78e656a60aca25d4faddbe60721094609b846f/icons/vscode.png</iconUrl>
<licenseUrl>https://code.visualstudio.com/License</licenseUrl>
<docsUrl>https://code.visualstudio.com/docs</docsUrl>
<bugTrackerUrl>https://github.com/Microsoft/vscode/issues</bugTrackerUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>Visual Studio Code</summary>
<description><![CDATA[
Build and debug modern web and cloud applications. Code is free and available on your favorite platform - Linux, Mac OSX, and Windows.
## Features
* **Meet IntelliSense:** Go beyond syntax highlighting and autocomplete with IntelliSense, which provides smart completions based on variable types, function definitions, and imported modules.
* **Print statement debugging is a thing of the past:** Debug code right from the editor. Launch or attach to your running apps and debug with break points, call stacks, and an interactive console.
* **Git commands built-in:** Working with Git has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted Git service.
* **Extensible and customizable:** Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won't slow down your editor.
## Package parameters
* `/NoDesktopIcon` - Don't add a desktop icon.
* `/NoQuicklaunchIcon` - Don't add an icon to the QuickLaunch area.
* `/NoContextMenuFiles` - Don't add an _Open with Code_ entry to the context menu for files.
* `/NoContextMenuFolders` - Dont't add an _Open with Code_ entry to the context menu for folders.
* `/DontAddToPath` - Don't add Visual Studio Code to the system PATH.
## Notes
* The package uses default install options except that it adds context menu entries and Visual Studio Code isn't started after installation.
* For disabling the auto-update functionality see the [Visual Studio Code Auto Update Deactivation package](https://chocolatey.org/packages/visualstudiocode-disableautoupdate).
![screenshot](https://rawgit.com/chocolatey/chocolatey-coreteampackages/master/automatic/vscode/screenshot.png)
]]></description>
<tags>microsoft visualstudiocode vscode development editor ide javascript typescript admin foss cross-platform</tags>
<dependencies>
<dependency id="chocolatey-core.extension" version="1.3.3" />
<dependency id="dotnet4.5.2" version="4.5.2.20140902" />
</dependencies>
<releaseNotes>https://code.visualstudio.com/Updates</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write-Host "This package is deprecated due to name change to vscode"
28 changes: 28 additions & 0 deletions deprecated/packages/visualstudiocode/visualstudiocode.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>visualstudiocode</id>
<title>[Deprecated] Visual Studio Code</title>
<version>1.23.1</version>
<authors>Microsoft</authors>
<owners>chocolatey</owners>
<projectUrl>https://code.visualstudio.com</projectUrl>
<projectSourceUrl>https://github.com/Microsoft/vscode</projectSourceUrl>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/tree/master/automatic/visualstudiocode</packageSourceUrl>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/db78e656a60aca25d4faddbe60721094609b846f/icons/visualstudiocode.png</iconUrl>
<licenseUrl>https://code.visualstudio.com/License</licenseUrl>
<docsUrl>https://code.visualstudio.com/docs</docsUrl>
<bugTrackerUrl>https://github.com/Microsoft/vscode/issues</bugTrackerUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>Visual Studio Code</summary>
<description>**Deprecated because of the name change to vscode**.</description>
<tags>microsoft visualstudiocode vscode development editor ide javascript typescript admin foss cross-platform</tags>
<dependencies>
<dependency id="vscode" />
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
File renamed without changes

0 comments on commit 3794c7d

Please sign in to comment.