From 7491fb77d1a1707ce5cdfbfbd8563816906dd0f5 Mon Sep 17 00:00:00 2001 From: Iristyle Date: Tue, 23 Jul 2013 16:07:44 -0400 Subject: [PATCH] feat: Sublime Text 3 build 3047 - Supports install and uninstall --- SublimeText3/SublimeText3.nuspec | 19 ++++++++++++ SublimeText3/tools/chocolateyInstall.ps1 | 35 ++++++++++++++++++++++ SublimeText3/tools/chocolateyUninstall.ps1 | 26 ++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 SublimeText3/SublimeText3.nuspec create mode 100644 SublimeText3/tools/chocolateyInstall.ps1 create mode 100644 SublimeText3/tools/chocolateyUninstall.ps1 diff --git a/SublimeText3/SublimeText3.nuspec b/SublimeText3/SublimeText3.nuspec new file mode 100644 index 0000000..b547db1 --- /dev/null +++ b/SublimeText3/SublimeText3.nuspec @@ -0,0 +1,19 @@ + + + + SublimeText3 + Sublime Text 3 + 3.0.0.3047 + Jon Skinner + Ethan J. Brown + Sublime Text 3 is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features. + Sublime Text 3 is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features. Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use. + This brings the Sublime Text portable version to your system + http://www.sublimetext.com/3 + http://www.sublimetext.com/3 + sublime text editor st3 + http://www.sublimetext.com/eula + false + https://github.com/Iristyle/ChocolateyPackages/raw/master/SublimeText2.app/Sublime_Text.png + + diff --git a/SublimeText3/tools/chocolateyInstall.ps1 b/SublimeText3/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..9990db2 --- /dev/null +++ b/SublimeText3/tools/chocolateyInstall.ps1 @@ -0,0 +1,35 @@ +$package = 'SublimeText3' +$build = '3047' +$installFolder = 'Sublime Text 3' + +try { + + $installedPath = (Join-Path "${Env:\ProgramFiles(x86)}" $installFolder), + (Join-Path $Env:ProgramFiles $installFolder) | + ? { Test-Path $_ } | + Select -First 1 + + # only way to test for installation of this version is by path on disk + if ($installedPath -and (Test-Path $installedPath)) + { + Write-Host "$package is already installed to $installedPath" + } + else + { + $params = @{ + PackageName = $package; + FileType = 'exe'; + #uses InnoSetup - http://www.jrsoftware.org/ishelp/index.php?topic=setupcmdline + SilentArgs = '/VERYSILENT /NORESTART /TASKS="contextentry"'; + Url = "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%20$build%20Setup.exe"; + Url64Bit = "http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%20Build%20$build%20x64%20Setup.exe"; + } + + Install-ChocolateyPackage @params + } + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/SublimeText3/tools/chocolateyUninstall.ps1 b/SublimeText3/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..249f30d --- /dev/null +++ b/SublimeText3/tools/chocolateyUninstall.ps1 @@ -0,0 +1,26 @@ +$package = 'SublimeText3' +$installFolder = 'Sublime Text 3' + +try { + + $path = ${Env:ProgramFiles(x86)}, $Env:ProgramFiles | + % { Join-Path $_ $installFolder } | + ? { Test-Path $_ } | + Select -First 1 + + if ($path) + { + Push-Location $path + $uninstaller = '.\unins000.exe' + if (Test-Path $uninstaller) + { + $unargs = '/silent', '/verysilent', '/suppressmsgboxes', '/norestart' + &$uninstaller $unargs + } + } + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +}