Permalink
Fetching contributors…
Cannot retrieve contributors at this time
86 lines (67 sloc) 2.72 KB
# NetBeans IDE turbo.me file
# https://github.com/turboapps/turbome/tree/master/netbeans
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
requires privilege:admin
meta title="netbeans"
meta namespace="oracle"
meta name="netbeans"
###################################
# Install settings
###################################
# Install Java SE bundle by default
# Other bundles: javaee, cpp, php, all
cmd "if defined bundle (echo %bundle%) else (echo javase)"
var bundle = last
cmd "if defined bundle if not %bundle% == all (echo -%bundle%)"
var postfix = last
###################################
# Pull dependency images
###################################
layer jdk:8
using turbo/turboscript-tools:2016.3.17
###################################
# Download and install
###################################
cmd "mkdir @SYSDRIVE@\Workspace"
workdir @SYSDRIVE@\Workspace
# Setup batch script to kill nbi-cleaner process after install if it hangs
# NOTE: https://netbeans.org/bugzilla/show_bug.cgi?id=192129
batch
echo @echo off > kill.bat
echo if "%%2"=="" (set t=5) else (set t=%%2) >> kill.bat
echo tasklist /fi "imagename eq %%1" ^| findstr : ^> nul >> kill.bat
echo if errorlevel 1 (for /f "tokens=2 delims=," %%%%i in ('tasklist /nh /fi "imagename eq %%1" /fo csv') do taskkill /f /pid %%%%~i ^> nul ^&^& goto end) >> kill.bat
echo @timeout /t %%t%% /nobreak ^> nul >> kill.bat
echo %%~n0 %%1 %%t%% >> kill.bat
echo :end >> kill.bat
# Get the latest version tag
batch
echo import sys > getTag.py
echo import requests >> getTag.py
echo import re >> getTag.py
echo host = "https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=" >> getTag.py
echo headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'} >> getTag.py
echo r = requests.get(host , headers=headers, timeout=10) >> getTag.py
echo print(re.findall('download\/(\d+\.\d+[\d\.]*)', r.text )[0]) >> getTag.py
cmd python getTag.py
var tag = last
var url = "http://download.netbeans.org/netbeans/" + tag + "/final/bundles/netbeans-" + tag + postfix + "-windows.exe"
# Download and install the latest version
batch
echo Downloading %bundle% bundle from %url%...
wget -q -O install.exe --no-check-certificate --no-verbose "%url%"
start /b cmd /c kill.bat nbi-cleaner* 30
echo Installing...
install.exe --silent
# Set startup file
startup file ("@PROGRAMFILESX86@\NetBeans " + tag + "\bin\netbeans.exe")
###################################
# Clean up
###################################
cmd powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Import-Module Turbo; Remove-BuildTools"
workdir c:\
cmd rmdir c:\Workspace /s /q
cmd rmdir c:\TurboBuildTools /s /q
meta tag=tag