Skip to content

Commit

Permalink
Update Android Studio installer 2017.1
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Mason <jacob@jacobmason.net>
  • Loading branch information
JacobAMason committed Jun 14, 2017
1 parent 926a8c4 commit d2f0e83
Show file tree
Hide file tree
Showing 15 changed files with 134 additions and 374 deletions.
14 changes: 7 additions & 7 deletions Android-Studio/AndroidStudioDevSuite.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,19 @@ Var JAVA_INSTALL_DESC
;--------------------------------
;Installer Sections

!include JavaSDK.8u92.nsh
!include JavaSDK.nsh
!include AndroidStudio.2.nsh
!include AndroidSDK.nsh
!include FTCapp.${INSTALL_TYPE}.nsh
!if ${INSTALL_TYPE} == "Full"
!include Gradle.nsh
!endif

;--------------------------------
;Initialize

Function .onInit
SetRegView 64
ReadEnvStr $SYSTEMDRIVE "SYSTEMDRIVE"

!insertmacro CheckJavaVersion
Expand All @@ -120,19 +124,15 @@ FunctionEnd
;--------------------------------
;Launch Android Studio
Function LaunchAndroidStudio
${If} ${RunningX64}
Exec "$PROGRAMFILES64\Android\Android Studio\bin\studio64.exe"
${Else}
Exec "$PROGRAMFILES\Android\Android Studio\bin\studio.exe"
${EndIf}
Exec "$PROGRAMFILES64\Android\Android Studio\bin\studio64.exe"
FunctionEnd

;--------------------------------
;Descriptions

