forked from toksaitov/AndroidStudioPortable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart-AndroidStudioPortable.ps1
More file actions
51 lines (39 loc) · 949 Bytes
/
Start-AndroidStudioPortable.ps1
File metadata and controls
51 lines (39 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#Requires -Version 2.0
<#
.SYNOPSIS
Sets environment variables to local directories and starts
the Android Studio.
#>
#
# Definitions
#
. '.\AndroidStudioPortable-Definitions.ps1'
#
# Helpers
#
. '.\AndroidStudioPortable-Helpers.ps1'
#
# Set environment variables.
#
$env:HOMEPATH =
Expand-Path -Path $PortableHomeDirectory
$env:USERPROFILE =
Expand-Path -Path $PortableHomeDirectory
$env:ANDROID_HOME =
Expand-Path -Path $AndroidSDKDirectory
$env:ANDROID_SDK_HOME =
Expand-Path -Path $PortableHomeDirectory
$env:GRADLE_USER_HOME =
Expand-Path -Path $GradleUserHomeDirectory
$env:PATH =
"$(Expand-Path -Path $AndroidStudioBinariesDirectory);$env:PATH"
foreach ($Directory in $AndroidSDKBinariesDirectories)
{
$env:PATH =
"$(Expand-Path -Path $Directory);$env:PATH"
}
#
# Start the Android Studio.
#
Set-Location -Path $AndroidStudioBinariesDirectory
& $AndroidStudioExecutable