Files
ChocolateyPackages/AndroidStudio/tools/chocolateyInstall.ps1
Nick Smith 1241d70fb2 feat: release AndroidStudio 0.2.130.737825
- will attempt to uninstall 0.1.x if it's found
 see updating instructions here that warn of issues installing over top
 http://developer.android.com/sdk/installing/studio.html
2013-07-23 19:42:39 -04:00

37 lines
948 B
PowerShell

$package = 'AndroidStudio'
$version = 130.737825
try {
$build = Join-Path $Env:LOCALAPPDATA 'Android\android-studio\build.txt'
if ((Test-Path $build) -and ((Get-Content $build) -match '.*?(\d+\.\d+)'))
{
$installedVersion = [decimal]$Matches[1]
if ($installedVersion -lt $version)
{
Write-Host "Uninstalling existing version $installedVersion"
. .\chocolateyUninstall.ps1
$params = @{
PackageName = $package;
FileType = 'exe';
#uses NSIS installer - http://nsis.sourceforge.net/Docs/Chapter3.html
SilentArgs = '/S';
Url = 'http://dl.google.com/android/studio/android-studio-bundle-130.737825-windows.exe';
}
Install-ChocolateyPackage @params
}
else
{
Write-Host "$package $installedVersion already installed!"
}
}
Write-ChocolateySuccess $package
} catch {
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}