;Language strings
LangString DESC_JavaSDK ${LANG_ENGLISH} $JAVA_INSTALL_DESC
LangString DESC_AndroidStudio ${LANG_ENGLISH} "Installs Android Studio 2.1.3"
LangString DESC_AndroidStudio ${LANG_ENGLISH} "Installs Android Studio 2.3.3"
LangString DESC_AndroidSDK ${LANG_ENGLISH} "Installs the proper SDK and API tools. You probably need this."
!if ${INSTALL_TYPE} == "Full"
LangString DESC_FTCapp ${LANG_ENGLISH} "Installs a copy of the FIRST Tech Challenge App"
Expand Down
19 changes: 10 additions & 9 deletions Android-Studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ This "suite" is really just a Windows-specific installer built with [NSIS]([http

### What does this set up for me?

- [Java 8 (JDK and JRE 1.8.0_92)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- [Android Studio 2.1.2](https://sites.google.com/a/android.com/tools/download/studio/builds/android-studio-2-1-2)
- Android SDK Tools 24.4.1 which includes the following:
- Platform Tools (23.1 or latest)
- Android API 19 - SDK Platform
- Build Tools 21.1.2
- Google USB Driver (11 or latest)
- FTC Robot Controller beta source code(latest at compile<sup>[1](#latest-at-compile)</sup>)
- [Java 8 (JDK and JRE 1.8.0)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- [Android Studio 2.3.0](https://developer.android.com/studio/index.html)
- Android SDK Tools which includes the following:
- Platform Tools
- Android API 19 (for the ZTE Speed)
- Android API 23 (for the MotoG)
- Build Tools 23.0.3
- Google USB Driver
- ftc_app source code(latest at compile<sup>[1](#latest-at-compile)</sup>)

### Which installer should I use?
**Full Installer**
Expand All @@ -30,4 +31,4 @@ If you want to use this installer to guarantee that you've set up your personal
If you have have issues with the installer either [email me](mailto:jacob@jacobmason.net) or, preferably, [open an issue](https://github.com/JacobAMason/FTCDevSuite/issues/new).


<a name="latest-at-compile">1</a>: The version of ftc_app that installs when running the Net installer is the latest version on the beta branch of the official repository. However, the version of ftc_app in the Full installer is the latest version on the beta branch *at the time the installer was* ***first*** *compiled*.
<a name="latest-at-compile">1</a>: The version of ftc_app that installs when running the Net installer is the latest version on the beta branch of the official repository. However, the version of ftc_app in the Full installer is the latest version on the beta branch *at the time the installer was* ***first*** *compiled*. If you are getting your download from the releases page, the release notes will say what version of the ftc_app is included with the Full build.
2 changes: 1 addition & 1 deletion Android-Studio/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2016.3
2017.1
2 changes: 1 addition & 1 deletion App-Inventor/AppInventorDevSuite.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Var PYTHON_PATH
;--------------------------------
;Installer Sections

!include JavaSDK.7u80.nsh
!include JavaSDK.nsh
!include Firefox.${INSTALL_TYPE}.nsh
!include AndroidSDK.nsh
!include Ant.${INSTALL_TYPE}.nsh
Expand Down
6 changes: 3 additions & 3 deletions buildtools/build-android-studio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Write-Color -Text "Checking Dependencies" -Color "magenta"
."..\buildtools\build-common.ps1"

echo ""
$localfile = "android-studio-ide-143.3101438-windows.exe"
download-file "Android Studio 2.1.3.0" $localfile "https://dl.google.com/dl/android/studio/install/2.1.3.0/android-studio-ide-143.3101438-windows.exe"
check-hash $sha1 $localfile "43-F8-4D-E7-E6-1F-37-88-0A-12-6C-3D-56-7B-7F-A6-CB-90-C9-0E" "Android Studio"
$localfile = "android-studio-ide-162.4069837-windows.exe"
download-file "Android Studio 2.2.3.0" $localfile "https://dl.google.com/dl/android/studio/install/2.3.3.0/android-studio-ide-162.4069837-windows.exe"
check-hash $sha256 $localfile "F0-B7-24-73-CB-94-BA-4B-CB-C8-0E-EB-84-F4-B5-33-64-DA-09-7E-FA-25-5F-7C-AB-71-BC-B1-0A-28-77-5A" "Android Studio"

echo ""
$localfile = "ftc_app.zip"
Expand Down
67 changes: 15 additions & 52 deletions buildtools/build-common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,30 @@ $ErrorActionPreference = "Stop"
Set-Location -literalPath "..\data"

echo ""
$localfile = "jdk-7u80-windows-i586.exe"
if (!(Test-Path $localfile)) {
Write-Color -Text "Couldn't find Java 7 SDK x86. Downloading it now: please wait." -Color "yellow"
$client.Headers.Add("Cookie: oraclelicense=accept-securebackup-cookie")
$client.DownloadFile("http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-windows-i586.exe", (Get-Location).Path + "\" + $localfile)
} else {
Write-Color -Text "Java 7 SDK x86 found" -Color "green"
}
check-hash $md5 $localfile "8C-6C-88-89-93-14-4F-DB-DE-C6-F5-D4-E1-9B-57-A3" "Java 7 SDK x86"

echo ""
$localfile = "jdk-7u80-windows-x64.exe"
if (!(Test-Path $localfile)) {
Write-Color -Text "Couldn't find Java 7 SDK x64. Downloading it now: please wait." -Color "yellow"
$client.Headers.Add("Cookie: oraclelicense=accept-securebackup-cookie")
$client.DownloadFile("http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-windows-x64.exe", (Get-Location).Path + "\" + $localfile)
} else {
Write-Color -Text "Java 7 SDK x64 found" -Color "green"
}
check-hash $md5 $localfile "49-9B-22-4F-4D-A7-03-12-DD-D4-7C-48-24-E8-3A-DC" "Java 7 SDK x64"

echo ""
$localfile = "jdk-8u92-windows-i586.exe"
if (!(Test-Path $localfile)) {
Write-Color -Text "Couldn't find Java 8 SDK x86. Downloading it now: please wait." -Color "yellow"
$client.Headers.Add("Cookie: oraclelicense=accept-securebackup-cookie")
$client.DownloadFile("http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-windows-i586.exe", (Get-Location).Path + "\" + $localfile)
} else {
Write-Color -Text "Java 8 SDK x86 found" -Color "green"
}
check-hash $sha256 $localfile "9E-5D-DC-BF-9F-6C-96-7D-38-F0-BF-B6-D6-02-09-58-74-F2-9E-61-17-92-9C-7C-F1-20-6F-56-1F-AF-DF-30" "Java 8 SDK x86"

echo ""
$localfile = "jdk-8u92-windows-x64.exe"
$localfile = "jdk-8u131-windows-x64.exe"
if (!(Test-Path $localfile)) {
Write-Color -Text "Couldn't find Java 8 SDK x64. Downloading it now: please wait." -Color "yellow"
$client.Headers.Add("Cookie: oraclelicense=accept-securebackup-cookie")
$client.DownloadFile("http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-windows-x64.exe", (Get-Location).Path + "\" + $localfile)
$client.DownloadFile("http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-windows-x64.exe", (Get-Location).Path + "\" + $localfile)
} else {
Write-Color -Text "Java 8 SDK x64 found" -Color "green"
}
check-hash $sha256 $localfile "15-2E-B6-62-E7-ED-E5-96-6D-FB-42-B2-B7-DF-A3-BA-6D-78-4E-AF-B3-F6-ED-22-02-39-97-F3-03-16-BD-D1" "Java 8 SDK x64"

echo ""
$localfile = "installer_r24.4.1-windows.exe"
download-file "Android SDK Exe Installer" $localfile "http://dl.google.com/android/installer_r24.4.1-windows.exe"
check-hash $sha1 $localfile "F9-B5-9D-72-41-36-49-D3-1E-63-32-07-E3-1F-45-64-43-E7-EA-0B" "Android SDK Exe Installer"
check-hash $sha512 $localfile "5C-F7-87-E3-51-07-52-6B-1C-95-1E-2C-A3-73-06-29-98-10-E0-2A-A5-EA-17-87-28-E9-3A-A7-40-C6-D9-65-77-11-B5-08-04-9A-D1-72-08-D0-82-AF-59-5D-31-1F-FB-1B-18-82-87-6E-89-44-BF-D6-25-61-3A-02-FC-68" "Java 8 SDK x64"

echo ""
$localfile = "android-sdk_r24.4.1-windows.zip"
download-file "Android SDK Zip" $localfile "http://dl.google.com/android/android-sdk_r24.4.1-windows.zip"
check-hash $sha1 $localfile "66-B6-A6-43-30-53-C1-52-B2-2B-F8-CA-B1-9C-0F-3F-EF-4E-BA-49" "Android SDK Zip"
$localfile = "sdk-tools-windows-3859397.zip"
download-file "Android SDK Zip" $localfile "https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip"
check-hash $sha512 $localfile "5F-B7-3A-99-4D-D7-B1-25-C9-63-EC-8E-19-35-38-C2-B0-C5-94-32-E9-91-11-2F-62-EB-D7-30-8B-B0-E7-9B-87-3A-B7-EC-65-3F-15-25-54-01-BB-55-00-C1-1A-D2-E6-C6-89-4B-F5-46-FC-C4-43-12-2B-52-74-09-DA-24" "Android SDK Zip"

$localfile = "android-sdk\tools\android.bat"
$localfile = "android-sdk\tools\bin\sdkmanager.bat"
if (!(Test-Path $localfile)) {
Write-Color -Text "Not sure if the zip is extracted. Doing that now..." -Color "yellow"
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace((Get-Location).Path + "\android-sdk_r24.4.1-windows.zip")
$zipPackage = $shellApplication.NameSpace((Get-Location).Path + "\sdk-tools-windows-3859397.zip")
$destinationFolder = $shellApplication.NameSpace((Get-Location).Path)
New-Item -ItemType directory -Path ".\android-sdk" | out-null
$destinationFolder.CopyHere($zipPackage.items(), 20)
Rename-Item "$((Get-Location).Path)\android-sdk-windows" "android-sdk"
Move-Item ".\tools" ".\android-sdk\tools"
} else {
Write-Color -Text "Zip appears to have already been extracted" -Color "green"
}
Expand All @@ -74,23 +37,23 @@ echo ""
Write-Color -Text "Checking SDK Tools and APIs" -Color "magenta"
if (!(Test-Path "android-sdk\build-tools\23.0.3\")) {
Write-Color -Text "Downloading build-tools-23.0.3 ..." -Color "yellow"
echo y | & ".\android-sdk\tools\android.bat" --silent update sdk --all --no-ui --filter "build-tools-23.0.3" | out-null
echo y| & ".\android-sdk\tools\bin\sdkmanager.bat" "build-tools;23.0.3" | out-null
}
if (!(Test-Path "android-sdk\extras\google\usb_driver\")) {
Write-Color -Text "Downloading extra-google-usb_driver ..." -Color "yellow"
echo y | & ".\android-sdk\tools\android.bat" --silent update sdk --all --no-ui --filter "extra-google-usb_driver" | out-null
echo y| & ".\android-sdk\tools\bin\sdkmanager.bat" "extras;google;usb_driver" | out-null
}
if (!(Test-Path "android-sdk\platforms\android-19\")) {
Write-Color -Text "Downloading android-19 ..." -Color "yellow"
echo y | & ".\android-sdk\tools\android.bat" --silent update sdk --all --no-ui --filter "android-19" | out-null
echo y| & ".\android-sdk\tools\bin\sdkmanager.bat" "platforms;android-19" | out-null
}
if (!(Test-Path "android-sdk\platforms\android-23\")) {
Write-Color -Text "Downloading android-23 ..." -Color "yellow"
echo y | & ".\android-sdk\tools\android.bat" --silent update sdk --all --no-ui --filter "android-23" | out-null
echo y| & ".\android-sdk\tools\bin\sdkmanager.bat" "platforms;android-23" | out-null
}
if (!(Test-Path "android-sdk\platform-tools\api")) {
Write-Color -Text "Downloading platform-tools ..." -Color "yellow"
echo y | & ".\android-sdk\tools\android.bat" --silent update sdk --all --no-ui --filter "platform-tools" | out-null
echo y| & ".\android-sdk\tools\bin\sdkmanager.bat" "platform-tools" | out-null
}
Write-Color -Text "All SDK and API dependencies present and accounted for" -Color "green"

30 changes: 12 additions & 18 deletions common-NSIS/AndroidSDK.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,29 @@ Section "Android SDK" AndroidSDK
!if ${INSTALL_TYPE} == "Net"

inetc::get /WEAKSECURITY /NOCOOKIES /RESUME "" \
/caption "Android SDK 24.4.1" \
"http://dl.google.com/android/android-sdk_r24.4.1-windows.zip" \
"$TEMP\android-sdk_r24.4.1-windows.zip" /end
Crypto::HashFile "SHA1" "$TEMP\android-sdk_r24.4.1-windows.zip"
/caption "Android SDK" \
"https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip" \
"$TEMP\sdk-tools-windows-3859397.zip" /end
Crypto::HashFile "SHA2-512" "$TEMP\sdk-tools-windows-3859397.zip"
Pop $0
${If} "66B6A6433053C152B22BF8CAB19C0F3FEF4EBA49" == $0
DetailPrint "SHA1 hash for Android SDK 24.4.1 is good"
${If} "5FB73A994DD7B125C963EC8E193538C2B0C59432E991112F62EBD7308BB0E79B873AB7EC653F15255401BB5500C11AD2E6C6894BF546FCC443122B527409DA24" == $0
DetailPrint "SHA512 hash for Android SDK is good"
${OrIf} "OK" == $0
DetailPrint "Successfully downloaded Android SDK 24.4.1"
DetailPrint "Installing Android SDK 24.4.1"
ZipDLL::extractall "$TEMP\android-sdk_r24.4.1-windows.zip" "$SYSTEMDRIVE"
Rename "$SYSTEMDRIVE\android-sdk-windows" "$SYSTEMDRIVE\android-sdk"
DetailPrint "Successfully downloaded Android SDK"
DetailPrint "Installing Android SDK"
ZipDLL::extractall "$TEMP\sdk-tools-windows-3859397.zip" "$SYSTEMDRIVE\android-sdk\"
Rename "$SYSTEMDRIVE\sdk-tools-windows-3859397" "$SYSTEMDRIVE\android-sdk\tools"
${Else}
Abort "Android SDK 24.4.1 SHA1 didn't match [$0]"
Abort "Android SDK SHA512 didn't match [$0]"
${EndIf}
Delete "$TEMP\android-sdk_r24.4.1-windows.zip"
Delete "$TEMP\sdk-tools-windows-3859397.zip"

!endif
!if ${INSTALL_TYPE} == "Full"
SetOutPath "$SYSTEMDRIVE\android-sdk"
File "..\data\android-sdk\AVD Manager.exe"
File "..\data\android-sdk\SDK Manager.exe"
File "..\data\android-sdk\SDK Readme.txt"
File /r "..\data\android-sdk\tools"
!endif

${If} ${RunningX64}
SetRegView 64
${EndIf}
WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "ANDROID_HOME" "$SYSTEMDRIVE\android-sdk"
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
System::Call 'Kernel32::SetEnvironmentVariable(t, t)i ("ANDROID_HOME", "$SYSTEMDRIVE\android-sdk").r0'
Expand Down
16 changes: 0 additions & 16 deletions common-NSIS/AndroidStudio.1.Full.nsh

This file was deleted.

28 changes: 0 additions & 28 deletions common-NSIS/AndroidStudio.1.Net.nsh

This file was deleted.

32 changes: 14 additions & 18 deletions common-NSIS/AndroidStudio.2.nsh
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
Section "Android Studio" AndroidStudio
AddSize 290846
AddSize 473299
SetOutPath "$TEMP"

!if ${INSTALL_TYPE} == "Net"

inetc::get /WEAKSECURITY /NOCOOKIES /RESUME "" \
/caption "Android Studio 2.1.3.0" \
"https://dl.google.com/dl/android/studio/install/2.1.3.0/android-studio-ide-143.3101438-windows.exe" \
"$TEMP\android-studio-ide-143.3101438-windows.exe" /end
Crypto::HashFile "SHA1" "$TEMP\android-studio-ide-143.3101438-windows.exe"
/caption "Android Studio 2.3.3.0" \
"https://dl.google.com/dl/android/studio/install/2.3.3.0/android-studio-ide-162.4069837-windows.exe" \
"$TEMP\android-studio-ide-162.4069837-windows.exe" /end
Crypto::HashFile "SHA2-256" "$TEMP\android-studio-ide-162.4069837-windows.exe"
Pop $0
${If} "43F84DE7E61F37880A126C3D567B7fA6CB90C90E" == $0
DetailPrint "SHA1 hash for Android Studio 2.1.3.0 is good"
${If} "F0B72473CB94BA4BCBC80EEB84F4B53364DA097EFA255F7CAB71BCB10A28775A" == $0
DetailPrint "SHA256 hash for Android Studio 2.3.3.0 is good"
${OrIf} "OK" == $0
DetailPrint "Successfully downloaded Android Studio 2.1.3.0"
ExecWait '"$TEMP\android-studio-ide-143.3101438-windows.exe" /S'
DetailPrint "Successfully downloaded Android Studio 2.3.3.0"
ExecWait '"$TEMP\android-studio-ide-162.4069837-windows.exe" /S'
${Else}
Abort "Android Studio 2.1.3.0 SHA1 didn't match [$0]"
Abort "Android Studio 2.3.3.0 SHA256 didn't match [$0]"
${EndIf}

!endif
!if ${INSTALL_TYPE} == "Full"

File "..\data\android-studio-ide-143.3101438-windows.exe"
ExecWait '"$TEMP\android-studio-ide-143.3101438-windows.exe" /S'
File "..\data\android-studio-ide-162.4069837-windows.exe"
ExecWait '"$TEMP\android-studio-ide-162.4069837-windows.exe" /S'

!endif

Delete "$TEMP\android-studio-ide-143.3101438-windows.exe"
${If} ${RunningX64}
FileOpen $0 "$PROGRAMFILES64\Android\Android Studio\bin\idea.properties" a
${Else}
FileOpen $0 "$PROGRAMFILES\Android\Android Studio\bin\idea.properties" a
${EndIf}
Delete "$TEMP\android-studio-ide-162.4069837-windows.exe"
FileOpen $0 "$PROGRAMFILES64\Android\Android Studio\bin\idea.properties" a
FileSeek $0 0 END
FileWrite $0 "disable.android.first.run=true"
FileClose $0
Expand Down
Loading

0 comments on commit d2f0e83

Please sign in to comment.