Last active
December 20, 2015 00:29
-
-
Save nickboldt/6041754 to your computer and use it in GitHub Desktop.
Commandline JBDS installer for linux, to skip all the clicking thru dialogs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage () | |
{ | |
echo "Usage: $0 /path/to/jbdevstudio-product-universal-*.jar [/path/to/jre/bin/java]" | |
echo "" | |
echo "Usage: $0 /tmp/jbdevstudio-product-universal-8.0.0.GA-v20140720-0044-B420.jar" | |
echo "Usage: $0 /tmp/jbdevstudio-product-universal-8.0.0.GA-v20140720-0044-B420.jar /usr/bin/java" | |
echo "" | |
exit 1; | |
} | |
if [[ $# -lt 1 ]]; then usage; fi | |
JREPATH=/usr/bin/java | |
if [[ -f $2 ]]; then JREPATH=$2; fi | |
# Install into user home dir, eg., /home/jsmith | |
baseInstallDir=${HOME} | |
# Want installerJar (with full path), but want only the filename (minus prefix path and trailing extension) for the dir name | |
installerJar=$1 | |
installDir=${HOME}/${installerJar//.jar} | |
installDir=${installDir##*/} | |
# Set installPath | |
installPath=${baseInstallDir}/${installDir} | |
# Create installation script | |
installXML=/tmp/${installDir}.install.xml | |
# up to JBDS 8.0.0.Alpha1, use old namespace | |
if [[ ${version:0:1} -le 7 ]] || [[ ${version:0:12} == "8.0.0.Alpha1" ]]; then | |
namespace=com.jboss.jbds.installer | |
else | |
namespace=com.jboss.devstudio.core.installer | |
fi | |
echo "<?xml version='1.0' encoding='UTF-8' standalone='no'?> | |
<AutomatedInstallation langpack='eng'> | |
<${namespace}.HTMLInfoPanelWithRootWarning id='introduction'/> | |
<com.izforge.izpack.panels.HTMLLicencePanel id='licence'/> | |
<${namespace}.PathInputPanel id='target'> | |
<installpath>${installPath}</installpath> | |
</${namespace}.PathInputPanel> | |
<${namespace}.JREPathPanel id='jre'/> | |
<${namespace}.JBossAsSelectPanel id='as'> | |
<installgroup>jbds</installgroup> | |
</${namespace}.JBossAsSelectPanel> | |
<${namespace}.UpdatePacksPanel id='updatepacks'/> | |
<${namespace}.DiskSpaceCheckPanel id='diskspacecheck'/> | |
<com.izforge.izpack.panels.SummaryPanel id='summary'/> | |
<com.izforge.izpack.panels.InstallPanel id='install'/> | |
<${namespace}.CreateLinkPanel id='createlink'> | |
<jrelocation>${JREPATH}</jrelocation> | |
</${namespace}.CreateLinkPanel> | |
<com.izforge.izpack.panels.ShortcutPanel id='shortcut'/> | |
<${namespace}.ShortcutPanelPatch id='shortcutpatch'/> | |
<com.izforge.izpack.panels.SimpleFinishPanel id='finish'/> | |
</AutomatedInstallation>" > ${installXML} | |
# Perform headless install | |
${JREPATH} -jar ${installerJar} ${installXML} | |
# Store script inside install folder for reuse | |
mv ${installXML} ${baseInstallDir}/${installDir} | |
echo "" | |
echo "JBDS Installed to ${installPath}/" | |
echo "" | |
echo "To run JBDS:" | |
echo "" | |
echo "${installPath}/jbdevstudio &" | |
echo "" | |
# echo "To tweak Central URL, edit this file: " | |
# echo "" | |
# echo "${baseInstallDir}/${installDir}/studio/jbdevstudio.ini" | |
# echo "" | |
# echo "With something like:" | |
# echo "" | |
# echo "-Djboss.discovery.directory.url=http://localhost:8080/jbdevstudio/com.jboss.devstudio.core.central.discovery/target/discovery-site/devstudio-directory.xml" | |
# echo "-Djboss.discovery.site.url=http://localhost:8080/jbdevstudio/com.jboss.devstudio.core.central.discovery/target/discovery-site/" | |
# echo " - or -" | |
# echo "-Djboss.discovery.directory.url=https://devstudio.jboss.com/updates/8.0-staging/devstudio-directory.xml" | |
# echo "-Djboss.discovery.site.url=https://devstudio.jboss.com/updates/8.0-staging/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment