2019-02-09 21:23:09 +03:00
|
|
|
Param(
|
2019-05-01 03:19:56 +03:00
|
|
|
[string] $version = "3.2"
|
2019-02-09 21:23:09 +03:00
|
|
|
)
|
|
|
|
|
2019-02-05 06:22:35 +03:00
|
|
|
$errorActionPreference = 'Stop'
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS) {
|
|
|
|
$platform = "macos-64"
|
|
|
|
$ext = "bin"
|
|
|
|
} elseif ($IsLinux) {
|
|
|
|
$platform = "ubuntu-64"
|
|
|
|
$ext = "bin"
|
|
|
|
} else {
|
|
|
|
$platform = "windows-64"
|
|
|
|
$ext = "exe"
|
|
|
|
}
|
|
|
|
|
2019-05-01 03:19:56 +03:00
|
|
|
$ts = Join-Path "$HOME" "tizen-studio"
|
|
|
|
$tsTemp = Join-Path "$HOME" "tizen-temp"
|
2019-02-09 21:23:09 +03:00
|
|
|
$url = "http://download.tizen.org/sdk/Installer/tizen-studio_${version}/web-cli_Tizen_Studio_${version}_${platform}.${ext}"
|
2019-05-01 03:19:56 +03:00
|
|
|
$install = Join-Path "$tsTemp" "tizen-install.$ext"
|
2019-02-05 06:22:35 +03:00
|
|
|
$packages = "MOBILE-4.0,MOBILE-4.0-NativeAppDevelopment"
|
|
|
|
|
2019-05-01 03:19:56 +03:00
|
|
|
# make sure that JAVA_HOME/bin is in the PATH
|
|
|
|
if ($env:JAVA_HOME) {
|
|
|
|
$javaBin = Join-Path "$env:JAVA_HOME" "bin"
|
|
|
|
if(-not $env:PATH.Contains($javaBin)) {
|
|
|
|
Write-Host "Adding $javaBin to PATH..."
|
|
|
|
$env:PATH = $javaBin + [System.IO.Path]::PathSeparator + $env:PATH
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# log the Java version
|
|
|
|
Write-Host "Using Java version:"
|
|
|
|
& "java" -version
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# download
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Downloading SDK to '$install'..."
|
2019-02-09 21:23:09 +03:00
|
|
|
New-Item -ItemType Directory -Force -Path "$tsTemp" | Out-Null
|
2019-02-05 06:22:35 +03:00
|
|
|
(New-Object System.Net.WebClient).DownloadFile("$url", "$install")
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# install
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Installing SDK to '$ts'..."
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS -or $IsLinux) {
|
|
|
|
& "bash" "$install" --accept-license --no-java-check "$ts"
|
|
|
|
} else {
|
|
|
|
& "$install" --accept-license --no-java-check "$ts"
|
|
|
|
}
|
2019-02-05 06:22:35 +03:00
|
|
|
|
|
|
|
# install packages
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Installing Additional Packages: '$packages'..."
|
|
|
|
$packMan = Join-Path (Join-Path "$ts" "package-manager") "package-manager-cli.${ext}"
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS -or $IsLinux) {
|
2019-05-01 03:19:56 +03:00
|
|
|
& "bash" "$packMan" install --no-java-check --accept-license "$packages"
|
2019-02-09 21:23:09 +03:00
|
|
|
} else {
|
2019-05-01 03:19:56 +03:00
|
|
|
& "$packMan" install --no-java-check --accept-license "$packages"
|
2019-02-09 21:23:09 +03:00
|
|
|
}
|
2019-02-05 06:22:35 +03:00
|
|
|
|
|
|
|
exit $LASTEXITCODE
|