summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsteban de la Canal <estebandlc@google.com>2015-04-14 22:25:05 +0000
committerEsteban de la Canal <estebandlc@google.com>2015-04-14 22:25:05 +0000
commit1a7d4eb4c09959b76e642b83a1afde31e9f71e3b (patch)
treed79dc42fc24fc1d8ba51004af09ba928814918c6
parent17049c8a845e6e65a8a369634717a44abc640220 (diff)
downloadidea-1a7d4eb4c09959b76e642b83a1afde31e9f71e3b.tar.gz
Revert "AS Installer: Simplified SDK input defines"
This reverts commit 17049c8a845e6e65a8a369634717a44abc640220. Change-Id: Ife0474610ba9646c7f9bb74a6e1a1e4b065ecd71
-rw-r--r--native/installer/win/setup_android_studio.nsi50
1 files changed, 30 insertions, 20 deletions
diff --git a/native/installer/win/setup_android_studio.nsi b/native/installer/win/setup_android_studio.nsi
index 7f2d67ad3ed..28919bf13c8 100644
--- a/native/installer/win/setup_android_studio.nsi
+++ b/native/installer/win/setup_android_studio.nsi
@@ -17,16 +17,15 @@
# This script relies on the Unicode install of NSIS. If you use vanilla NSIS,
# this script won't compile. http://www.scratchpaper.com/
-# IMPORTANT: to run this script, the define DIR_SRC must exist and point to an
-# absolute path where a build of Android Studio can be found. This should look
-# like the following:
+# IMPORTANT: to run this script, the defines DIR_SRC and DIR_SDK (if BUNDLE_SDK
+# is set) must exist and point to the absolute path where those components can
+# be found.
#
+# This should look like the following:
# $DIR_SRC\android-studio\
+# $DIR_SDK\android-sdk.7z
#
-# You may also optionally define BUNDLED_SDK, which, if set, must point at a
-# 7-zip file, e.g. C:\data\sdk\android-sdk.7z
-#
-# Keep in mind: If included, an SDK adds ~500MB to the installer's size.
+# DIR_SRC and DIR_SDK can be set to the same location.
# If uncommented, DRY_RUN visits every page but doesn't actually install
# anything.
@@ -40,6 +39,10 @@
# location.
#!define UNINSTALL_BUILDER
+# If uncommented, bundle the SDK with the installer. This adds ~500MB to the
+# installer's size.
+#!define BUNDLE_SDK
+
# If uncommented, bundle the Microsoft redistributables with the installer.
# This is a dependency we hope to remove, eventually, after we rebuild all tool
# exes so they statically link MSVC++ libraries instead of loading them
@@ -64,6 +67,13 @@ Name "${APP_NAME}"
!warning "DIR_SRC should be defined! This script won't work without it."
CompileErrorOnPurpose
!endif
+
+ !ifdef BUNDLE_SDK
+ !ifndef DIR_SDK
+ !warning "DIR_SDK should be defined! This script won't work without it."
+ CompileErrorOnPurpose
+ !endif
+ !endif
!endif
!ifndef UNINSTALL_BUILDER
@@ -373,7 +383,7 @@ Section "Android Studio" SectionStudio
!endif # DRY_RUN && UNINSTALL_BUILDER
SectionEnd
-!ifdef BUNDLED_SDK
+!ifdef BUNDLE_SDK
Section "Android SDK" SectionSdk
# Final size on disk: 2.2+GB. Add size until components page shows 2.3GB
AddSize 1930000
@@ -384,7 +394,7 @@ Section "Android SDK" SectionSdk
SetOverwrite on
SetCompress off
- File "${BUNDLED_SDK}"
+ File "${DIR_SDK}\android-sdk.7z"
SetCompress auto
${If} $s_InstallSdk != 0
@@ -403,7 +413,7 @@ Section "Android SDK" SectionSdk
!endif # DRY_RUN && UNINSTALL_BUILDER
SectionEnd
-!endif # BUNDLED_SDK
+!endif # BUNDLE_SDK
Section "Android Virtual Device" SectionAvd
# Dummy section for AVD creation. We actually don't do anything here but
@@ -606,7 +616,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SectionStudio} \
"The Android developer environment to design and develop your app for \
Android."
-!ifdef BUNDLED_SDK
+!ifdef BUNDLE_SDK
!insertmacro MUI_DESCRIPTION_TEXT ${SectionSdk} \
"The collection of Android platform APIs, tools and utilities that enables \
you to debug, profile, and compile your app."
@@ -797,9 +807,9 @@ Function .onInit
!endif # DRY_RUN
StrCpy $s_StudioPath "${DEFAULT_STUDIO_PATH}"
- !ifdef BUNDLED_SDK
+ !ifdef BUNDLE_SDK
StrCpy $s_SdkPath $s_DefaultSdkPath
- !endif # BUNDLED_SDK
+ !endif # BUNDLE_SDK
# HACK: NSIS always defaults to "Program Files (x86)". However, we provide
# both 32-bit and 64-bit .exes, so we always want to install into
@@ -1088,7 +1098,7 @@ Function fnc_FindJavaPage_Leave
FunctionEnd
Function fnc_AndroidSdkPage_ShowIfNecessary
- !ifndef BUNDLED_SDK
+ !ifndef BUNDLE_SDK
Abort # Skip this page if this installer doesn't bundle an SDK
!endif
@@ -1179,7 +1189,7 @@ FunctionEnd
# Called when entering the Components page.
Function s_ComponentsPagePre
-!ifdef BUNDLED_SDK
+!ifdef BUNDLE_SDK
# Restore the SDK section selection if the user previously expressed
# interest in installing it (and are now coming back to this page).
# See also s_ComponentsPageLeave, which sets the flag.
@@ -1188,14 +1198,14 @@ Function s_ComponentsPagePre
${Else}
${UnselectSection} ${SectionSdk}
${EndIf}
-!endif # BUNDLED_SDK
+!endif # BUNDLE_SDK
FunctionEnd
# Called when leaving the Components page.
Function s_ComponentsPageLeave
-!ifdef BUNDLED_SDK
+!ifdef BUNDLE_SDK
# Minor hack alert: We ALWAYS want to install this installer's SDK, either
# to the directory the user specified, or to a temporary location that
# Android Studio's first run experience can make use of. Therefore, even
@@ -1208,7 +1218,7 @@ Function s_ComponentsPageLeave
${SelectSection} ${SectionSdk}
!else
StrCpy $s_InstallSdk 0
-!endif # BUNDLED_SDK
+!endif # BUNDLE_SDK
SectionGetFlags ${SectionHaxm} $R0
IntOp $s_InstallHaxm $R0 & ${SF_SELECTED}
@@ -1217,9 +1227,9 @@ FunctionEnd
# Called when entering the Android License page.
Function s_AndroidLicensePagePre
- !ifndef BUNDLED_SDK
+ !ifndef BUNDLE_SDK
Abort
- !endif # BUNDLED_SDK
+ !endif # BUNDLE_SDK
${If} $s_SkipAndroidLicense == 1
Abort