feat: Sublime Text 3 build 3047

- Supports install and uninstall
This commit is contained in:
Iristyle
2013-07-23 16:07:44 -04:00
parent d04d12b52b
commit 7491fb77d1
3 changed files with 80 additions and 0 deletions

View File

@@ -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
}

View File

@@ -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
}