diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binaries b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binaries index 56aaa665a9de..0611ea0fdcb4 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binaries +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/ignored-binaries @@ -68,3 +68,5 @@ nb/ide.launcher/external/launchers-10.0.zip # webcommon/libs.oracle.jsparser builds a test-only binaries into build/webcommon. Not distributed. webcommon/libs.oracle.jsparser/build/webcommon/** +#only used to build installers +nbbuild/installer/mac/newbuild/dmg/template.sparseimage.bz2 diff --git a/nbbuild/installer/build.xml b/nbbuild/installer/build.xml new file mode 100644 index 000000000000..1b7749e92188 --- /dev/null +++ b/nbbuild/installer/build.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/components/components.txt b/nbbuild/installer/components/components.txt new file mode 100644 index 000000000000..8c59fc874cd2 --- /dev/null +++ b/nbbuild/installer/components/components.txt @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +* nb-ide-group + * nb-platform + * nb-base + * nb-javase + * nb-addons-group + * nb-javaee + * nb-javame + * nb-ccpp + * nb-soa + * nb-uml + * nb-ruby + * nb-php +* runtimes-group + * glassfish + * tomcat + * openesb + * sjsam + * wtk diff --git a/nbbuild/installer/components/groups/documentation-group/data/Bundle.properties b/nbbuild/installer/components/groups/documentation-group/data/Bundle.properties new file mode 100644 index 000000000000..254dbc34c89e --- /dev/null +++ b/nbbuild/installer/components/groups/documentation-group/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +group.display.name=Documentation +group.description=Contains a set of documentation, code samples and tutorials provided by the Java Platform, Enterprise Edition 5 SDK diff --git a/nbbuild/installer/components/groups/documentation-group/data/icon.png b/nbbuild/installer/components/groups/documentation-group/data/icon.png new file mode 100644 index 000000000000..ead5e335548b Binary files /dev/null and b/nbbuild/installer/components/groups/documentation-group/data/icon.png differ diff --git a/nbbuild/installer/components/groups/nb-addons-group/data/Bundle.properties b/nbbuild/installer/components/groups/nb-addons-group/data/Bundle.properties new file mode 100644 index 000000000000..9c0c906ebc02 --- /dev/null +++ b/nbbuild/installer/components/groups/nb-addons-group/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +group.display.name=Plugins +group.description= diff --git a/nbbuild/installer/components/groups/nb-addons-group/data/icon.png b/nbbuild/installer/components/groups/nb-addons-group/data/icon.png new file mode 100644 index 000000000000..ead5e335548b Binary files /dev/null and b/nbbuild/installer/components/groups/nb-addons-group/data/icon.png differ diff --git a/nbbuild/installer/components/groups/nb-ide-group/data/Bundle.properties b/nbbuild/installer/components/groups/nb-ide-group/data/Bundle.properties new file mode 100644 index 000000000000..26f68e39ef5c --- /dev/null +++ b/nbbuild/installer/components/groups/nb-ide-group/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +group.display.name=Apache NetBeans IDE {display-version} +group.description=The Apache NetBeans IDE is a modular, standards-based, integrated development environment (IDE) that provides full support for the technologies included in this bundle. diff --git a/nbbuild/installer/components/groups/nb-ide-group/data/icon.png b/nbbuild/installer/components/groups/nb-ide-group/data/icon.png new file mode 100644 index 000000000000..1b3bcd61d25b Binary files /dev/null and b/nbbuild/installer/components/groups/nb-ide-group/data/icon.png differ diff --git a/nbbuild/installer/components/groups/runtimes-group/data/Bundle.properties b/nbbuild/installer/components/groups/runtimes-group/data/Bundle.properties new file mode 100644 index 000000000000..52caeee66178 --- /dev/null +++ b/nbbuild/installer/components/groups/runtimes-group/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +group.display.name=Runtimes +group.description=Contains runtimes to be installed diff --git a/nbbuild/installer/components/groups/runtimes-group/data/icon.png b/nbbuild/installer/components/groups/runtimes-group/data/icon.png new file mode 100644 index 000000000000..ead5e335548b Binary files /dev/null and b/nbbuild/installer/components/groups/runtimes-group/data/icon.png differ diff --git a/nbbuild/installer/components/groups/tools-group/data/Bundle.properties b/nbbuild/installer/components/groups/tools-group/data/Bundle.properties new file mode 100644 index 000000000000..1f97c2460d16 --- /dev/null +++ b/nbbuild/installer/components/groups/tools-group/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +group.display.name=Tools +group.description=Contains tools and modules to be installed diff --git a/nbbuild/installer/components/groups/tools-group/data/icon.png b/nbbuild/installer/components/groups/tools-group/data/icon.png new file mode 100644 index 000000000000..ead5e335548b Binary files /dev/null and b/nbbuild/installer/components/groups/tools-group/data/icon.png differ diff --git a/nbbuild/installer/components/products/jdk/build.xml b/nbbuild/installer/components/products/jdk/build.xml new file mode 100644 index 000000000000..2ea503707d2e --- /dev/null +++ b/nbbuild/installer/components/products/jdk/build.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/nbbuild/installer/components/products/jdk/data/Bundle.properties b/nbbuild/installer/components/products/jdk/data/Bundle.properties new file mode 100644 index 000000000000..f9e4af5f999f --- /dev/null +++ b/nbbuild/installer/components/products/jdk/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +product.display.name=JDK {display-version} +product.description=The Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development tools that are useful for developing applets and applications. diff --git a/nbbuild/installer/components/products/jdk/data/icon.png b/nbbuild/installer/components/products/jdk/data/icon.png new file mode 100644 index 000000000000..1b3bcd61d25b Binary files /dev/null and b/nbbuild/installer/components/products/jdk/data/icon.png differ diff --git a/nbbuild/installer/components/products/jdk/manifest.mf b/nbbuild/installer/components/products/jdk/manifest.mf new file mode 100644 index 000000000000..39299e0c2587 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/manifest.mf @@ -0,0 +1 @@ +Configuration-Logic-Class: org.netbeans.installer.products.jdk.ConfigurationLogic diff --git a/nbbuild/installer/components/products/jdk/nbproject/build-impl.xml b/nbbuild/installer/components/products/jdk/nbproject/build-impl.xml new file mode 100644 index 000000000000..5b90a8132398 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/nbproject/build-impl.xml @@ -0,0 +1,1418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/components/products/jdk/nbproject/genfiles.properties b/nbbuild/installer/components/products/jdk/nbproject/genfiles.properties new file mode 100644 index 000000000000..7b3dade2d07e --- /dev/null +++ b/nbbuild/installer/components/products/jdk/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=4c0de5c1 +build.xml.script.CRC32=41ea1d22 +build.xml.stylesheet.CRC32=a12b3d02 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=40027ccb +nbproject/build-impl.xml.script.CRC32=87c32ca3 +nbproject/build-impl.xml.stylesheet.CRC32=a25f357b@1.73.0.48 diff --git a/nbbuild/installer/components/products/jdk/nbproject/project.properties b/nbbuild/installer/components/products/jdk/nbproject/project.properties new file mode 100644 index 000000000000..578d6b36907c --- /dev/null +++ b/nbbuild/installer/components/products/jdk/nbproject/project.properties @@ -0,0 +1,105 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.title=NBI Product: JDK +application.vendor=ondra +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/logic.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${reference.NBI_Engine.jar}:\ + ${reference.NetBeans_Installer_Engine.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.NBI_Engine=../../../../nbi/engine +project.NetBeans_Installer_Engine=../../../engine +reference.NBI_Engine.jar=${project.NBI_Engine}/dist/nbi-engine.jar +reference.NetBeans_Installer_Engine.jar=${project.NetBeans_Installer_Engine}/dist/nbi-engine.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src + +platforms.JDK_1.5.bootclasspath=${platforms.JDK_1.5.home}\\jre\\lib\\rt.jar;${platforms.JDK_1.5.home}\\jre\\lib\\i18n.jar;${platforms.JDK_1.5.home}\\jre\\lib\\sunrsasign.jar;${platforms.JDK_1.5.home}\\jre\\lib\\jsse.jar;${platforms.JDK_1.5.home}\\jre\\lib\\jce.jar;${platforms.JDK_1.5.home}\\jre\\lib\\charsets.jar;${platforms.JDK_1.5.home}\\jre\\classes;${platforms.JDK_1.5.home}\\jre\\lib\\ext\\dnsns.jar;${platforms.JDK_1.5.home}\\jre\\lib\\ext\\localedata.jar;${platforms.JDK_1.5.home}\\jre\\lib\\ext\\sunjce_provider.jar;${platforms.JDK_1.5.home}\\jre\\lib\\ext\\sunpkcs11.jar +platforms.JDK_1.5.compiler=modern diff --git a/nbbuild/installer/components/products/jdk/nbproject/project.xml b/nbbuild/installer/components/products/jdk/nbproject/project.xml new file mode 100644 index 000000000000..53b478377d03 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/nbproject/project.xml @@ -0,0 +1,52 @@ + + + + org.netbeans.modules.java.j2seproject + + + NBI Product: JDK + 1.6.5 + + + + + + + + NBI_Engine + jar + + jar + clean + jar + + + NetBeans_Installer_Engine + jar + + jar + clean + jar + + + + diff --git a/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/Bundle.properties b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/Bundle.properties new file mode 100644 index 000000000000..1c37dde7e309 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/Bundle.properties @@ -0,0 +1,51 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +################################################################################ +# ConfigurationLogic.java +CL.error.jdk.installation.return.nonzero=JDK installation finished with error code {0} +CL.error.jre.installation.return.nonzero=JRE installation finished with error code {0} +CL.error.javadb.installation.return.nonzero=Java DB installation finished with error code {0} +CL.error.jdk.uninstallation.return.nonzero=JDK uninstallation finished with error code {0} +CL.error.jre.uninstallation.return.nonzero=JRE uninstallation finished with error code {0} +CL.error.javadb.uninstallation.return.nonzero=Java DB uninstallation finished with error code {0} + +CL.progress.detail.install.jdk=Running JDK installer... +CL.progress.detail.install.jre=Running JRE installer... +CL.progress.detail.install.javadb=Running Java DB installer... +CL.progress.detail.uninstall.jdk=Running JDK uninstaller... +CL.progress.detail.uninstall.jre=Running JRE uninstaller... +CL.progress.detail.uninstall.javadb=Running Java DB uninstaller... + +#Name of JDK patch dir under $D(common)\Java\Update\Base Images\ +#It is the same for all JDK 5.0 updates +#NOI18N +CL.jdk.patch.directory={jdk-base-dir} + +#NOI18N +CL.jdk.install.dir={jdk-install-dir} +#NOI18N +CL.jdk.installer.file={jdk-installer-file} + +CL.error.install.jdk.exception=An error occured while JDK installation +CL.error.uninstall.jdk.exception=An error occured while JDK uninstallation +CL.error.install.jre.exception=An error occured while JRE installation +CL.error.uninstall.jre.exception=An error occured while JRE uninstallation +CL.error.install.javadb.exception=An error occured while Java DB installation +CL.error.uninstall.javadb.exception=An error occured while Java DB uninstallation +CL.error.install.cannot.move.data=Cannot move installation files diff --git a/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/ConfigurationLogic.java b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/ConfigurationLogic.java new file mode 100644 index 000000000000..d54450e6ec46 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/ConfigurationLogic.java @@ -0,0 +1,1375 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.products.jdk; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.netbeans.installer.product.components.ProductConfigurationLogic; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import static org.netbeans.installer.utils.StringUtils.BACK_SLASH; +import static org.netbeans.installer.utils.StringUtils.EMPTY_STRING; +import static org.netbeans.installer.utils.StringUtils.QUOTE; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.applications.JavaUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.InstallationException; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.exceptions.UninstallationException; +import org.netbeans.installer.utils.helper.EnvironmentScope; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.netbeans.installer.utils.helper.ExecutionResults; +import org.netbeans.installer.utils.helper.FilesList; +import org.netbeans.installer.utils.helper.NbiThread; +import org.netbeans.installer.utils.helper.Platform; +import org.netbeans.installer.utils.helper.RemovalMode; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.Text; +import org.netbeans.installer.utils.helper.Version; +import org.netbeans.installer.utils.progress.CompositeProgress; +import org.netbeans.installer.utils.progress.Progress; +import org.netbeans.installer.utils.system.WindowsNativeUtils; +import org.netbeans.installer.utils.system.launchers.LauncherResource; +import org.netbeans.installer.utils.system.windows.WindowsRegistry; +import static org.netbeans.installer.utils.system.windows.WindowsRegistry.HKLM; +import org.netbeans.installer.wizard.Wizard; +import org.netbeans.installer.wizard.components.WizardComponent; + +/** + * + * @author Dmitry Lipin + */ +public class ConfigurationLogic extends ProductConfigurationLogic { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private List wizardComponents; + + public ConfigurationLogic() throws InitializationException { + wizardComponents = Wizard.loadWizardComponents( + WIZARD_COMPONENTS_URI, + getClass().getClassLoader()); + } + + public void install( + final Progress progress) throws InstallationException { + if(progress.isCanceled()) return; + + final File location = getProduct().getInstallationLocation(); + final File installer = new File(location, JDK_INSTALLER_FILE_NAME); + + try { + String [] commands = null; + ExecutionResults results = null; + + + boolean jreInstallationFailed = false; + boolean javadbInstallation = false; + boolean restartIsNeeded = false; + final CompositeProgress overallProgress = new CompositeProgress(); + overallProgress.synchronizeTo(progress); + overallProgress.synchronizeDetails(true); + + if(SystemUtils.isWindows()) { + final File jdk = JavaUtils.findJDKHome(getProduct().getVersion()); + final File jre = JavaUtils.findJreHome(getProduct().getVersion()); + if (jdk == null) { + final Progress jdkProgress = new Progress(); + final Progress jreProgress = new Progress(); + final Progress javadbProgress = new Progress(); + final boolean isFullSilentInstaller = isJDK6U15orLater(); + //TODO: JavaDB feature is turned off for 64-bit OS + final boolean javadbBundled = + getProduct().getVersion().newerOrEquals(Version.getVersion("1.6.0")); + final boolean jreAlreadyInstalled = (jre != null); + if(isFullSilentInstaller) { + LogManager.log("... perform full silent installation"); + overallProgress.addChild(jdkProgress, progress.COMPLETE); + } else { + //before jdk6u15 there were separate jre and javadb installers + if(jreAlreadyInstalled) { + if(javadbBundled) { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 6 / 7); + overallProgress.addChild(javadbProgress, progress.COMPLETE * 1 / 7); + } else { + overallProgress.addChild(jdkProgress, progress.COMPLETE); + } + } else { + if(javadbBundled) { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 4 / 7 ); + overallProgress.addChild(jreProgress, progress.COMPLETE * 2 / 7); + overallProgress.addChild(javadbProgress, progress.COMPLETE * 1 / 7); + } else { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 3 / 5 ); + overallProgress.addChild(jreProgress, progress.COMPLETE * 2 / 5); + } + } + } + + if(!isFullSilentInstaller) { + //before jdk6u15(isFullSilentInstaller == true) there were separate jre and javadb installers + if(!progress.isCanceled()) { + if(!jreAlreadyInstalled) { + final File jreInstaller = findJREWindowsInstaller(); + if(jreInstaller!=null) { + results = runJREInstallerWindows(jreInstaller, jreProgress); + configureJREProductWindows(results); + } + if(results.getErrorCode() != 0) { + jreInstallationFailed = true; + } + if(results.getErrorCode() == 3010) { + jreInstallationFailed = false; + LogManager.log("The system Restart is required to complete the configuration of JRE"); + getProduct().setProperty(RESTART_IS_REQUIRED_PROPERTY, "" + true); + } + } else { + LogManager.log("... jre " + getProduct().getVersion() + + " is already installed, skipping its configuration"); + } + } + if (!progress.isCanceled() && javadbBundled) { + final File javadbInstaller = findJavaDBWindowsInstaller(); + if (javadbInstaller != null) { + javadbInstallation = true; + getProduct().setProperty(JAVADB_INSTALLER_LOCATION_PROPERTY, javadbInstaller.getAbsolutePath()); + results = runJavaDBInstallerWindows(javadbInstaller, javadbProgress); + configureJavaDBProductWindows(results); + } + } + } + + if(!progress.isCanceled()) { + results = runJDKInstallerWindows(location, installer, jdkProgress, + isFullSilentInstaller, jreAlreadyInstalled, javadbBundled); + if(results.getErrorCode()==0) { + getProduct().setProperty(JDK_INSTALLED_WINDOWS_PROPERTY, + "" + true); + } + addUninsallationJVM(results, location); + } + if(isFullSilentInstaller) { + if (!jreAlreadyInstalled) { + configureJREProductWindows(results); + } else { + LogManager.log("... jre " + getProduct().getVersion() + + " is already installed, skipping its configuration"); + } + if(javadbBundled) { + configureJavaDBProductWindows(results); + } + } + } else { + LogManager.log("... jdk " + getProduct().getVersion() + + " is already installed, skipping JDK and JRE configuration"); + } + } else { + final Progress jdkProgress = new Progress(); + overallProgress.addChild(jdkProgress,Progress.COMPLETE); + if (JDK_INSTALLER_FILE_NAME.isEmpty()) { + results = new ExecutionResults(0, "", ""); + } else { + results = runJDKInstallerUnix(location, installer, jdkProgress); + } + addUninsallationJVM(results, location); + try { + addFiles(getProduct().getInstalledFiles(),location); + } catch (IOException e) { + LogManager.log("Cannot add installed JDK files", e); + } + } + + + if(results.getErrorCode()!=0) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_JDK_INSTALL_SCRIPT_RETURN_NONZERO_KEY, + StringUtils.EMPTY_STRING + results.getErrorCode())); + } + if(jreInstallationFailed) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_JRE_INSTALL_SCRIPT_RETURN_NONZERO_KEY, + StringUtils.EMPTY_STRING + results.getErrorCode())); + } + } finally { + if (!JDK_INSTALLER_FILE_NAME.isEmpty()) { + try { + FileUtils.deleteFile(installer); + } catch (IOException e) { + LogManager.log("Cannot delete installer file "+ installer, e); + } + } + } + + ///////////////////////////////////////////////////////////////////////////// + progress.setPercentage(Progress.COMPLETE); + } + private void addFiles(FilesList list, File location) throws IOException { + if(FileUtils.exists(location)) { + if(location.isDirectory()) { + list.add(location); + File [] files = location.listFiles(); + if(files!=null && files.length>0) { + for(File f: files) { + addFiles(list, f); + } + } + } else { + list.add(location); + } + } + } + + private ExecutionResults runJDKInstallerWindows(File location, + File installer, Progress progress, + final boolean isFullSilentInstaller, + final boolean jreAlreadyInstalled, + final boolean javadbBundled) throws InstallationException { + progress.setDetail(PROGRESS_DETAIL_RUNNING_JDK_INSTALLER); + final File logFile = getLog("jdk_install"); + LogManager.log("... JDK installation log file : " + logFile); + String [] commands; + + if(installer.getAbsolutePath().endsWith(".exe")) { + /////////////////////////for exe//////////////////////////// + LogManager.log("Installing JDK with exe installer"); + String logPath = logFile.getAbsolutePath(); + String locationPath = location.getAbsolutePath(); + if (logPath.contains(" ")) { + logPath = convertPathNamesToShort(logPath); + } + if (locationPath.contains(" ")) { + locationPath = convertPathNamesToShort(locationPath); + } + if (isJDK11()) { + // JDK 11 + commands = new String [] { + installer.getAbsolutePath(), + "/s", + logFile != null ? "/L" : EMPTY_STRING, + logFile != null ? logPath : EMPTY_STRING, + "INSTALLDIR=" + locationPath + }; + } else if (isJDK8()) { + commands = new String [] { + installer.getAbsolutePath(), + "/s", + logFile != null ? "/lv" : EMPTY_STRING, + logFile != null ? logPath : EMPTY_STRING, + "INSTALLDIR=" + locationPath, + "REBOOT=ReallySuppress" + }; + } else { + // JDK 1.7 + commands = new String [] { + installer.getAbsolutePath(), + "/s", + "/qn", + "/norestart", + logFile != null ? "/lv" : EMPTY_STRING, + logFile != null ? logPath : EMPTY_STRING, + "INSTALLDIR=" + locationPath, + "REBOOT=ReallySuppress" + }; + } + } else { + ////////////////////////////for msi//////////////////////////// + LogManager.log("Installing JDK with MSI installer"); + final String packageOption = "/i \"" + installer.getAbsolutePath() +"\" "; + final String loggingOption = (logFile!=null) ? + "/log \"" + logFile.getAbsolutePath() +"\" " : EMPTY_STRING; + final String installLocationOption = "/qn INSTALLDIR=\"" + location.getAbsolutePath() + "\""; + commands = new String [] { + "CMD", + "/C", + "msiexec.exe " + packageOption + loggingOption + installLocationOption + }; + + } + final File tempDir; + try { + tempDir = FileUtils.createTempFile( + SystemUtils.getTempDirectory(), true, true); + SystemUtils.setEnvironmentVariable("TEMP", + tempDir.getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + SystemUtils.setEnvironmentVariable("TMP", + tempDir.getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + LogManager.log("... tempdir : " + tempDir); + } catch (NativeException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JDK_ERROR_KEY),e); + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JDK_ERROR_KEY),e); + } + + List directories = new ArrayList(); + directories.add(location); + directories.add(tempDir); + long maxDeltaSize = getJDKinstallationSize() + getProduct().getDownloadSize(); + + //after jdk6u15 jre and javaDB installation is included into silent jdk installation + if(isFullSilentInstaller) { + if(!jreAlreadyInstalled) { + directories.add(getJREInstallationLocationWindows()); + maxDeltaSize += getJREinstallationSize(); + } + if(javadbBundled) { + directories.add(getJavaDBInstallationLocationWindows()); + maxDeltaSize += getJavaDBInstallationSize(); + } + } + + ProgressThread progressThread = new ProgressThread(progress, + directories.toArray(new File[directories.size()]), + maxDeltaSize); + try { + progressThread.start(); + return SystemUtils.executeCommand(location, commands); + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JDK_ERROR_KEY),e); + } finally { + progressThread.finish(); + progress.setPercentage(Progress.COMPLETE); + } + } + + + private static String convertPathNamesToShort(String path){ + File pathConverter = new File(SystemUtils.getTempDirectory(), "pathConverter.cmd"); + String result = path; + List commands = new ArrayList (); + commands.add("@echo off"); + commands.add("set JPATH=" + path); + commands.add("for %%i in (\"%JPATH%\") do set JPATH=%%~fsi"); + commands.add("echo %JPATH%"); + try{ + FileUtils.writeStringList(pathConverter, commands); + ExecutionResults res=SystemUtils.executeCommand(pathConverter.getAbsolutePath()); + FileUtils.deleteFile(pathConverter); + result = res.getStdOut().trim(); + } catch(IOException ioe) { + LogManager.log(ErrorLevel.WARNING, + "Failed to convert " + path + " to a path with short names only." + + "\n Exception is thrown " + ioe); + } + return result; + } + + private ExecutionResults runJDKInstallerUnix(File location, File installer, Progress progress) throws InstallationException { + File yesFile = null; + ExecutionResults results = null; + try { + progress.setDetail(PROGRESS_DETAIL_RUNNING_JDK_INSTALLER); + yesFile = FileUtils.createTempFile(); + FileUtils.writeFile(yesFile, "yes" + SystemUtils.getLineSeparator()); + + //no separate log file since we can write at the same + //final File logFile = getLog("jdk_install"); + final File logFile = null; + + final String loggingOption = (logFile!=null) ? + " > " + StringUtils.escapePath(logFile.getAbsolutePath()) + " 2>&1" : + EMPTY_STRING; + + SystemUtils.correctFilesPermissions(installer); + + // according to Mandy Chung and Marek Slama: + // If NB bundles JDK 6u5, the NB installer has to be modified to add a + // new -noregister option to disable JDK registration. + // Otherwise, a browser will be popped up during NB+JDK install. + final String registerOption = getProduct().getVersion(). + newerOrEquals(Version.getVersion("1.6.0_05")) + && getProduct().getVersion().olderThan(Version.getVersion("1.7.0_06")) // we build our own .bin since 1.7.0.6 + ? " " + NO_REGISTER_JDK_OPTION : + StringUtils.EMPTY_STRING; + + String [] commands = new String [] { + "/bin/sh", "-c", + StringUtils.escapePath(installer.getAbsolutePath()) + + registerOption + + " < " + StringUtils.escapePath(yesFile.getAbsolutePath()) + + loggingOption + }; + ProgressThread progressThread = new ProgressThread(progress, + new File [] {location}, getJDKinstallationSize()); + try { + progressThread.start(); + results = SystemUtils.executeCommand(location, commands); + } finally { + progressThread.finish(); + } + // unix JDK installers create extra level directory jdkxxx + File [] jdkDirs = location.listFiles(new FileFilter() { + public boolean accept(File pathname) { + return (pathname.isDirectory() && + pathname.getName().startsWith("jdk")); + } + }); + + try { + for(File dir : jdkDirs) { + for(File f : dir.listFiles()) { + SystemUtils.executeCommand("mv", "-f", f.getPath(), location.getAbsolutePath()); + } + FileUtils.deleteFile(dir); + } + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_CANNOT_MOVE_DATA_KEY),e); + } + + + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JDK_ERROR_KEY),e); + } finally { + if(yesFile!=null) { + try { + FileUtils.deleteFile(yesFile); + } catch (IOException e) { + LogManager.log(e); + } + } + progress.setPercentage(progress.COMPLETE); + } + return results; + } + private boolean isJDK6U10orLater() { + return getProduct().getVersion().newerOrEquals(Version.getVersion("1.6.0_10")); + } + private boolean isJDK6U15orLater() { + return getProduct().getVersion().newerOrEquals(Version.getVersion("1.6.0_15")); + } + private boolean isJDK7() { + return getProduct().getVersion().newerOrEquals(Version.getVersion("1.7.0")); + } + private boolean isJDK8() { + return getProduct().getVersion().newerOrEquals(Version.getVersion("1.8.0")); + } + private boolean isJDK11() { + return getProduct().getVersion().newerOrEquals(Version.getVersion("11.0.1")); + } + + + private void configureJREProductWindows(ExecutionResults results) { + LogManager.log("... configuring JRE Product"); + addUninsallationJVM(results, JavaUtils.findJreHome(getProduct().getVersion())); + if(results.getErrorCode()==0) { + getProduct().setProperty(JRE_INSTALLED_WINDOWS_PROPERTY, + "" + true); + } + } + private void configureJavaDBProductWindows(ExecutionResults results) { + if(results.getErrorCode()==0) { + LogManager.log("... configuring JavaDB Product..."); + getProduct().setProperty(JAVADB_INSTALLED_WINDOWS_PROPERTY, + "" + true); + } + } + + private ExecutionResults runJREInstallerWindows(File jreInstaller, Progress progress) throws InstallationException { + progress.setDetail(PROGRESS_DETAIL_RUNNING_JRE_INSTALLER); + final List commands = new ArrayList (); + + final File logFile = getLog("jre_install"); + + if(jreInstaller.getName().equals(JRE_MSI_NAME)) { + commands.add("msiexec.exe"); + commands.add("/qn"); + commands.add("/i"); + commands.add(jreInstaller.getPath()); + commands.add("IEXPLORER=1"); + commands.add("MOZILLA=1"); + if (logFile != null) { + commands.add("/log"); + commands.add(logFile.getAbsolutePath()); + LogManager.log("... JRE installation log file : " + logFile); + } + } else { + /* final String packageOption = "/i \"" + jreInstaller.getPath() +"\" "; + final String loggingOption = (logFile!=null) ? + "/log \"" + logFile.getAbsolutePath() +"\" ": + EMPTY_STRING; + final String silentOption = "/qn /norestart"; + String [] commands = new String [] { + "CMD", + "/C", + "msiexec.exe " + packageOption + loggingOption + installLocationOption + //"msiexec.exe /i D:\\NBI\\FXSDK_bundle\\test msi\\fx2.0.msi /log \"D:\\NBI\\FXSDK_bundle\\test space\\log.log1\" /qn" + };*/ + commands.add(jreInstaller.getPath()); + commands.add("/s"); + commands.add("/v"); + commands.add("/qn"); + commands.add("/norestart"); + final String loggingOption = (logFile!=null) ? + "/log " + BACK_SLASH + QUOTE + logFile.getAbsolutePath() + BACK_SLASH + QUOTE +" " : EMPTY_STRING; + commands.add(loggingOption); + } + + final String [] command = commands.toArray(new String [] {}); + + final File location = getJREInstallationLocationWindows(); + LogManager.log("... JRE installation location (default) : " + location); + try { + SystemUtils.setEnvironmentVariable("TEMP", + SystemUtils.getTempDirectory().getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + SystemUtils.setEnvironmentVariable("TMP", + SystemUtils.getTempDirectory().getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + } catch (NativeException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JRE_ERROR_KEY),e); + } + ProgressThread progressThread = new ProgressThread( progress, + new File [] {location}, + getJREinstallationSize()); + try { + progressThread.start(); + return SystemUtils.executeCommand(command); + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JRE_ERROR_KEY),e); + } finally { + progressThread.finish(); + if(!jreInstaller.getName().equals(JRE_MSI_NAME)) { + try { + FileUtils.deleteFile(jreInstaller); + } catch (IOException e) { + LogManager.log("Cannot delete JRE installer file " + jreInstaller, e); + } + } + + progress.setPercentage(progress.COMPLETE); + } + } + + private ExecutionResults runJavaDBInstallerWindows(File javadbInstaller, Progress progress) throws InstallationException { + progress.setDetail(PROGRESS_DETAIL_RUNNING_JAVADB_INSTALLER); + final String [] command ; + + final File logFile = getLog("javadb_install"); + + if(logFile!=null) { + command = new String [] { + "msiexec.exe", + "/qn", + "/i", + javadbInstaller.getPath(), + "/log", + logFile.getAbsolutePath() + }; + LogManager.log("... JavaDB installation log file : " + logFile); + } else { + command = new String [] { + "msiexec.exe", + "/qn", + "/i", + javadbInstaller.getPath() + }; + } + + + final File location = getJavaDBInstallationLocationWindows(); + + LogManager.log("... JavaDB installation location (default) : " + location); + try { + SystemUtils.setEnvironmentVariable("TEMP", + SystemUtils.getTempDirectory().getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + SystemUtils.setEnvironmentVariable("TMP", + SystemUtils.getTempDirectory().getAbsolutePath(), + EnvironmentScope.PROCESS, + false); + } catch (NativeException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JAVADB_ERROR_KEY),e); + } + ProgressThread progressThread = new ProgressThread( progress, + new File [] {location}, + getJavaDBInstallationSize()); + try { + progressThread.start(); + return SystemUtils.executeCommand(command); + } catch (IOException e) { + throw new InstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_INSTALL_JAVADB_ERROR_KEY),e); + } finally { + progressThread.finish(); + progress.setPercentage(progress.COMPLETE); + } + } + private void addUninsallationJVM(ExecutionResults results, File location) { + if(results!=null && results.getErrorCode()==0 && location!=null) { + SystemUtils.getNativeUtils().addUninstallerJVM(new LauncherResource(false, location)); + } + } + /** Find path to public JRE installer ie. jre.msi file WITHOUT file itself. + * @return null if jre.msi file for given JRE version is not found + */ + private File findJREWindowsInstaller() { + if (isJDK6U10orLater()) { + // for 6u14+ we additionally bundle public jre installer + // for 6u10-6u13, jre.msi is located at the JDK installation directory + final String jreFileName = getProduct().getVersion().newerOrEquals(Version.getVersion("1.6.0_14")) ? + JRE_INSTALLER_FILE_NAME : + JRE_MSI_NAME; + + File jreInstallerFile = new File( + getProduct().getInstallationLocation(), jreFileName); + if (!jreInstallerFile.exists()) { + LogManager.log("... JRE installer doesn`t exist : " + jreInstallerFile); + return null; + } + return jreInstallerFile; + } + + File baseImagesDir = new File(parseString("$E{CommonProgramFiles}"), + "Java\\Update\\Base Images"); + if (!baseImagesDir.exists()) { + LogManager.log("... cannot find images dir : " + baseImagesDir); + return null; + } + + File [] files = baseImagesDir.listFiles(); + File jdkDirFile = null; + for (int i = 0; i < files.length; i++) { + if (files[i].getName().startsWith(JDK_PATCH_DIRECTORY)) { + LogManager.log("... using JDK dir : " + files[i]); + jdkDirFile = files[i]; + break; + } + } + if (jdkDirFile==null) { + LogManager.log("... cannot find default JDK dir"); + return null; + } + if (!jdkDirFile.exists()) { + LogManager.log("... default JDK directory does not exist : " + jdkDirFile); + return null; + } + + files = jdkDirFile.listFiles(); + File patchDirFile = null; + + for (int i = 0; i < files.length; i++) { + LogManager.log("... investigating : " + files [i]); + if (files[i].getName().startsWith("patch-" + JDK_DEFAULT_INSTALL_DIR)) { + patchDirFile = files[i]; + LogManager.log("... using JDK patch dir : " + patchDirFile); + break; + } + } + if (patchDirFile==null) { + LogManager.log("... cannot find default JDK patch dir"); + return null; + } + if (!patchDirFile.exists()) { + LogManager.log("... default JDK patch directory does not exist : " + patchDirFile); + return null; + } + File jreInstallerFile = new File(patchDirFile, + JRE_MSI_NAME); + if (!jreInstallerFile.exists()) { + LogManager.log("... JRE installer doesn`t exist : " + jreInstallerFile); + return null; + } + LogManager.log("... found JRE windows installer at " + jreInstallerFile.getPath()); + return jreInstallerFile; + } + + /** Find path to JavaDB installer ie. javadb.msi file WITHOUT file itself. + * @return null if javadb.msi file for given JRE version is not found + */ + private File findJavaDBWindowsInstaller() { + if (isJDK6U10orLater()) { + // Starting with JDK6U10, javadb.msi is located at the JDK installation directory + File javadbInstallerFile = new File( + getProduct().getInstallationLocation(), JAVADB_MSI_NAME); + if (!javadbInstallerFile.exists()) { + LogManager.log("... JavaDB installer doesn`t exist : " + javadbInstallerFile); + return null; + } + return javadbInstallerFile; + } + + File baseImagesDir = new File(parseString("$E{CommonProgramFiles}"), + "Java\\Update\\Base Images"); + if (!baseImagesDir.exists()) { + LogManager.log("... cannot find images dir : " + baseImagesDir); + return null; + } + + File [] files = baseImagesDir.listFiles(); + File jdkDirFile = null; + for (int i = 0; i < files.length; i++) { + if (files[i].getName().startsWith(JDK_PATCH_DIRECTORY)) { + LogManager.log("... using JDK dir : " + files[i]); + jdkDirFile = files[i]; + break; + } + } + if (jdkDirFile==null) { + LogManager.log("... cannot find default JDK dir"); + return null; + } + if (!jdkDirFile.exists()) { + LogManager.log("... default JDK directory does not exist : " + jdkDirFile); + return null; + } + + files = jdkDirFile.listFiles(); + File patchDirFile = null; + + for (int i = 0; i < files.length; i++) { + LogManager.log("... investigating : " + files [i]); + if (files[i].getName().startsWith("patch-" + JDK_DEFAULT_INSTALL_DIR)) { + patchDirFile = files[i]; + LogManager.log("... using JDK patch dir : " + patchDirFile); + break; + } + } + if (patchDirFile==null) { + LogManager.log("... cannot find default JDK patch dir"); + return null; + } + if (!patchDirFile.exists()) { + LogManager.log("... default JDK patch directory does not exist : " + patchDirFile); + return null; + } + File javadbInstallerFile = new File(patchDirFile, + JAVADB_MSI_NAME); + if (!javadbInstallerFile.exists()) { + LogManager.log("... JavaDB installer doesn`t exist : " + javadbInstallerFile); + return null; + } + LogManager.log("... found JavaDB windows installer at " + javadbInstallerFile.getPath()); + return javadbInstallerFile; + } + + private File getJREInstallationLocationWindows() { + String suffix; + if(isJDK7()) { + suffix = "7"; + } else if (isJDK6U10orLater()) { + suffix = "6"; + } else { + suffix = getProduct().getVersion().toJdkStyle(); + } + return new File(parseString("$E{ProgramFiles}"), + "Java\\jre" + suffix); + } + private File getJavaDBInstallationLocationWindows() { + return new File(parseString(SUN_JAVADB_DEFAULT_LOCATION)); + } + private long getJREinstallationSize() { + long minorVersion = getProduct().getVersion().getMinor(); + if(minorVersion == 5) { + return 70000000L; + } else if (minorVersion == 6) { + return 90000000L; + } else if (minorVersion == 7) { + return 100000000L; + } else { + return 100000000L; + } + } + private long getJavaDBInstallationSize() { + return 30000000L; + } + private long getJDKinstallationSize() { + final long size; + if(getProduct().getVersion().getMinor()==5) { + if(SystemUtils.isWindows()) { + size = 140000000L ; + } else if(SystemUtils.isLinux()){ + size = 150000000L ; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_SPARC)) { + size = 148000000L; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_X86)) { + size = 140000000L; + } else { + // who knows... + size = 160000000L; + } + } else if(getProduct().getVersion().getMinor()==6) { + if(SystemUtils.isWindows()) { + size = 190000000L ; + } else if(SystemUtils.isLinux()){ + size = 200000000L ; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_SPARC)) { + size = 178000000L; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_X86)) { + size = 170000000L; + } else { + // who knows... + size = 180000000L; + } + } else if(getProduct().getVersion().getMinor()==7) { + if(SystemUtils.isWindows()) { + size = 257000000L ; + } else if(SystemUtils.isLinux()){ + size = 235000000L ; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_SPARC)) { + size = 244000000L; + } else if(SystemUtils.getCurrentPlatform().isCompatibleWith(Platform.SOLARIS_X86)) { + size = 245000000L; + } else { + // who knows... + size = 180000000L; + } + } else { + // who knows... + size = 200000000L; + } + return size; + } + private String getInstallationID(File location) throws NativeException { + String id = null; + WindowsNativeUtils utils = (WindowsNativeUtils)SystemUtils.getNativeUtils(); + WindowsRegistry reg = utils.getWindowsRegistry(); + String [] keyNames = reg.getSubKeyNames(HKLM, utils.UNINSTALL_KEY); + for(String key : keyNames) { + if(key.startsWith("{")) {//all IS-based JDK installations start with this string + if(reg.valueExists(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key, "DisplayIcon") && + reg.valueExists(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key,"UninstallString")) { + // this value is created by JDK/JRE installer + final String icon = reg.getStringValue(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key, "DisplayIcon"); + if(icon.endsWith("\\bin\\javaws.exe") && icon.startsWith(location.getAbsolutePath())) { + String uninstallString = reg.getStringValue(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key,"UninstallString"); + int index = uninstallString.indexOf("/I{"); + if(index==-1) { + index = uninstallString.indexOf("/X{"); + } + if(index!=-1) { + uninstallString = uninstallString.substring(index+2); + if(uninstallString.indexOf("}")!=-1) { + id = uninstallString.substring(0, uninstallString.indexOf("}") + 1); + break; + } + } + } + } + } + + } + return id; + } + private String getJavaDBInstallationID(File location) throws NativeException { + String id = null; + WindowsNativeUtils utils = (WindowsNativeUtils)SystemUtils.getNativeUtils(); + WindowsRegistry reg = utils.getWindowsRegistry(); + String [] keyNames = reg.getSubKeyNames(HKLM, utils.UNINSTALL_KEY); + for(String key : keyNames) { + if(key.startsWith("{")) {//all IS-based JavaDB installations start with this string + if(reg.valueExists(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key, "InstallSource") && + reg.valueExists(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key,"UninstallString") && + reg.valueExists(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key,"URLInfoAbout")) { + // this value is created by JavaDB installer + final String urlAbout = reg.getStringValue(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key, "URLInfoAbout"); + final File source = new File(reg.getStringValue(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key, "InstallSource")); + if(source.equals(location) && urlAbout.equals("http://developers.sun.com/javadb/")) { + String uninstallString = reg.getStringValue(HKLM, utils.UNINSTALL_KEY + reg.SEPARATOR + key,"UninstallString"); + int index = uninstallString.indexOf("/X{"); + if(index!=-1) { + uninstallString = uninstallString.substring(index+2); + if(uninstallString.indexOf("}")!=-1) { + id = uninstallString.substring(0, uninstallString.indexOf("}") + 1); + break; + } + } + } + } + } + + } + return id; + } + + private ExecutionResults runJDKUninstallerWindows(Progress progress, File location) throws UninstallationException { + ExecutionResults results = null; + try{ + String id = getInstallationID(location); + + if(id!=null) { + LogManager.log("... uninstall ID : " + id); + final File logFile = getLog("jdk_uninstall"); + final String [] commands; + if(logFile!=null) { + commands = new String [] {"msiexec.exe", "/qn", "/x", id, "/log", logFile.getAbsolutePath()}; + } else { + commands = new String [] {"msiexec.exe", "/qn", "/x", id}; + } + progress.setDetail(PROGRESS_DETAIL_RUNNING_JDK_UNINSTALLER); + + ProgressThread progressThread = new ProgressThread(progress, + new File[] {location}, -1 * FileUtils.getSize(location)); + try { + progressThread.start(); + return SystemUtils.executeCommand(commands); + } catch (IOException e) { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_UNINSTALL_JDK_ERROR_KEY),e); + } finally { + progressThread.finish(); + } + } else { + LogManager.log("... cannot fing JDK in the uninstall section"); + } + + } catch (NativeException e) { + throw new UninstallationException(ERROR_UNINSTALL_JDK_ERROR_KEY,e); + } finally { + progress.setPercentage(progress.COMPLETE); + } + return results; + } + + private ExecutionResults runJREUninstallerWindows(Progress progress, File location) throws UninstallationException { + ExecutionResults results = null; + try{ + String id = getInstallationID(location); + + if(id!=null) { + LogManager.log("... uninstall ID : " + id); + final File logFile = getLog("jre_uninstall"); + final String [] commands; + if(logFile!=null) { + commands = new String [] {"msiexec.exe", "/qn", "/x", id, "/log", logFile.getAbsolutePath()}; + } else { + commands = new String [] {"msiexec.exe", "/qn", "/x", id}; + } + progress.setDetail(PROGRESS_DETAIL_RUNNING_JRE_UNINSTALLER); + ProgressThread progressThread = new ProgressThread(progress, + new File[] {location}, -1 * FileUtils.getSize(location)); + try { + progressThread.start(); + return SystemUtils.executeCommand(commands); + } catch (IOException e) { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_UNINSTALL_JRE_ERROR_KEY),e); + } finally { + progressThread.finish(); + } + } else { + LogManager.log("... cannot fing JRE in the uninstall section"); + } + + } catch (NativeException e) { + throw new UninstallationException(ERROR_UNINSTALL_JDK_ERROR_KEY,e); + } finally { + progress.setPercentage(progress.COMPLETE); + } + return results; + } + private ExecutionResults runJavaDBUninstallerWindows(Progress progress, File location) throws UninstallationException { + ExecutionResults results = null; + try{ + File msiSourceLocation = new File(getProduct().getProperty(JAVADB_INSTALLER_LOCATION_PROPERTY)); + String id = getJavaDBInstallationID(msiSourceLocation.getParentFile()); + + if(id!=null) { + LogManager.log("... uninstall ID : " + id); + final File logFile = getLog("javadb_uninstall"); + final String [] commands; + if(logFile!=null) { + commands = new String [] {"msiexec.exe", "/qn", "/x", id, "/log", logFile.getAbsolutePath()}; + } else { + commands = new String [] {"msiexec.exe", "/qn", "/x", id}; + } + progress.setDetail(PROGRESS_DETAIL_RUNNING_JAVADB_UNINSTALLER); + ProgressThread progressThread = new ProgressThread(progress, + new File[] {location}, -1 * FileUtils.getSize(location)); + try { + progressThread.start(); + return SystemUtils.executeCommand(commands); + } catch (IOException e) { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_UNINSTALL_JAVADB_ERROR_KEY),e); + } finally { + progressThread.finish(); + } + } else { + LogManager.log("... cannot fing JavaDB in the uninstall section"); + } + + } catch (NativeException e) { + throw new UninstallationException(ERROR_UNINSTALL_JAVADB_ERROR_KEY,e); + } finally { + progress.setPercentage(progress.COMPLETE); + } + return results; + } + @Override + public boolean registerInSystem() { + return false; + } + + private File getLog(String suffix) { + File logFile = LogManager.getLogFile(); + File resultLogFile = null; + + if(logFile!=null) { + String name = logFile.getName(); + + if(name.lastIndexOf(".")==-1) { + name += "_"; + name += suffix; + name += ".log"; + } else { + String ext = name.substring(name.lastIndexOf(".")); + name = name.substring(0, name.lastIndexOf(".")); + name += "_"; + name += suffix; + name += ext; + } + resultLogFile = new File(LogManager.getLogFile().getParentFile(),name); + } + return resultLogFile; + } + public void uninstall( + final Progress progress) throws UninstallationException { + final File location = getProduct().getInstallationLocation(); + ExecutionResults results = null; + if(SystemUtils.isWindows()) { + if("true".equals(getProduct().getProperty(JDK_INSTALLED_WINDOWS_PROPERTY))) { + final CompositeProgress overallProgress = new CompositeProgress(); + overallProgress.synchronizeTo(progress); + overallProgress.synchronizeDetails(true); + + final Progress jdkProgress = new Progress(); + final Progress jreProgress = new Progress(); + final Progress javadbProgress = new Progress(); + + if("true".equals(getProduct().getProperty(JRE_INSTALLED_WINDOWS_PROPERTY))) { + if("true".equals(getProduct().getProperty(JAVADB_INSTALLED_WINDOWS_PROPERTY))) { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 4 / 7 ); + overallProgress.addChild(jreProgress, progress.COMPLETE * 2 / 7); + overallProgress.addChild(javadbProgress, progress.COMPLETE * 1 / 7); + } else { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 3 / 5 ); + overallProgress.addChild(jreProgress, progress.COMPLETE * 2 / 5); + } + } else { + if("true".equals(getProduct().getProperty(JAVADB_INSTALLED_WINDOWS_PROPERTY))) { + overallProgress.addChild(jdkProgress, progress.COMPLETE * 6 / 7 ); + overallProgress.addChild(javadbProgress, progress.COMPLETE * 1 / 7); + } else { + overallProgress.addChild(jdkProgress, progress.COMPLETE); + } + } + + results = runJDKUninstallerWindows(jdkProgress, location); + + if(results!=null) { + if(results.getErrorCode()==0) { + if("true".equals(getProduct().getProperty(JRE_INSTALLED_WINDOWS_PROPERTY))) { + results = runJREUninstallerWindows(jreProgress, JavaUtils.findJreHome(getProduct().getVersion())); + if(results!=null && results.getErrorCode()!=0) { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_JRE_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY, + StringUtils.EMPTY_STRING + results.getErrorCode())); + } + } + if ("true".equals(getProduct().getProperty(JAVADB_INSTALLED_WINDOWS_PROPERTY))) { + final File javadbLocation = new File(parseString(SUN_JAVADB_DEFAULT_LOCATION)); + results = runJavaDBUninstallerWindows(javadbProgress, javadbLocation); + if (results != null && results.getErrorCode() != 0) { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_JAVADB_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY, + StringUtils.EMPTY_STRING + results.getErrorCode())); + } + } + } else { + throw new UninstallationException( + ResourceUtils.getString(ConfigurationLogic.class, + ERROR_JDK_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY, + StringUtils.EMPTY_STRING + results.getErrorCode())); + } + + } + } + } + ///////////////////////////////////////////////////////////////////////////// + progress.setPercentage(Progress.COMPLETE); + } + + public List getWizardComponents() { + return wizardComponents; + } + + @Override + public String getIcon() { + if (SystemUtils.isWindows()) { + return "bin/javaws.exe"; + } else { + return null; + } + } + @Override + public int getLogicPercentage() { + return JDK_INSTALLER_FILE_NAME.isEmpty() ? 10 : 90; + } + + @Override + public boolean allowModifyMode() { + return false; + } + public RemovalMode getRemovalMode() { + return RemovalMode.ALL; + } + + @Override + public String validateInstallation() { + String message = super.validateInstallation(); + if(message==null) { + File jdkLocation = getProduct().getInstallationLocation(); + if(JavaUtils.getInfo(jdkLocation)==null) { + message = "There is no JDK at " + jdkLocation + " or the installation is corrupted"; + } + } + if(message!=null) { + LogManager.log("JDK validation:"); + LogManager.log(message); + getProduct().setStatus(Status.NOT_INSTALLED); + getProduct().getParent().removeChild(getProduct()); + } + return null; + } + class ProgressThread extends NbiThread { + private File [] directories ; + private long deltaSize = 0; + private long initialSize = 0L; + private Progress progress; + private final Object LOCK = new Object(); + private boolean loop = false; + + public ProgressThread(Progress progress, File [] directories, final long maxDeltaSize) { + LogManager.log("... new ProgressThread created"); + this.directories = directories; + for(File directory : directories) { + if(directory.exists()) { + initialSize += FileUtils.getSize(directory); + } + } + this.deltaSize = maxDeltaSize; + this.progress = progress; + LogManager.log("... directories : " + StringUtils.asString(directories)); + LogManager.log("... initial : " + initialSize); + LogManager.log("... delta : " + deltaSize); + } + public void run() { + LogManager.log("... progress thread started"); + long sleepTime = 1000L; + try { + synchronized (LOCK) { + loop = true; + } + while (isRunning()) { + try { + boolean update = false; + for(File directory : directories) { + if (directory.exists()) { + update = true; + } + } + if(update) { + updateProgressBar(); + } + Thread.currentThread().sleep(sleepTime); + } catch (InterruptedException ex) { + LogManager.log(ex); + break; + } catch (Exception ex) { + LogManager.log(ex); + break; + } + } + } finally { + synchronized (LOCK) { + LOCK.notify(); + } + } + progress.setPercentage(Progress.COMPLETE); + LogManager.log("... progress thread finished"); + } + public void finish() { + if(!isRunning()) return; + synchronized (LOCK) { + loop = false; + } + synchronized (LOCK) { + try { + LOCK.wait(); + } catch (InterruptedException e){ + LogManager.log(e); + } + } + } + private boolean isRunning() { + boolean result; + synchronized (LOCK) { + result = loop; + } + return result; + } + private void updateProgressBar() { + //LogManager.log("... get directory size"); + long size = 0; + for(File directory : directories) { + if(directory.exists()) { + size+=FileUtils.getSize(directory); + } + } + //LogManager.log("... size : " + size); + long d = progress.COMPLETE * (size - initialSize) / deltaSize; + //LogManager.log(".... real progress : " + d); + d = progress.getPercentage() + (d - progress.getPercentage() + 1) / 2; + //LogManager.log("... bound progress : " + d); + d = (d<0) ? 0 : (d > progress.COMPLETE ? progress.COMPLETE : d); + if(((int)d) > progress.getPercentage()) { + //LogManager.log("..... set progress : " + d); + progress.setPercentage(d); + } + } + } + @Override + public Text getLicense() { + return null; + } +///////////////////////////////////////////////////////////////////////////////// +// Constants + public static final String WIZARD_COMPONENTS_URI = + "resource:" + // NOI18N + "org/netbeans/installer/products/jdk/wizard.xml"; // NOI18N + + public static final String JDK_INSTALLED_WINDOWS_PROPERTY = + "jdk.win.installed";//NOI18N + public static final String JRE_INSTALLED_WINDOWS_PROPERTY = + "jre.win.installed";//NOI18N + public static final String JAVADB_INSTALLED_WINDOWS_PROPERTY = + "javadb.win.installed";//NOI18N + public static final String JAVADB_INSTALLER_LOCATION_PROPERTY = + "javadb.msi.location";//NOI18N + public static final String JDK_INSTALLER_FILE_NAME = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.jdk.installer.file"); + public static final String JRE_INSTALLER_FILE_NAME = + "{jre-installer-file}"; + public static final String CAB_INSTALLER_FILE_SJ = + "sj170030.cab"; + public static final String CAB_INSTALLER_FILE_SS = + "ss170030.cab"; + public static final String CAB_INSTALLER_FILE_ST = + "st170030.cab"; + public static final String CAB_INSTALLER_FILE_SZ = + "sz170030.cab"; + public static final String ERROR_JDK_INSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.jdk.installation.return.nonzero";//NOI18N + public static final String ERROR_JDK_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.jdk.uninstallation.return.nonzero";//NOI18N + public static final String ERROR_JRE_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.jre.uninstallation.return.nonzero";//NOI18N + public static final String ERROR_JRE_INSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.jre.installation.return.nonzero";//NOI18N + public static final String ERROR_JAVADB_INSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.javadb.installation.return.nonzero";//NOI18N + public static final String ERROR_JAVADB_UNINSTALL_SCRIPT_RETURN_NONZERO_KEY = + "CL.error.javadb.uninstallation.return.nonzero";//NOI18N + public static final String ERROR_INSTALL_JDK_ERROR_KEY = + "CL.error.install.jdk.exception";//NOI18N + public static final String ERROR_UNINSTALL_JDK_ERROR_KEY = + "CL.error.uninstall.jdk.exception";//NOI18N + public static final String ERROR_INSTALL_JRE_ERROR_KEY = + "CL.error.install.jre.exception";//NOI18N + public static final String ERROR_INSTALL_JAVADB_ERROR_KEY = + "CL.error.install.javadb.exception";//NOI18N + public static final String ERROR_UNINSTALL_JAVADB_ERROR_KEY = + "CL.error.uninstall.javadb.exception";//NOI18N + public static final String ERROR_UNINSTALL_JRE_ERROR_KEY = + "CL.error.uninstall.jre.exception";//NOI18N + public static final String ERROR_INSTALL_CANNOT_MOVE_DATA_KEY = + "CL.error.install.cannot.move.data";//NOI18N + public static final String PROGRESS_DETAIL_RUNNING_JDK_INSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.install.jdk"); + public static final String PROGRESS_DETAIL_RUNNING_JRE_INSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.install.jre"); + public static final String PROGRESS_DETAIL_RUNNING_JAVADB_INSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.install.javadb"); + public static final String PROGRESS_DETAIL_RUNNING_JDK_UNINSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.uninstall.jdk"); + public static final String PROGRESS_DETAIL_RUNNING_JRE_UNINSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.uninstall.jre"); + public static final String PROGRESS_DETAIL_RUNNING_JAVADB_UNINSTALLER = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.progress.detail.uninstall.javadb"); + + + public static final String JDK_PATCH_DIRECTORY = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.jdk.patch.directory");//NOI18N + public static final String JDK_DEFAULT_INSTALL_DIR = + ResourceUtils.getString(ConfigurationLogic.class, + "CL.jdk.install.dir");//NOI18N + public static final String JRE_MSI_NAME = + "jre.msi";//NOI18N + public static final String JAVADB_MSI_NAME = + "javadb.msi";//NOI18N + public static final String SUN_JAVADB_DEFAULT_LOCATION = + "$E{ProgramFiles}\\Sun\\JavaDB"; + public static final String NO_REGISTER_JDK_OPTION = + "-noregister"; + public static final String RESTART_IS_REQUIRED_PROPERTY = + "restart.required"; +} diff --git a/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard.xml b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard.xml new file mode 100644 index 000000000000..219b205361b7 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/Bundle.properties b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/Bundle.properties new file mode 100644 index 000000000000..719ea31ccabc --- /dev/null +++ b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/Bundle.properties @@ -0,0 +1,30 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# JDKPanel.java +JDKP.title=Java SE Developer Kit (JDK) {display-version} Installation +JDKP.description=Choose the installation folder for JDK + +JDKP.destination.label.text=&Install the JDK\u2122 to: +JDKP.destination.button.text=B&rowse... + +JDKP.error.space.in.path=JDK cannot be installed in directory with spaces. +#NOI18N +JDKP.jdk.vendor=Oracle Corporation + diff --git a/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/JDKPanel.java b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/JDKPanel.java new file mode 100644 index 000000000000..d264771b7424 --- /dev/null +++ b/nbbuild/installer/components/products/jdk/src/org/netbeans/installer/products/jdk/wizard/panels/JDKPanel.java @@ -0,0 +1,186 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.products.jdk.wizard.panels; + +import java.io.File; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.applications.JavaUtils; +import org.netbeans.installer.utils.helper.Version; +import org.netbeans.installer.wizard.components.actions.SearchForJavaAction; +import org.netbeans.installer.wizard.components.panels.DestinationPanel; +import org.netbeans.installer.wizard.components.panels.DestinationPanel.DestinationPanelUi; +import org.netbeans.installer.wizard.containers.SwingContainer; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; + +/** + * + */ +public class JDKPanel extends DestinationPanel { + public JDKPanel() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + setProperty(DESTINATION_LABEL_TEXT_PROPERTY, + DEFAULT_DESTINATION_LABEL_TEXT); + setProperty(DESTINATION_BUTTON_TEXT_PROPERTY, + DEFAULT_DESTINATION_BUTTON_TEXT); + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new JDKDestinationPanelUi(this); + } + + return wizardUi; + } + + @Override + public void initialize() { + super.initialize(); + // add jdk.getInstallationLocation() to the all java list so that + // in silent installation this location is initialized and used by default + final Object objectContext = getWizard().getContext().get(Product.class); + if (objectContext != null && objectContext instanceof Product) { + Product jdk = (Product) objectContext; + SearchForJavaAction.addJavaLocation( + jdk.getInstallationLocation(), + jdk.getVersion(), + JDK_VENDOR); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class JDKDestinationPanelUi extends DestinationPanelUi { + protected JDKPanel panel; + + public JDKDestinationPanelUi(JDKPanel panel) { + super(panel); + + + this.panel = panel; + } + + @Override + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new JDKDestinationPanelSwingUi(panel, container); + } + + return super.getSwingUi(container); + } + } + + public static class JDKDestinationPanelSwingUi extends DestinationPanelSwingUi { + protected JDKPanel panel; + private Product jdk; + + public JDKDestinationPanelSwingUi( + final JDKPanel panel, + final SwingContainer container) { + super(panel, container); + + this.panel = panel; + } + + // protected //////////////////////////////////////////////////////////////// + @Override + protected void initialize() { + super.initialize(); + final String location = panel.getWizard().getProperty(Product.INSTALLATION_LOCATION_PROPERTY); + if(location!=null) { + final File f = new File(location); + int index = SearchForJavaAction.getJavaLocations().indexOf(f); + if(index!=-1) { + SearchForJavaAction.getJavaLocations().remove(index); + SearchForJavaAction.getJavaLabels().remove(index); + } + JavaUtils.removeJavaInfo(f); + } + } + + @Override + protected void saveInput() { + super.saveInput(); + if ((jdk = getBundledJDK(panel)) != null) { + SearchForJavaAction.addJavaLocation( + jdk.getInstallationLocation(), + jdk.getVersion(), + JDK_VENDOR); + } + } + @Override + protected String validateInput() { + String errorMessage = super.validateInput(); + // don`t allow space path installation since unix JDK installer doesn`t work with that + if(errorMessage == null && !SystemUtils.isWindows() && + getDestinationField().getText().trim().contains(StringUtils.SPACE)) { + errorMessage = ERROR_SPACE_IN_PATH; + } + return errorMessage; + } + + private static Product getBundledJDK(JDKPanel panel) { + final Object objectContext = panel.getWizard().getContext().get(Product.class); + if(objectContext != null && objectContext instanceof Product) { + return (Product) objectContext; + } + return null; + } + + private boolean isJDK8() { + if (getBundledJDK(panel) != null) { + return getBundledJDK(panel).getVersion().newerOrEquals(Version.getVersion("1.8.0")); // NOI18N + } + return false; + } + + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + + public static final String DEFAULT_TITLE = + ResourceUtils.getString(JDKPanel.class, + "JDKP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(JDKPanel.class, + "JDKP.description"); // NOI18N + + public static final String DEFAULT_DESTINATION_LABEL_TEXT = + ResourceUtils.getString(JDKPanel.class, + "JDKP.destination.label.text"); // NOI18N + public static final String DEFAULT_DESTINATION_BUTTON_TEXT = + ResourceUtils.getString(JDKPanel.class, + "JDKP.destination.button.text"); // NOI18N + public static final String JDK_VENDOR = + ResourceUtils.getString(JDKPanel.class, + "JDKP.jdk.vendor"); // NOI18N + public static final String ERROR_SPACE_IN_PATH = + ResourceUtils.getString(JDKPanel.class, + "JDKP.error.space.in.path");//NOI18N +} diff --git a/nbbuild/installer/components/products/nb-all/build.xml b/nbbuild/installer/components/products/nb-all/build.xml new file mode 100644 index 000000000000..fafbe5729ac3 --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/build.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/nbbuild/installer/components/products/nb-all/data/Bundle.properties b/nbbuild/installer/components/products/nb-all/data/Bundle.properties new file mode 100644 index 000000000000..b855534b326e --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/data/Bundle.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +product.display.name=IDE +product.description=Components of an integrated development environment. diff --git a/nbbuild/installer/components/products/nb-all/data/icon.png b/nbbuild/installer/components/products/nb-all/data/icon.png new file mode 100644 index 000000000000..1b3bcd61d25b Binary files /dev/null and b/nbbuild/installer/components/products/nb-all/data/icon.png differ diff --git a/nbbuild/installer/components/products/nb-all/manifest.mf b/nbbuild/installer/components/products/nb-all/manifest.mf new file mode 100644 index 000000000000..636293f5e69a --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/manifest.mf @@ -0,0 +1 @@ +Configuration-Logic-Class: org.netbeans.installer.products.nb.all.ConfigurationLogic diff --git a/nbbuild/installer/components/products/nb-all/nbproject/build-impl.xml b/nbbuild/installer/components/products/nb-all/nbproject/build-impl.xml new file mode 100644 index 000000000000..a7442b4aee5b --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/nbproject/build-impl.xml @@ -0,0 +1,1418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/components/products/nb-all/nbproject/genfiles.properties b/nbbuild/installer/components/products/nb-all/nbproject/genfiles.properties new file mode 100644 index 000000000000..c2d53a83385a --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3973246e +build.xml.script.CRC32=df6e4305 +build.xml.stylesheet.CRC32=a12b3d02 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=273bc314 +nbproject/build-impl.xml.script.CRC32=b421adb5 +nbproject/build-impl.xml.stylesheet.CRC32=a25f357b@1.73.0.48 diff --git a/nbbuild/installer/components/products/nb-all/nbproject/private/private.xml b/nbbuild/installer/components/products/nb-all/nbproject/private/private.xml new file mode 100644 index 000000000000..475096252cac --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/nbbuild/installer/components/products/nb-all/nbproject/project.properties b/nbbuild/installer/components/products/nb-all/nbproject/project.properties new file mode 100644 index 000000000000..d05797dec2cf --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/nbproject/project.properties @@ -0,0 +1,91 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.title=NBI Product: NetBeans Base IDE +application.vendor=jirka +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/logic.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath=\ + ${reference.NBI_Engine.jar}:\ + ${reference.NetBeans_Installer_Engine.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.NBI_Engine=../../../../nbi/engine +project.NetBeans_Installer_Engine=../../../engine +reference.NBI_Engine.jar=${project.NBI_Engine}/dist/nbi-engine.jar +reference.NetBeans_Installer_Engine.jar=${project.NetBeans_Installer_Engine}/dist/nbi-engine.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src diff --git a/nbbuild/installer/components/products/nb-all/nbproject/project.xml b/nbbuild/installer/components/products/nb-all/nbproject/project.xml new file mode 100644 index 000000000000..7faecc6b004f --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/nbproject/project.xml @@ -0,0 +1,52 @@ + + + + org.netbeans.modules.java.j2seproject + + + NBI Product: NetBeans Base IDE + 1.6.5 + + + + + + + + NBI_Engine + jar + + jar + clean + jar + + + NetBeans_Installer_Engine + jar + + jar + clean + jar + + + + diff --git a/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/Bundle.properties b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/Bundle.properties new file mode 100644 index 000000000000..23bb14b05c17 --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/Bundle.properties @@ -0,0 +1,82 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +################################################################################ +# ConfigurationLogic.java +CL.install.jdk.home=Setting the appropriate JDK home +CL.install.netbeans.clusters=Adding IDE clusters to the active clusters list +CL.install.product.id=Creating the productid file +CL.install.license.accepted=Creating the license_accepted marker file +CL.install.irrelevant.files=Removing files irrelevant to the current platform +CL.install.files.permissions=Correcting files permissions +CL.install.desktop=Creating desktop shortcut +CL.install.start.menu=Creating Start Menu entries +CL.install.netbeans.conf=Updating the netbeans.conf file +CL.install.javadb.integration=Integrating the IDE with Java DB +CL.install.javafxsdk.integration=Integrating the IDE with existing JavaFX SDK installations +CL.install.netbeans.update.tracking=Update CRC sums for update tracking files + +CL.uninstall.license.accepted=Removing the license_accepted marker file +CL.uninstall.product.id=Removing the productid file +CL.uninstall.start.menu=Removing desktop shortcut +CL.uninstall.desktop=Removing Start Menu entries +CL.uninstall.update.files=Removing update files +CL.uninstall.remove.userdir=Removing NetBeans userdir +CL.uninstall.remove.cachedir=Removing NetBeans cachedir + +CL.install.error.jdk.home=Cannot set the selected JDK home +CL.install.error.netbeans.clusters=Cannot add NetBeans IDE clusters to the active clusters list +CL.install.error.product.id=Cannot create the productid file +CL.install.error.license.accepted=Cannot create the license_accepted marker file +CL.install.error.irrelevant.files=Cannot completely remove irrelevant files +CL.install.error.files.permissions=Cannot completely correct files permissions +CL.install.error.desktop=Cannot create desktop shortcut +CL.install.error.start.menu=Cannot create Start Menu entries +CL.install.error.netbeans.conf=Cannot update the netbeans.conf file +CL.install.error.javadb.integration=Failed to integrate the IDE with Java DB +CL.install.error.javafxsdk.integration=Failed to integrate the IDE with existing JavaFX SDK installations +CL.install.error.netbeans.update.tracking=Cannot update CRC sums of update tracking files + +CL.uninstall.error.license.accepted=Cannot remove the license_accepted marker file +CL.uninstall.error.product.id=Cannot remove the productid file +CL.uninstall.error.start.menu=Cannot remove desktop shortcut +CL.uninstall.error.desktop=Cannot remove Start Menu entries +CL.uninstall.error.update.files=Cannot remove update files +CL.uninstall.error.registry=Cannot check windows registry: {0} + +# OS Integration ############################################################### +CL.desktop.shortcut.name=Apache NetBeans IDE {display-version} +CL.desktop.shortcut.description=The Smarter Way to Code +CL.desktop.shortcut.path=Apache NetBeans {display-version} + +CL.start.menu.shortcut.name=Apache NetBeans IDE {display-version} +CL.start.menu.shortcut.name.macosx=Apache NetBeans IDE {display-version} +CL.start.menu.shortcut.description=The Smarter Way to Code +CL.start.menu.shortcut.path=Apache NetBeans + +CL.system.display.name=Apache NetBeans IDE {display-version} +#NOI18N +CL.system.display.version={display-version} +#NOI18N +CL.system.publisher=Apache NetBeans +#NOI18N +CL.system.url.about=http://netbeans.apache.org +#NOI18N +CL.system.url.update=http://netbeans.apache.org/downloads/index.html +#NOI18N +CL.system.url.support=http://netbeans.apache.org/help/index.html diff --git a/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/ConfigurationLogic.java b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/ConfigurationLogic.java new file mode 100644 index 000000000000..d1691dbe2782 --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/ConfigurationLogic.java @@ -0,0 +1,942 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.products.nb.all; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.product.components.ProductConfigurationLogic; +import org.netbeans.installer.product.filters.OrFilter; +import org.netbeans.installer.product.filters.ProductFilter; +import org.netbeans.installer.utils.*; +import org.netbeans.installer.utils.applications.JavaUtils; +import org.netbeans.installer.utils.applications.JavaUtils.JavaInfo; +import org.netbeans.installer.utils.applications.NetBeansUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.InstallationException; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.exceptions.UninstallationException; +import org.netbeans.installer.utils.helper.FilesList; +import org.netbeans.installer.utils.helper.RemovalMode; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.Text; +import org.netbeans.installer.utils.progress.Progress; +import org.netbeans.installer.utils.system.shortcut.FileShortcut; +import org.netbeans.installer.utils.system.shortcut.LocationType; +import org.netbeans.installer.utils.system.shortcut.Shortcut; +import org.netbeans.installer.utils.system.windows.WindowsRegistry; +import org.netbeans.installer.wizard.Wizard; +import org.netbeans.installer.wizard.components.WizardComponent; +import org.netbeans.installer.wizard.components.panels.JdkLocationPanel; + +/** + * + */ +public class ConfigurationLogic extends ProductConfigurationLogic { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private List wizardComponents; + + public ConfigurationLogic() throws InitializationException { + wizardComponents = Wizard.loadWizardComponents( + WIZARD_COMPONENTS_URI, + getClass().getClassLoader()); + } + + @Override + public void install(final Progress progress) throws InstallationException { + final Product product = getProduct(); + final File installLocation = product.getInstallationLocation(); + final FilesList filesList = product.getInstalledFiles(); + final boolean hasNestedJre = product.getProperty(JdkLocationPanel.JRE_NESTED) != null; + + ///////////////////////////////////////////////////////////////////////////// + final File jdkHome = new File( + product.getProperty(JdkLocationPanel.JDK_LOCATION_PROPERTY)); + try { + progress.setDetail(getString("CL.install.jdk.home")); // NOI18N + JavaInfo info = JavaUtils.getInfo(jdkHome); + LogManager.log("Using the following JDK for NetBeans configuration : "); + LogManager.log("... path : " + jdkHome); + LogManager.log("... version : " + info.getVersion().toJdkStyle()); + LogManager.log("... vendor : " + info.getVendor()); + LogManager.log("... arch : " + info.getArch()); + LogManager.log("... final : " + (!info.isNonFinal())); + if (hasNestedJre) { + NetBeansUtils.setJavaHome(installLocation, new File(installLocation, JavaUtils.JRE_NESTED_SUBDIR)); + } else { + NetBeansUtils.setJavaHome(installLocation, jdkHome); + } + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.jdk.home"), // NOI18N + e); + } + + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.install.netbeans.clusters")); // NOI18N + for (String clusterName: CLUSTERS) { + File lastModified = new File(new File(installLocation, clusterName), + NetBeansUtils.LAST_MODIFIED_MARKER); + if(!FileUtils.exists(lastModified)) { + filesList.add(lastModified); + } + NetBeansUtils.addCluster(installLocation, clusterName); + } + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.netbeans.clusters"), // NOI18N + e); + } + + // update the update_tracking files information ////////////////////////////// + for (String clusterName: CLUSTERS) { + try { + progress.setDetail(getString( + "CL.install.netbeans.update.tracking", // NOI18N + clusterName)); + + NetBeansUtils.updateTrackingFilesInfo(installLocation, clusterName); + } catch (IOException e) { + throw new InstallationException(getString( + "CL.install.error.netbeans.update.tracking", // NOI18N + clusterName), + e); + } + } + + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.install.product.id")); // NOI18N + + filesList.add(NetBeansUtils.createProductId(installLocation)); + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.product.id"), // NOI18N + e); + } + + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.install.license.accepted")); // NOI18N + filesList.add( + NetBeansUtils.createLicenseAcceptedMarker(installLocation, "")); + + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.license.accepted"), // NOI18N + e); + } + + ///////////////////////////////////////////////////////////////////////////// + //try { + // progress.setDetail(getString("CL.install.irrelevant.files")); // NOI18N + // + // SystemUtils.removeIrrelevantFiles(binSubdir); + // SystemUtils.removeIrrelevantFiles(etcSubdir); + // SystemUtils.removeIrrelevantFiles(platformCluster); + // SystemUtils.removeIrrelevantFiles(nbCluster); + // SystemUtils.removeIrrelevantFiles(ideCluster); + //} catch (IOException e) { + // throw new InstallationException( + // getString("CL.install.error.irrelevant.files"), // NOI18N + // e); + //} + + ///////////////////////////////////////////////////////////////////////////// + //try { + // progress.setDetail(getString("CL.install.files.permissions")); // NOI18N + // + // SystemUtils.correctFilesPermissions(binSubdir); + // SystemUtils.correctFilesPermissions(etcSubdir); + // SystemUtils.correctFilesPermissions(platformCluster); + // SystemUtils.correctFilesPermissions(nbCluster); + // SystemUtils.correctFilesPermissions(ideCluster); + //} catch (IOException e) { + // throw new InstallationException( + // getString("CL.install.error.files.permissions"), // NOI18N + // e); + //} + + ///////////////////////////////////////////////////////////////////////////// + LogManager.logIndent( + "creating the desktop shortcut for NetBeans IDE"); // NOI18N + if (!SystemUtils.isMacOS()) { + try { + progress.setDetail(getString("CL.install.desktop")); // NOI18N + + if (SystemUtils.isCurrentUserAdmin()) { + LogManager.log( + "... current user is an administrator " + // NOI18N + "-- creating the shortcut for all users"); // NOI18N + + SystemUtils.createShortcut( + getDesktopShortcut(installLocation), + LocationType.ALL_USERS_DESKTOP); + + getProduct().setProperty( + DESKTOP_SHORTCUT_LOCATION_PROPERTY, + ALL_USERS_PROPERTY_VALUE); + } else { + LogManager.log( + "... current user is an ordinary user " + // NOI18N + "-- creating the shortcut for the current " + // NOI18N + "user only"); // NOI18N + + SystemUtils.createShortcut( + getDesktopShortcut(installLocation), + LocationType.CURRENT_USER_DESKTOP); + + getProduct().setProperty( + DESKTOP_SHORTCUT_LOCATION_PROPERTY, + CURRENT_USER_PROPERTY_VALUE); + } + } catch (NativeException e) { + LogManager.unindent(); + + LogManager.log( + getString("CL.install.error.desktop"), // NOI18N + e); + } + } else { + LogManager.log( + "... skipping this step as we're on Mac OS"); // NOI18N + } + LogManager.logUnindent( + "... done"); // NOI18N + + ///////////////////////////////////////////////////////////////////////////// + LogManager.logIndent( + "creating the start menu shortcut for NetBeans IDE"); // NOI18N + try { + progress.setDetail(getString("CL.install.start.menu")); // NOI18N + + if (SystemUtils.isCurrentUserAdmin()) { + LogManager.log( + "... current user is an administrator " + // NOI18N + "-- creating the shortcut for all users"); // NOI18N + + SystemUtils.createShortcut( + getStartMenuShortcut(installLocation), + LocationType.ALL_USERS_START_MENU); + + getProduct().setProperty( + START_MENU_SHORTCUT_LOCATION_PROPERTY, + ALL_USERS_PROPERTY_VALUE); + } else { + LogManager.log( + "... current user is an ordinary user " + // NOI18N + "-- creating the shortcut for the current " + // NOI18N + "user only"); // NOI18N + + SystemUtils.createShortcut( + getStartMenuShortcut(installLocation), + LocationType.CURRENT_USER_START_MENU); + + getProduct().setProperty( + START_MENU_SHORTCUT_LOCATION_PROPERTY, + CURRENT_USER_PROPERTY_VALUE); + } + } catch (NativeException e) { + LogManager.log( + getString("CL.install.error.start.menu"), // NOI18N + e); + } + LogManager.logUnindent( + "... done"); // NOI18N + + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.install.netbeans.conf")); // NOI18N + + NetBeansUtils.updateNetBeansHome(installLocation); + + // final long xmx = NetBeansUtils.getJvmMemorySize( + // installLocation, + // NetBeansUtils.MEMORY_XMX); + // if (xmx < REQUIRED_XMX_VALUE) { + // NetBeansUtils.setJvmMemorySize( + // installLocation, + // NetBeansUtils.MEMORY_XMX, + // REQUIRED_XMX_VALUE); + // } + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.netbeans.conf"), // NOI18N + e); + } + + // register JavaDB if available + File javadbLocation = null; + boolean javadbRegistered = false; + if(SystemUtils.isWindows()) { + javadbLocation = new File(System.getenv("PROGRAMFILES"), "Sun\\JavaDB"); + } + if (javadbLocation == null || ! javadbLocation.exists()) { + if (JavaUtils.isJdk(jdkHome)) { + javadbLocation = new File(jdkHome, "db"); + } + } + + if(javadbLocation != null && javadbLocation.isDirectory()) { + try { + LogManager.log("... integrate " + getSystemDisplayName() + " with Java DB installed at " + javadbLocation); + javadbRegistered = registerJavaDB(installLocation, javadbLocation); + // Derby registration creates this file (see #234759) + File lastModified = new File(installLocation, "nb/var/cache/lastmodified/all-checksum.txt"); + if (lastModified.exists()) { + File actual = lastModified; + do { + filesList.add(actual); + actual = actual.getParentFile(); + } while (!actual.getName().equals("nb")); // NOI18N + } + if (! javadbRegistered) { + LogManager.log("... ... Java DB wasn't registred."); + } + } catch (IOException e) { + LogManager.log("Cannot register JavaDB available at " + javadbLocation, e); + } + } + + //get bundled registry to perform further runtime integration + //http://wiki.netbeans.org/NetBeansInstallerIDEAndRuntimesIntegration + Registry bundledRegistry = new Registry(); + try { + final String bundledRegistryUri = System.getProperty( + Registry.BUNDLED_PRODUCT_REGISTRY_URI_PROPERTY); + + bundledRegistry.loadProductRegistry( + (bundledRegistryUri != null) ? bundledRegistryUri : Registry.DEFAULT_BUNDLED_PRODUCT_REGISTRY_URI); + } catch (InitializationException e) { + LogManager.log("Cannot load bundled registry", e); + } + + if (! javadbRegistered) { + + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.install.javadb.integration")); // NOI18N + + + final List glassfishes = + Registry.getInstance().queryProducts(new OrFilter( + new ProductFilter("glassfish-mod-sun", Registry.getInstance().getTargetPlatform()), + new ProductFilter("glassfish-mod", Registry.getInstance().getTargetPlatform()))); + + Product productToIntegrate = null; + for (Product glassfish : glassfishes) { + final Product bundledProduct = bundledRegistry.getProduct( + glassfish.getUid(), glassfish.getVersion()); + if (glassfish.getStatus() == Status.INSTALLED && bundledProduct != null) { + final File location = glassfish.getInstallationLocation(); + if (location != null && FileUtils.exists(location) && !FileUtils.isEmpty(location)) { + productToIntegrate = glassfish; + break; + } + } + } + if (productToIntegrate == null) { + for (Product glassfish : glassfishes) { + if (glassfish.getStatus() == Status.INSTALLED) { + final File location = glassfish.getInstallationLocation(); + if (location != null && FileUtils.exists(location) && !FileUtils.isEmpty(location)) { + productToIntegrate = glassfish; + break; + } + } + } + } + if (productToIntegrate != null) { + final File location = productToIntegrate.getInstallationLocation(); + LogManager.log("... integrate " + getSystemDisplayName() + " with Java DB installed at " + location); + boolean passed = registerJavaDB(installLocation, new File(location, "javadb")); + if (! passed) { + LogManager.log("... ... Java DB wasn't registred."); + } + } + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.javadb.integration"), // NOI18N + e); + } finally { + progress.setDetail(StringUtils.EMPTY_STRING); // NOI18N + } + ///////////////////////////////////////////////////////////////////////////// + + } + + try { + progress.setDetail(getString("CL.install.javafxsdk.integration")); // NOI18N + + final List javafxsdks = + Registry.getInstance().queryProducts( + new ProductFilter("javafxsdk", Registry.getInstance().getTargetPlatform())); + + Product productToIntegrate = null; + for (Product javafxsdk : javafxsdks) { + final Product bundledProduct = bundledRegistry.getProduct( + javafxsdk.getUid(), javafxsdk.getVersion()); + if (javafxsdk.getStatus() == Status.INSTALLED && bundledProduct != null) { + final File fxsdkLocation = javafxsdk.getInstallationLocation(); + final File fxrtLocation = + new File(SystemUtils.resolveString(javafxsdk.getProperty(JAVAFX_RUNTIME_INSTALLATION_LOCATION_PROPERTY))); + if (fxsdkLocation != null && fxrtLocation != null && + FileUtils.exists(fxsdkLocation) && !FileUtils.isEmpty(fxsdkLocation) && + FileUtils.exists(fxrtLocation) && !FileUtils.isEmpty(fxrtLocation)) { + productToIntegrate = javafxsdk; + break; + } + } + } + if (productToIntegrate == null) { + for (Product javafxsdk : javafxsdks) { + if (javafxsdk.getStatus() == Status.INSTALLED) { + final File fxsdkLocation = javafxsdk.getInstallationLocation(); + final File fxrtLocation = + new File(SystemUtils.resolveString(javafxsdk.getProperty(JAVAFX_RUNTIME_INSTALLATION_LOCATION_PROPERTY))); + if (fxsdkLocation != null && fxrtLocation != null && + FileUtils.exists(fxsdkLocation) && !FileUtils.isEmpty(fxsdkLocation) && + FileUtils.exists(fxrtLocation) && !FileUtils.isEmpty(fxrtLocation)) { + productToIntegrate = javafxsdk; + break; + } + } + } + } + if (productToIntegrate != null) { + final File fxsdkLocation = productToIntegrate.getInstallationLocation(); + final File fxrtLocation = + new File(SystemUtils.resolveString(productToIntegrate.getProperty(JAVAFX_RUNTIME_INSTALLATION_LOCATION_PROPERTY))); + LogManager.log("... integrate " + getSystemDisplayName() + " with " + productToIntegrate.getDisplayName() + + " installed at " + fxsdkLocation + " and " + fxrtLocation); + registerJavaFX(installLocation, fxsdkLocation, fxrtLocation); + } + } catch (IOException e) { + throw new InstallationException( + getString("CL.install.error.javafxsdk.integration"), // NOI18N + e); + } finally { + progress.setDetail(StringUtils.EMPTY_STRING); // NOI18N + } + + ///////////////////////////////////////////////////////////////////////////// + try { + final List jdks = Registry.getInstance().getProducts("jdk"); + for (Product jdk : jdks) { + // if the IDE was installed in the same session as the jdk, + // we should add jdk`s "product id" to the IDE + if (jdk.getStatus().equals(Status.INSTALLED) && jdk.hasStatusChanged()) { + NetBeansUtils.addPackId(installLocation, JDK_PRODUCT_ID); + break; + } + } + } catch (IOException e) { + LogManager.log("Cannot add jdk`s id to netbeans productid file", e); + } + + try { + //IDE Registartion files + final File nbCluster = NetBeansUtils.getNbCluster(installLocation); + filesList.add(new File(nbCluster,"servicetag/registration.xml")); + filesList.add(new File(nbCluster,"servicetag/servicetag")); + filesList.add(new File(nbCluster,"servicetag")); + + //core.properties file is required for usage statistics settings + File coreProp = new File(nbCluster,NetBeansUtils.CORE_PROPERTIES); + filesList.add(coreProp); + filesList.add(coreProp.getParentFile()); + filesList.add(coreProp.getParentFile().getParentFile()); + filesList.add(coreProp.getParentFile().getParentFile().getParentFile()); + + //GlassFish v3/Tomcat integration files + filesList.add(new File (nbCluster, "config/GlassFishEE6WC/Instances/.nbattrs")); + filesList.add(new File (nbCluster, "config/GlassFishEE6WC/Instances/glassfish_autoregistered_instance")); + filesList.add(new File (nbCluster, "config/GlassFishEE6WC/Instances")); + filesList.add(new File (nbCluster, "config/GlassFishEE6WC")); + filesList.add(new File (nbCluster, "config/GlassFishEE6/Instances/.nbattrs")); + filesList.add(new File (nbCluster, "config/GlassFishEE6/Instances/glassfish_autoregistered_instance")); + filesList.add(new File (nbCluster, "config/GlassFishEE6/Instances")); + filesList.add(new File (nbCluster, "config/GlassFishEE6")); + filesList.add(new File (nbCluster, "config/J2EE/InstalledServers/.nbattrs")); + filesList.add(new File (nbCluster, "config/J2EE/InstalledServers/tomcat_autoregistered_instance")); + filesList.add(new File (nbCluster, "config/J2EE/InstalledServers")); + filesList.add(new File (nbCluster, "config/J2EE")); + filesList.add(new File (nbCluster, "config/JavaDB/registration_instance")); + filesList.add(new File (nbCluster, "config/JavaDB/.nbattrs")); + filesList.add(new File (nbCluster, "config/JavaDB")); + + //JavaFX integration files + filesList.add(new File (nbCluster, "config/JavaFX/Instances/javafx_sdk_autoregistered_instance")); + filesList.add(new File (nbCluster, "config/JavaFX/Instances/.nbattrs")); + filesList.add(new File (nbCluster, "config/JavaFX/Instances")); + filesList.add(new File (nbCluster, "config/JavaFX")); + } catch (IOException e) { + LogManager.log(e); + } + + product.setProperty("installation.timestamp", new Long(System.currentTimeMillis()).toString()); + + ///////////////////////////////////////////////////////////////////////////// + progress.setPercentage(Progress.COMPLETE); + } + + private boolean registerJavaDB(File nbLocation, File javadbLocation) throws IOException { + if(!FileUtils.exists(javadbLocation)) { + LogManager.log("Requested to register JavaDB at " + javadbLocation + " but can't find it"); + return false; + } + File javaExe = JavaUtils.getExecutable(SystemUtils.getCurrentJavaHome()); + String [] cp = { + "platform/core/core.jar", + "platform/lib/boot.jar", + "platform/lib/org-openide-modules.jar", + "platform/core/org-openide-filesystems.jar", + "platform/lib/org-openide-util.jar", + "platform/lib/org-openide-util-lookup.jar", + "ide/modules/org-netbeans-modules-derby.jar" + }; + for(String c : cp) { + File f = new File(nbLocation, c); + if(!FileUtils.exists(f)) { + LogManager.log("... cannot find jar required for JavaDB integration: " + f); + return false; + } + } + String mainClass = "org.netbeans.modules.derby.DerbyRegistration"; + List commands = new ArrayList (); + commands.add(javaExe.getAbsolutePath()); + commands.add("-cp"); + commands.add(StringUtils.asString(cp, File.pathSeparator)); + commands.add(mainClass); + commands.add(new File(nbLocation, "nb").getAbsolutePath()); + commands.add(javadbLocation.getAbsolutePath()); + return SystemUtils.executeCommand(nbLocation, commands.toArray(new String [] {})).getErrorCode() == 0; + } + + private boolean registerJavaFX(File nbLocation, File sdkLocation, File reLocation) throws IOException { + File javaExe = JavaUtils.getExecutable(new File(System.getProperty("java.home"))); + String [] cp = { + "platform/core/core.jar", + "platform/lib/boot.jar", + "platform/lib/org-openide-modules.jar", + "platform/core/org-openide-filesystems.jar", + "platform/lib/org-openide-util.jar", + "platform/lib/org-openide-util-lookup.jar", + "javafx/modules/org-netbeans-modules-javafx2-platform.jar" + }; + for(String c : cp) { + File f = new File(nbLocation, c); + if(!FileUtils.exists(f)) { + LogManager.log("... cannot find jar required for JavaFX integration: " + f); + return false; + } + } + String mainClass = "org.netbeans.modules.javafx2.platform.registration.AutomaticRegistration"; + List commands = new ArrayList (); + File nbCluster = new File(nbLocation, "nb"); + commands.add(javaExe.getAbsolutePath()); + commands.add("-cp"); + commands.add(StringUtils.asString(cp, File.pathSeparator)); + commands.add(mainClass); + commands.add(nbCluster.getAbsolutePath()); + commands.add(sdkLocation.getAbsolutePath()); + commands.add(reLocation.getAbsolutePath()); + return SystemUtils.executeCommand(nbLocation, commands.toArray(new String[]{})).getErrorCode() == 0; + } + + + @Override + public void uninstall(final Progress progress) throws UninstallationException { + final Product product = getProduct(); + final File installLocation = product.getInstallationLocation(); + + NetBeansUtils.warnNetbeansRunning(installLocation); + ///////////////////////////////////////////////////////////////////////////// + try { + progress.setDetail(getString("CL.uninstall.start.menu")); // NOI18N + + final String shortcutLocation = + getProduct().getProperty(START_MENU_SHORTCUT_LOCATION_PROPERTY); + + if ((shortcutLocation == null) || + shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) { + SystemUtils.removeShortcut( + getStartMenuShortcut(installLocation), + LocationType.CURRENT_USER_START_MENU, + true); + } else { + SystemUtils.removeShortcut( + getStartMenuShortcut(installLocation), + LocationType.ALL_USERS_START_MENU, + true); + } + } catch (NativeException e) { + LogManager.log( + getString("CL.uninstall.error.start.menu"), // NOI18N + e); + } + + ///////////////////////////////////////////////////////////////////////////// + if (!SystemUtils.isMacOS()) { + try { + progress.setDetail(getString("CL.uninstall.desktop")); // NOI18N + + final String shortcutLocation = getProduct().getProperty( + DESKTOP_SHORTCUT_LOCATION_PROPERTY); + + if ((shortcutLocation == null) || + shortcutLocation.equals(CURRENT_USER_PROPERTY_VALUE)) { + SystemUtils.removeShortcut( + getDesktopShortcut(installLocation), + LocationType.CURRENT_USER_DESKTOP, + false); + } else { + SystemUtils.removeShortcut( + getDesktopShortcut(installLocation), + LocationType.ALL_USERS_DESKTOP, + false); + } + } catch (NativeException e) { + LogManager.log( + getString("CL.uninstall.error.desktop"), // NOI18N + e); + } + } + + if (SystemUtils.isWindows()) { + checkAndDeleteWindowsRegistry(installLocation.getAbsolutePath()); + } + + product.setProperty("uninstallation.timestamp", + new Long(System.currentTimeMillis()).toString()); + + if (Boolean.getBoolean("remove.netbeans.userdir")) { + try { + progress.setDetail(getString("CL.uninstall.remove.userdir")); // NOI18N + LogManager.logIndent("Removing NetBeans userdir... "); + File userDir = NetBeansUtils.getNetBeansUserDirFile(installLocation); + LogManager.log("... NetBeans userdir location : " + userDir); + if (FileUtils.exists(userDir) && FileUtils.canWrite(userDir)) { + FileUtils.deleteFile(userDir, true); + } + LogManager.log("... NetBeans userdir totally removed"); + } catch (IOException e) { + LogManager.log("Can`t remove NetBeans userdir", e); + } finally { + LogManager.unindent(); + } + try { + progress.setDetail(getString("CL.uninstall.remove.cachedir")); // NOI18N + LogManager.logIndent("Removing NetBeans cachedir... "); + File cacheDir = NetBeansUtils.getNetBeansCacheDirFile(installLocation); + LogManager.log("... NetBeans cachedir location : " + cacheDir); + if (FileUtils.exists(cacheDir) && FileUtils.canWrite(cacheDir)) { + FileUtils.deleteFile(cacheDir, true); + } + LogManager.log("... NetBeans cachedir totally removed"); + } catch (IOException e) { + LogManager.log("Can`t remove NetBeans cachedir", e); + } finally { + LogManager.unindent(); + } + } + + ///////////////////////////////////////////////////////////////////////////// + //remove cluster/update files + try { + progress.setDetail(getString("CL.uninstall.update.files")); // NOI18N + for(String cluster : CLUSTERS) { + File updateDir = new File(installLocation, cluster + File.separator + "update"); + if ( updateDir.exists()) { + FileUtils.deleteFile(updateDir, true); + } + } + } catch (IOException e) { + LogManager.log( + getString("CL.uninstall.error.update.files"), // NOI18N + e); + } + + ///////////////////////////////////////////////////////////////////////////// + progress.setPercentage(Progress.COMPLETE); + } + + @Override + public List getWizardComponents() { + return wizardComponents; + } + + @Override + public String getSystemDisplayName() { + return getString("CL.system.display.name"); + } + + @Override + public boolean allowModifyMode() { + return false; + } + + @Override + public boolean wrapForMacOs() { + return true; + } + + @Override + public String getExecutable() { + File jdkHome = new File(getProduct().getProperty(JdkLocationPanel.JDK_LOCATION_PROPERTY)); + JavaInfo javaInfo = JavaUtils.getInfo(jdkHome); + + if (SystemUtils.isWindows()) { + String javaArch = ""; + if (javaInfo != null) { + if (javaInfo.getArch().isEmpty()) { + javaInfo = JavaUtils.getInfo(jdkHome, true); + if (javaInfo != null) { + javaArch = javaInfo.getArch(); + } + } else { + javaArch = javaInfo.getArch(); + } + } + if (javaArch.endsWith("64")) { + return EXECUTABLE_WINDOWS_64; + } else { + return EXECUTABLE_WINDOWS; + } + } else { + return EXECUTABLE_UNIX; + } + } + + @Override + public String getIcon() { + if (SystemUtils.isWindows()) { + return ICON_WINDOWS; + } else if (SystemUtils.isMacOS()) { + return ICON_MACOSX; + } else { + return ICON_UNIX; + } + } + + @Override + public Text getLicense() { + return null; + } + // private ////////////////////////////////////////////////////////////////////// + private Shortcut getDesktopShortcut(final File directory) { + return getShortcut( + getStrings("CL.desktop.shortcut.name"), // NOI18N + getStrings("CL.desktop.shortcut.description"), // NOI18N + getString("CL.desktop.shortcut.path"), // NOI18N + directory); + } + + private Shortcut getStartMenuShortcut(final File directory) { + if (SystemUtils.isMacOS()) { + return getShortcut( + getStrings("CL.start.menu.shortcut.name.macosx"), // NOI18N + getStrings("CL.start.menu.shortcut.description"), // NOI18N + getString("CL.start.menu.shortcut.path"), // NOI18N + directory); + } else { + return getShortcut( + getStrings("CL.start.menu.shortcut.name"), // NOI18N + getStrings("CL.start.menu.shortcut.description"), // NOI18N + getString("CL.start.menu.shortcut.path"), // NOI18N + directory); + } + } + + private Shortcut getShortcut( + final Map names, + final Map descriptions, + final String relativePath, + final File location) { + final File icon; + final File executable; + + if (SystemUtils.isWindows()) { + icon = new File(location, ICON_WINDOWS); + } else if (SystemUtils.isMacOS()) { + icon = new File(location, ICON_MACOSX); + } else { + icon = new File(location, ICON_UNIX); + } + + executable = new File(location, getExecutable()); + final String name = names.get(new Locale(StringUtils.EMPTY_STRING)); + final FileShortcut shortcut = new FileShortcut(name, executable); + shortcut.setNames(names); + shortcut.setDescriptions(descriptions); + shortcut.setCategories(SHORTCUT_CATEGORIES); + shortcut.setFileName(SHORTCUT_FILENAME); + shortcut.setIcon(icon); + shortcut.setRelativePath(relativePath); + shortcut.setWorkingDirectory(location); + shortcut.setModifyPath(true); + + return shortcut; + } + + private void checkAndDeleteWindowsRegistry(String installLocation) { + final int HKEY = WindowsRegistry.HKEY_CLASSES_ROOT; + final String KEY_ROOT = "Applications"; + final String KEY_ENDS[] = {"netbeans.exe\\shell\\open\\command", + "netbeans64.exe\\shell\\open\\command"}; + + final WindowsRegistry windowsRegistry = new WindowsRegistry(); + + LogManager.log("Checking windows registry"); + + for (String key : KEY_ENDS) { + String fullKey = KEY_ROOT + WindowsRegistry.SEPARATOR + key; + try { + if (windowsRegistry.keyExists(HKEY, fullKey)) { + final String value = windowsRegistry.getStringValue(HKEY, fullKey, StringUtils.EMPTY_STRING); + + String launcherPath = getLauncherPathFromRegistryValue(value); + + File launcher = new File(launcherPath); + if (!launcher.exists() || launcherPath.startsWith(installLocation)) { + while (!fullKey.equals(KEY_ROOT)) { + windowsRegistry.deleteKey(HKEY, fullKey); + LogManager.log("... key deleted : " + fullKey); + fullKey = fullKey.substring(0, fullKey.lastIndexOf("\\")); + } + } + } + } catch (NativeException e) { + LogManager.log( + getString("CL.uninstall.error.registry", "HKEY_CLASSES_ROOT" + WindowsRegistry.SEPARATOR + fullKey), // NOI18N + e); + } + } + } + + private String getLauncherPathFromRegistryValue(String value) { + String splittedRegistry[] = value.split("\""); + if (splittedRegistry.length > 2) { + return splittedRegistry[1]; + } else { + return StringUtils.EMPTY_STRING; + } + } + + @Override + public RemovalMode getRemovalMode() { + if(Boolean.getBoolean("remove.netbeans.installdir")) { + return RemovalMode.ALL; + } + return RemovalMode.LIST; + } + + @Override + public Map getAdditionalSystemIntegrationInfo() { + Map map = super.getAdditionalSystemIntegrationInfo(); + if (SystemUtils.isWindows()) { + //TODO: get localized readme if it is available and matches current locale + String readme = new File(getProduct().getInstallationLocation(), "readme.html").getAbsolutePath(); + map.put("DisplayVersion", getString("CL.system.display.version")); + map.put("Publisher", getString("CL.system.publisher")); + map.put("URLInfoAbout", getString("CL.system.url.about")); + map.put("URLUpdateInfo", getString("CL.system.url.update")); + map.put("HelpLink", getString("CL.system.url.support")); + map.put("Readme", readme); + } + return map; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String WIZARD_COMPONENTS_URI = + FileProxy.RESOURCE_SCHEME_PREFIX + // NOI18N + "org/netbeans/installer/products/nb/all/wizard.xml"; // NOI18N + + public static final String BIN_SUBDIR = + "netbeans/bin"; // NOI18N + public static final String ETC_SUBDIR = + "netbeans/etc"; // NOI18N + + public static final String PLATFORM_CLUSTER = + "{platform-cluster}"; // NOI18N + public static final String NB_CLUSTER = + "{nb-cluster}"; // NOI18N + public static final String IDE_CLUSTER = + "{ide-cluster}"; // NOI18N +// public static final String EXTRA_CLUSTER = +// "{extra-cluster}"; // NOI18N + public static final String [] CLUSTERS = new String [] { + PLATFORM_CLUSTER, + NB_CLUSTER, + IDE_CLUSTER, + /*EXTRA_CLUSTER*/}; + + public static final String EXECUTABLE_WINDOWS = + BIN_SUBDIR + "/netbeans.exe"; // NOI18N + public static final String EXECUTABLE_WINDOWS_64 = + BIN_SUBDIR + "/netbeans64.exe"; // NOI18N + public static final String EXECUTABLE_UNIX = + BIN_SUBDIR + "/netbeans"; // NOI18N + + public static final String ICON_WINDOWS = + EXECUTABLE_WINDOWS; + public static final String ICON_UNIX = + "/netbeans/" + NB_CLUSTER + "/netbeans.png"; // NOI18N + public static final String ICON_MACOSX = + "/netbeans/" + NB_CLUSTER + "/netbeans.icns"; // NOI18N + + public static final String SHORTCUT_FILENAME = + "Apache NetBeans-{display-version}.desktop"; // NOI18N + public static final String[] SHORTCUT_CATEGORIES = new String[] { + "Application", + "Development", // NOI18N + "Java",// NOI18N + "IDE"// NOI18N + }; + public static final String JDK_PRODUCT_ID = + "JDK";//NOI18N + public static final String GLASSFISH_JVM_OPTION_NAME = + "-Dcom.sun.aas.installRoot"; // NOI18N + + public static final long REQUIRED_XMX_VALUE = + 192 * NetBeansUtils.M; + + private static final String DESKTOP_SHORTCUT_LOCATION_PROPERTY = + "desktop.shortcut.location"; // NOI18N + + private static final String START_MENU_SHORTCUT_LOCATION_PROPERTY = + "start.menu.shortcut.location"; // NOI18N + + private static final String ALL_USERS_PROPERTY_VALUE = + "all.users"; // NOI18N + + private static final String CURRENT_USER_PROPERTY_VALUE = + "current.user"; // NOI18N + + public static final String JAVAFX_RUNTIME_INSTALLATION_LOCATION_PROPERTY = + "javafx.runtime.installation.location"; // NOI18N +} diff --git a/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard.xml b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard.xml new file mode 100644 index 000000000000..122e741d4afc --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/Bundle.properties b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/Bundle.properties new file mode 100644 index 000000000000..5beb9674fb34 --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/Bundle.properties @@ -0,0 +1,35 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# NbPanel.java +NBP.title=Apache NetBeans IDE {display-version} Installation +NBP.description=Choose the installation folder and JDK\u2122. +NBP.description.java=Choose the installation folder and Java\u2122 environment. + +NBP.destination.label.text=&Install the Apache NetBeans IDE to: +NBP.destination.button.text=B&rowse... + +NBP.jdk.location.label.text=&JDK\u2122 for the Apache NetBeans IDE: +NBP.java.location.label.text=&Java\u2122 environment for the Apache NetBeans IDE: +NBP.browse.button.text=Br&owse... + +NBP.warning.install.into.userdir=It is not recommended to install NetBeans into folder which is commonly used to store its settings ({0}). +NBP.warning.jdk.not.recommended.version=This JDK version is older than the recommended JDK 7u10. For stability reasons we recommend that you download and install the latest JDK 7 update from {0} and restart NetBeans installer. +NBP.warning.jdk.not.recommended.architecture=A 32-bit JDK is selected. For improved performance on your 64-bit system, please use the 64-bit version of Java. Download at {0} and restart Apache NetBeans installer. +NBP.error.contains.non.ascii.chars=The specified installation location cannot contain non-ASCII characters. diff --git a/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/NbPanel.java b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/NbPanel.java new file mode 100644 index 000000000000..c685de7e8a5a --- /dev/null +++ b/nbbuild/installer/components/products/nb-all/src/org/netbeans/installer/products/nb/all/wizard/panels/NbPanel.java @@ -0,0 +1,577 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.products.nb.all.wizard.panels; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.io.File; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; +import java.util.List; +import javax.swing.ComboBoxModel; +import javax.swing.JFileChooser; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.event.HyperlinkListener; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.BrowserUtils; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.helper.Text; +import org.netbeans.installer.utils.helper.Version; +import org.netbeans.installer.utils.helper.swing.NbiButton; +import org.netbeans.installer.utils.helper.swing.NbiComboBox; +import org.netbeans.installer.utils.helper.swing.NbiDirectoryChooser; +import org.netbeans.installer.utils.helper.swing.NbiLabel; +import org.netbeans.installer.utils.helper.swing.NbiTextField; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import org.netbeans.installer.wizard.components.panels.ApplicationLocationPanel.LocationValidator; +import org.netbeans.installer.wizard.components.panels.ApplicationLocationPanel.LocationsComboBoxEditor; +import org.netbeans.installer.wizard.components.panels.ApplicationLocationPanel.LocationsComboBoxModel; +import org.netbeans.installer.wizard.components.panels.DestinationPanel; +import org.netbeans.installer.wizard.components.panels.DestinationPanel.DestinationPanelUi; +import org.netbeans.installer.wizard.components.panels.JdkLocationPanel; +import org.netbeans.installer.wizard.containers.SwingContainer; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; + +/** + * + */ +public class NbPanel extends DestinationPanel { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private JdkLocationPanel jdkLocationPanel; + private boolean hasNestedJre = false; + + public NbPanel() { + jdkLocationPanel = new JdkLocationPanel(); + + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + setProperty(DESTINATION_LABEL_TEXT_PROPERTY, + DEFAULT_DESTINATION_LABEL_TEXT); + setProperty(DESTINATION_BUTTON_TEXT_PROPERTY, + DEFAULT_DESTINATION_BUTTON_TEXT); + + setProperty(JDK_LOCATION_LABEL_TEXT_PROPERTY, + DEFAULT_JDK_LOCATION_LABEL_TEXT); + setProperty(BROWSE_BUTTON_TEXT_PROPERTY, + DEFAULT_BROWSE_BUTTON_TEXT); + setProperty(WARNING_INSTALL_INTO_USERDIR_PROPERTY, + DEFAULT_WARNING_INSTALL_INTO_USERDIR); + setProperty(WARNING_JDK_NOT_RECOMMENDED_VERSION, + DEFAULT_WARNING_JDK_NOT_RECOMMENDED_VERSION); + setProperty(WARNING_JDK_NOT_RECOMMENDED_ARCHITECTURE, + DEFAULT_WARNING_JDK_NOT_RECOMMENDED_ARCHITECTURE); + + setProperty(ERROR_CONTAINS_NON_ASCII_CHARS, + DEFAULT_ERROR_CONTAINS_NON_ASCII_CHARS); + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new NbDestinationPanelUi(this); + } + + return wizardUi; + } + + @Override + public void initialize() { + super.initialize(); + + jdkLocationPanel.setWizard(getWizard()); + + //first, initialize the min and max values with the panel`s default + //second, check if nbProduct has the properties set + //third, check other nb- products if they have these properties set + String minVersionNbBase = getProperty(JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY); + String maxVersionNbBase = getProperty(JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY); + String preferredVersion = getProperty(JdkLocationPanel.PREFERRED_JDK_VERSION_PROPERTY); + String jreAllowedStr = getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY); + + Version min = (minVersionNbBase != null) ? Version.getVersion(minVersionNbBase) : null; + Version max = (maxVersionNbBase != null) ? Version.getVersion(maxVersionNbBase) : null; + Version preferred = (preferredVersion != null) ? Version.getVersion(preferredVersion) : null; + boolean jreAllowed = !"false".equals(jreAllowedStr); // if nothing defined - then true + + if (getWizard().getProperty(JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY) != null) { + min = Version.getVersion(getWizard().getProperty(JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY)); + } + if (getWizard().getProperty(JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY) != null) { + max = Version.getVersion(getWizard().getProperty(JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY)); + } + if (getWizard().getProperty(JdkLocationPanel.PREFERRED_JDK_VERSION_PROPERTY) != null) { + preferred = Version.getVersion(getWizard().getProperty(JdkLocationPanel.PREFERRED_JDK_VERSION_PROPERTY)); + } + if (getWizard().getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY) != null) { + jreAllowed = !"false".equals(getWizard().getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY)); + } + + for (Product product : Registry.getInstance().getProductsToInstall()) { + if (product.getUid().startsWith("nb-")) { + jreAllowed &= !"false".equals(product.getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY)); + + String minVersionString = product.getProperty(JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY); + if (minVersionString != null) { + Version depMinVersion = Version.getVersion(minVersionString); + if (min == null || depMinVersion.newerThan(min)) { + min = depMinVersion; + } + } + String maxVersionString = product.getProperty(JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY); + if (maxVersionString != null) { + Version depMaxVersion = Version.getVersion(maxVersionString); + if (min == null || depMaxVersion.olderThan(max)) { + max = depMaxVersion; + } + } + // do not check preferred version of the dependent nb product : + // it is not clear how to handle that + } + + if (product.getUid().equals("jre-nested")) { + hasNestedJre = true; + jdkLocationPanel.getWizard().setProperty(JdkLocationPanel.JRE_NESTED, JdkLocationPanel.JRE_NESTED); + } + } + + String finalMinVersion = (min == null) ? null : min.toString(); + String finalMaxVersion = (max == null) ? null : max.toString(); + String preferedVersion = (preferred == null) ? null : preferred.toString(); + String jreAllowedString = Boolean.toString(jreAllowed); + + if (finalMinVersion != null) { + jdkLocationPanel.setProperty( + JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY, + finalMinVersion); + } + if (finalMaxVersion != null) { + jdkLocationPanel.setProperty( + JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY, + finalMaxVersion); + } + if (preferedVersion != null) { + jdkLocationPanel.setProperty( + JdkLocationPanel.PREFERRED_JDK_VERSION_PROPERTY, + preferedVersion); + } + jdkLocationPanel.setProperty( + JdkLocationPanel.JRE_ALLOWED_PROPERTY, + jreAllowedString); + + jdkLocationPanel.initialize(); + + //reinitialize labels which are different for cases of jdk and jre allowance + setProperty(DESCRIPTION_PROPERTY, + jreAllowed ? DEFAULT_DESCRIPTION_JAVA : DEFAULT_DESCRIPTION); + setProperty(JDK_LOCATION_LABEL_TEXT_PROPERTY, + jreAllowed ? DEFAULT_JAVA_LOCATION_LABEL_TEXT : DEFAULT_JDK_LOCATION_LABEL_TEXT); + + //This makes it possible to perform silent installation with emptry state files + //that means that JDK_LOCATION_PROPERTY property is explicitely set to the first location + //that fits the requirements + //TODO: Investigate the prons&cons and side affects of moving + //this code to the end of JdkLocationPanel.initialize() method + File jdkLocation = jdkLocationPanel.getSelectedLocation(); + if(jdkLocation!=null && !jdkLocation.getPath().equals(StringUtils.EMPTY_STRING)) { + jdkLocationPanel.setLocation(jdkLocation); + } + } + + public boolean hasNestedJre() { + return hasNestedJre; + } + + public JdkLocationPanel getJdkLocationPanel() { + return jdkLocationPanel; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class NbDestinationPanelUi extends DestinationPanelUi { + protected NbPanel panel; + + public NbDestinationPanelUi(NbPanel panel) { + super(panel); + + + this.panel = panel; + } + + @Override + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new NbDestinationPanelSwingUi(panel, container); + } + + return super.getSwingUi(container); + } + } + + public static class NbDestinationPanelSwingUi extends DestinationPanelSwingUi { + protected NbPanel panel; + + private NbiLabel jdkLocationLabel; + private NbiComboBox jdkLocationComboBox; + private NbiButton browseButton; + private NbiTextPane statusLabel; + + private NbiTextField jdkLocationField; + + private NbiDirectoryChooser fileChooser; + + private Text jdkWarningMessage = null; + private HyperlinkListener hyperlinkListener = null; + + public NbDestinationPanelSwingUi( + final NbPanel panel, + final SwingContainer container) { + super(panel, container); + + this.panel = panel; + + initComponents(); + } + + // protected //////////////////////////////////////////////////////////////// + @Override + protected void initialize() { + jdkLocationLabel.setText( + panel.getProperty(JDK_LOCATION_LABEL_TEXT_PROPERTY)); + + final JdkLocationPanel jdkLocationPanel = panel.getJdkLocationPanel(); + + if (jdkLocationPanel.getLocations().isEmpty()) { + final Version minVersion = Version.getVersion(jdkLocationPanel.getProperty( + JdkLocationPanel.MINIMUM_JDK_VERSION_PROPERTY)); + final Version maxVersion = Version.getVersion(jdkLocationPanel.getProperty( + JdkLocationPanel.MAXIMUM_JDK_VERSION_PROPERTY)); + + statusLabel.setContentType("text/html"); + statusLabel.setText(StringUtils.format( + jdkLocationPanel.getProperty(JdkLocationPanel.ERROR_NOTHING_FOUND_PROPERTY), + minVersion.toJdkStyle(), + maxVersion.toJdkStyle(), + jdkLocationPanel.getProperty(JdkLocationPanel.JAVA_DOWNLOAD_PAGE_PROPERTY))); + + statusLabel.addHyperlinkListener(getHyperlinkListener()); + } else { + statusLabel.clearText(); + statusLabel.setVisible(false); + } + + final List jdkLocations = jdkLocationPanel.getLocations(); + final List jdkLabels = jdkLocationPanel.getLabels(); + + final LocationsComboBoxModel model = new LocationsComboBoxModel( + jdkLocations, + jdkLabels); + + ((LocationsComboBoxEditor) jdkLocationComboBox.getEditor()).setModel( + model); + jdkLocationComboBox.setModel( + model); + + final File selectedLocation = jdkLocationPanel.getSelectedLocation(); + final int index = jdkLocations.indexOf(selectedLocation); + String selectedItem; + if(index != -1) { + selectedItem = jdkLabels.get(index); + } else { + selectedItem = selectedLocation.toString(); + } + model.setSelectedItem(selectedItem); + browseButton.setText( + panel.getProperty(BROWSE_BUTTON_TEXT_PROPERTY)); + + super.initialize(); + } + + @Override + protected void saveInput() { + super.saveInput(); + + panel.getJdkLocationPanel().setLocation( + new File(jdkLocationField.getText().trim())); + } + + @Override + protected String validateInput() { + String errorMessage = super.validateInput(); + + if (errorMessage == null) { + // #222846 - non-ascii characters in installation path + File installationFolder = new File(getDestinationPath()); + CharsetEncoder encoder = Charset.forName("US-ASCII").newEncoder(); + if (!encoder.canEncode(installationFolder.getAbsolutePath())) { + return StringUtils.format(panel.getProperty(ERROR_CONTAINS_NON_ASCII_CHARS)); + } + + errorMessage = panel.getJdkLocationPanel().validateLocation( + jdkLocationField.getText().trim()); + } + + return errorMessage; + } + + @Override + protected String getWarningMessage() { + String warning = super.getWarningMessage(); + if (warning == null) { + final String location = getDestinationField().getText().trim(); + final File f = FileUtils.eliminateRelativity(location); + final File nbUserDirRoot = new File(SystemUtils.getUserHomeDirectory(), ".netbeans"); + if (f.equals(nbUserDirRoot) || FileUtils.isParent(nbUserDirRoot, f)) { + warning = StringUtils.format(panel.getProperty( + WARNING_INSTALL_INTO_USERDIR_PROPERTY), + nbUserDirRoot.getAbsolutePath()); + } + } + return warning; + } + + + // private ////////////////////////////////////////////////////////////////// + private void initComponents() { + // selectedLocationField //////////////////////////////////////////////// + jdkLocationField = new NbiTextField(); + jdkLocationField.getDocument().addDocumentListener( + new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + updateErrorMessage(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + // updateErrorMessage(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + updateErrorMessage(); + } + }); + + // jdkLocationComboBox ////////////////////////////////////////////////// + final LocationValidator validator = new LocationValidator() { + @Override + public void validate(String location) { + jdkLocationField.setText(location); + + if (!panel.jdkLocationPanel.isJdkVersionRecommended(location)) { + statusLabel.setText(getVersionWarningMessage()); + if (statusLabel.getHyperlinkListeners().length == 0) { + statusLabel.addHyperlinkListener(getHyperlinkListener()); + } + statusLabel.setVisible(true); + } else if (!panel.jdkLocationPanel.isArchitectureMatching(location)) { + statusLabel.setText(getArchitectureWarningMessage()); + if (statusLabel.getHyperlinkListeners().length == 0) { + statusLabel.addHyperlinkListener(getHyperlinkListener()); + } + statusLabel.setVisible(true); + } else { + statusLabel.clearText(); + statusLabel.setVisible(false); + } + } + }; + + jdkLocationComboBox = new NbiComboBox(); + jdkLocationComboBox.setEditable(true); + jdkLocationComboBox.setEditor(new LocationsComboBoxEditor(validator)); + jdkLocationComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent event) { + final ComboBoxModel model = jdkLocationComboBox.getModel(); + + if (model instanceof LocationsComboBoxModel) { + jdkLocationField.setText( + ((LocationsComboBoxModel) model).getLocation()); + } + } + }); + + // jdkLocationLabel ///////////////////////////////////////////////////// + jdkLocationLabel = new NbiLabel(); + jdkLocationLabel.setLabelFor(jdkLocationComboBox); + + // browseButton ///////////////////////////////////////////////////////// + browseButton = new NbiButton(); + browseButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent event) { + browseButtonPressed(); + } + }); + + // statusLabel ////////////////////////////////////////////////////////// + statusLabel = new NbiTextPane(); + + // fileChooser ////////////////////////////////////////////////////////// + fileChooser = new NbiDirectoryChooser(); + + // don't show JDK panel when JRE is nested in bin/jre + if(!panel.hasNestedJre()){ + // this ///////////////////////////////////////////////////////////////// + add(jdkLocationLabel, new GridBagConstraints( + 0, 2, // x, y + 2, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(jdkLocationComboBox, new GridBagConstraints( + 0, 3, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 11, 0, 0), // padding + 0, 0)); // padx, pady - ??? + add(browseButton, new GridBagConstraints( + 1, 3, // x, y + 1, 1, // width, height + 0.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 4, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(statusLabel, new GridBagConstraints( + 0, 4, // x, y + 2, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + } + } + + private Text getVersionWarningMessage() { + if (jdkWarningMessage == null) { + String messageContent = StringUtils.format( + panel.getProperty(WARNING_JDK_NOT_RECOMMENDED_VERSION), + panel.jdkLocationPanel.getProperty(JdkLocationPanel.JAVA_DOWNLOAD_PAGE_PROPERTY)); + jdkWarningMessage = new Text(messageContent, Text.ContentType.HTML); + } + + return jdkWarningMessage; + } + + private Text getArchitectureWarningMessage() { + if (jdkWarningMessage == null) { + String messageContent = StringUtils.format( + panel.getProperty(WARNING_JDK_NOT_RECOMMENDED_ARCHITECTURE), + panel.jdkLocationPanel.getProperty(JdkLocationPanel.JAVA_DOWNLOAD_PAGE_PROPERTY)); + jdkWarningMessage = new Text(messageContent, Text.ContentType.HTML); + } + + return jdkWarningMessage; + } + + private HyperlinkListener getHyperlinkListener() { + if (hyperlinkListener == null) { + hyperlinkListener = BrowserUtils.createHyperlinkListener(); + } + + return hyperlinkListener; + } + + private void browseButtonPressed() { + fileChooser.setSelectedFile(new File(jdkLocationField.getText().trim())); + + if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { + jdkLocationComboBox.getModel().setSelectedItem( + fileChooser.getSelectedFile().getAbsolutePath()); + } + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String JDK_LOCATION_LABEL_TEXT_PROPERTY = + "jdk.location.label.text"; // NOI18N + public static final String BROWSE_BUTTON_TEXT_PROPERTY = + "browse.button.text"; // NOI18N + public static final String WARNING_INSTALL_INTO_USERDIR_PROPERTY = + "install.into.userdir.storage"; + public static final String WARNING_JDK_NOT_RECOMMENDED_VERSION = + "jdk.not.recommended.version"; + public static final String WARNING_JDK_NOT_RECOMMENDED_ARCHITECTURE = + "jdk.not.recommended.architecture"; + public static final String ERROR_CONTAINS_NON_ASCII_CHARS = + "error.contains.non.ascii.chars"; // NOI18N + + public static final String DEFAULT_TITLE = + ResourceUtils.getString(NbPanel.class, + "NBP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(NbPanel.class, + "NBP.description"); // NOI18N + public static final String DEFAULT_DESCRIPTION_JAVA = + ResourceUtils.getString(NbPanel.class, + "NBP.description.java"); // NOI18N + + public static final String DEFAULT_DESTINATION_LABEL_TEXT = + ResourceUtils.getString(NbPanel.class, + "NBP.destination.label.text"); // NOI18N + public static final String DEFAULT_DESTINATION_BUTTON_TEXT = + ResourceUtils.getString(NbPanel.class, + "NBP.destination.button.text"); // NOI18N + + public static final String DEFAULT_JDK_LOCATION_LABEL_TEXT = + ResourceUtils.getString(NbPanel.class, + "NBP.jdk.location.label.text"); // NOI18N + public static final String DEFAULT_JAVA_LOCATION_LABEL_TEXT = + ResourceUtils.getString(NbPanel.class, + "NBP.java.location.label.text"); // NOI18N + public static final String DEFAULT_BROWSE_BUTTON_TEXT = + ResourceUtils.getString(NbPanel.class, + "NBP.browse.button.text"); // NOI18N + + public static final String DEFAULT_WARNING_INSTALL_INTO_USERDIR = + ResourceUtils.getString(NbPanel.class, + "NBP.warning.install.into.userdir"); // NOI18N + public static final String DEFAULT_WARNING_JDK_NOT_RECOMMENDED_VERSION = + ResourceUtils.getString(NbPanel.class, + "NBP.warning.jdk.not.recommended.version"); // NOI18N + public static final String DEFAULT_WARNING_JDK_NOT_RECOMMENDED_ARCHITECTURE = + ResourceUtils.getString(NbPanel.class, + "NBP.warning.jdk.not.recommended.architecture"); // NOI18N + public static final String DEFAULT_ERROR_CONTAINS_NON_ASCII_CHARS = + ResourceUtils.getString(NbPanel.class, + "NBP.error.contains.non.ascii.chars"); // NOI18N +} diff --git a/nbbuild/installer/engine/branding/jdk/src/data/engine.properties b/nbbuild/installer/engine/branding/jdk/src/data/engine.properties new file mode 100644 index 000000000000..9abf2d26b192 --- /dev/null +++ b/nbbuild/installer/engine/branding/jdk/src/data/engine.properties @@ -0,0 +1,131 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#NOI18N +nbi.wizard.ui.swing.frame.icon=resource:org/netbeans/installer/wizard/wizard-icon.ico + +nbi.wizard.ui.swing.frame.title.prefix= Java SE Development Kit and NetBeans IDE Installer +#NOI18N +nbi.wizard.ui.swing.frame.title.pattern={0} + +#NOI18N +nbi.macosx.application.directory.name=NetBeans IDE Installer + +#NOI18N +#nbi.overall.license.resource=org/netbeans/installer/product/components/netbeans-license.txt +#NOI18N +nbi.junit.license.resource=org/netbeans/installer/product/components/junit-license.txt +#NOI18N +nbi.overall.license.jdk5.resource=org/netbeans/installer/product/components/netbeans-license-jdk5.txt +#NOI18N +nbi.overall.license.jdk6.resource=org/netbeans/installer/product/components/netbeans-license-jdk6.txt +#NOI18N +nbi.overall.license.mysql.resource=org/netbeans/installer/product/components/netbeans-license-mysql.txt + +#NOI18N +#nbi.wizard.ui.swing.welcome.left.top.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png +#NOI18N +#nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png +#NOI18N +nbi.wizard.ui.swing.welcome.background.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-background.png + +#NOI18N +nbi.wizard.ui.swing.frame.head.right.image=resource:org/netbeans/installer/wizard/wizard-title-right.png +#NOI18N +nbi.wizard.ui.swing.frame.head.left.image=resource:org/netbeans/installer/wizard/wizard-title-left.png + +#NOI18N +nbi.wizard.ui.swing.frame.resizable=false + +#NOI18N +nbi.product.remove.corrupted.products.silently=true + +#NOI18N +#servicetag.allow.create=true +#NOI18N +#servicetag.allow.register=true +#NOI18N +#show.uninstallation.survey=true + +#NOI18N +nbi.wizard.ui.swing.frame.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.classic=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.xp=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.motif=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.metal=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.nimbus=512 + + +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.classic=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.xp=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.motif=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.metal=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.nimbus=512 + diff --git a/nbbuild/installer/engine/branding/jdk/src/native/launcher/windows/i18n/launcher.properties b/nbbuild/installer/engine/branding/jdk/src/native/launcher/windows/i18n/launcher.properties new file mode 100644 index 000000000000..c465e9b0ce4b --- /dev/null +++ b/nbbuild/installer/engine/branding/jdk/src/native/launcher/windows/i18n/launcher.properties @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +nlw.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://www.oracle.com/technetwork/java/javase/downloads +nlw.jvm.usererror=Java Runtime Environment (JRE) was not found\nThere is no JRE at the specified location {0} +nlw.jvm.unsupportedversion=Unsupported Java VM version\nThe Java VM at {0} has the unsupported version +nlw.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder. Clean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument +nlw.tmpdir=Can't create temporary directory\nThe temporary directory for extracting data {0} was not created +nlw.integrity=Installer file is corrupted\nInstaller file {0} seems to be corrupted +nlw.output.error=Data extraction error\nCan't create file {0}!\nThe following error occured :\n{1} +nlw.java.process.error=An error occured while running java process\n{0} +nlw.missing.external.resource=Can`t run NetBeans Installer.\nAn external file with necessary data is required but missing:\n{0} +nlw.bundled.jvm.extract.error=Cannot prepare bundled JVM to run the installer.\nMost probably the bundled JVM is not compatible with the current platform.\nSee FAQ at http://wiki.netbeans.org/FaqUnableToPrepareBundledJdk for more information. +nlw.bundled.jvm.verify.error=An error occured while verifying bundled JVM.\nMost probably the bundled JVM is not compatible with the current platform.\nSee FAQ at http://wiki.netbeans.org/FaqUnableToPrepareBundledJdk for more information. + +nlw.arg.output={0} \n\tRedirect output to file +nlw.arg.javahome={0} \n\tRun jar file using JVM from +nlw.arg.verbose={0}\n\tUse verbose output +nlw.arg.tempdir={0} \n\tUse for extracting data +nlw.arg.extract={0} [directory]\n\tExtract all bundled data to the specific directory.\n\tIf directory is not specified then extract to the current directory +nlw.arg.classpatha={0} \n\tAppend classpath with +nlw.arg.classpathp={0} \n\tPrepend classpath with +nlw.arg.disable.space.check={0}\n\tDisable free space check +nlw.arg.locale={0} \n\tOverride system default locale with +nlw.arg.silent={0} \n\tRun installer silently +nlw.arg.help={0}\n\tShow help message + + +nlw.msg.create.tmpdir=Creating temporary directory ... +nlw.msg.extract=Extracting data ... +nlw.msg.jvmsearch=Finding JVM on your system ... +nlw.msg.setoptions=Setting command options ... +nlw.msg.running=Running JVM ... +nlw.msg.title=Please wait while the launcher prepares data to run the installer ... +nlw.msg.messagebox.title=Java SE Development Kit and NetBeans IDE Installer +nlw.msg.progress.title=Configuring the installer ... +nlw.msg.button.error=Exit Installer +nlw.msg.main.title=Java SE Development Kit and NetBeans IDE Installer diff --git a/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/Bundle.properties b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/Bundle.properties new file mode 100644 index 000000000000..4fd797a7a5c9 --- /dev/null +++ b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/Bundle.properties @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# WizardComponent.java +WC.title=Java SE Development Kit and NetBeans IDE Installer +WC.description=Java SE Development Kit and NetBeans IDE Installer Description + +WC.help.button.text=&Help! +WC.back.button.text=< &Back +WC.next.button.text=&Next > +WC.cancel.button.text=Cancel +WC.finish.button.text=&Finish + +WC.cancel.dialog.title=Cancel +WC.cancel.dialog.text=Are you sure you want to cancel? + +##################################################################################### +# WizardAction.java +WA.error.interrupted.exception=An InterruptedException occured. + +WA.canceling.progress.title=Canceling, finishing the current operation... + +WA.cancel.dialog.title=Cancel +WA.cancel.dialog.text=Are you sure you want to cancel? diff --git a/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties new file mode 100644 index 000000000000..a247e4e4f9d8 --- /dev/null +++ b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties @@ -0,0 +1,33 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################### +# NbInitializationAction.java +NIA.title=Configuring the Installer... +NIA.description=Please wait while Java SE Development Kit and NetBeans IDE installer initializes +NIA.progress.title=Configuring the Installer... + +############################################################################### +# NbServiceTagCreateAction.java + +#NOI18N +NSTCA.installer.source.name=NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jdk={0} and NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jtb=Java EE 5 Tools Bundle {jtb-display-version} Installer diff --git a/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties new file mode 100644 index 000000000000..273c8d29ac1d --- /dev/null +++ b/nbbuild/installer/engine/branding/jdk/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties @@ -0,0 +1,24 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# MainSequence.java +MS.IA.title=Installation +MS.IA.description=Please wait while the installer installs JDK and NetBeans IDE. + +MS.error.mode=A terrible and weird error happened - installer's execution mode is not recognized diff --git a/nbbuild/installer/engine/branding/jtb/src/data/engine.properties b/nbbuild/installer/engine/branding/jtb/src/data/engine.properties new file mode 100644 index 000000000000..37fa2bb6c5bc --- /dev/null +++ b/nbbuild/installer/engine/branding/jtb/src/data/engine.properties @@ -0,0 +1,127 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#NOI18N +nbi.wizard.ui.swing.frame.icon=resource:org/netbeans/installer/wizard/wizard-icon.png + +nbi.wizard.ui.swing.frame.title.prefix= Java EE 5 Tools Bundle Installer + +#NOI18N +nbi.wizard.ui.swing.frame.title.pattern={0} + +#NOI18N +nbi.macosx.application.directory.name=Java EE 5 Tools Bundle Installer +#NOI18N +nbi.java.application.icon=resource:org/netbeans/installer/utils/system/launchers/impl/java.icns + +#NOI18N +nbi.overall.license.resource=org/netbeans/installer/product/components/netbeans-license.txt +#NOI18N +nbi.overall.license.jdk5.resource=org/netbeans/installer/product/components/netbeans-license-jdk5.txt +#NOI18N +nbi.overall.license.jdk6.resource=org/netbeans/installer/product/components/netbeans-license-jdk6.txt +#NOI18N +nbi.overall.license.jtb.resource=org/netbeans/installer/product/components/netbeans-license-jtb.txt +#NOI18N +nbi.overall.license.mysql.resource=org/netbeans/installer/product/components/netbeans-license-mysql.txt + +#NOI18N +nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png + +#NOI18N +nbi.wizard.ui.swing.frame.head.right.image=resource:org/netbeans/installer/wizard/wizard-title-right.png +#NOI18N +nbi.wizard.ui.swing.frame.head.left.image=resource:org/netbeans/installer/wizard/wizard-title-left.png + +#NOI18N +nbi.wizard.ui.swing.frame.resizable=true +#NOI18N +nbi.product.remove.corrupted.products.silently=true + +#NOI18N +servicetag.allow.create=true +#NOI18N +servicetag.allow.register=true +#NOI18N +show.uninstallation.survey=true + +#NOI18N +nbi.wizard.ui.swing.frame.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.default=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.classic=522 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.xp=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.motif=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.metal=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.height.aqua=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.height.gtk=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.nimbus=529 + + +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.default=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.classic=522 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.xp=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.motif=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.metal=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.aqua=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.gtk=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.nimbus=529 diff --git a/nbbuild/installer/engine/branding/jtb/src/native/launcher/windows/i18n/launcher.properties b/nbbuild/installer/engine/branding/jtb/src/native/launcher/windows/i18n/launcher.properties new file mode 100644 index 000000000000..56dc73c1014c --- /dev/null +++ b/nbbuild/installer/engine/branding/jtb/src/native/launcher/windows/i18n/launcher.properties @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +nlw.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://www.oracle.com/technetwork/java/javase/downloads +nlw.jvm.usererror=Java Runtime Environment (JRE) was not found\nThere is no JRE at the specified location {0} +nlw.jvm.unsupportedversion=Unsupported Java VM version\nThe Java VM at {0} has the unsupported version +nlw.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder. Clean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument +nlw.tmpdir=Can't create temporary directory\nThe temporary directory for extracting data {0} was not created +nlw.integrity=Installer file is corrupted\nInstaller file {0} seems to be corrupted +nlw.output.error=Data extraction error\nCan't create file {0}!\nThe following error occured :\n{1} +nlw.java.process.error=An error occured while running java process\n{0} +nlw.missing.external.resource=Can`t run NetBeans Installer.\nAn external file with necessary data is required but missing:\n{0} +nlw.bundled.jvm.extract.error=Cannot prepare bundled JVM to run the installer.\nMost probably the bundled JVM is not compatible with the current platform. +nlw.bundled.jvm.verify.error=An error occured while verifying bundled JVM.\nMost probably the bundled JVM is not compatible with the current platform. + +nlw.arg.output={0} \n\tRedirect output to file +nlw.arg.javahome={0} \n\tRun jar file using JVM from +nlw.arg.verbose={0}\n\tUse verbose output +nlw.arg.tempdir={0} \n\tUse for extracting data +nlw.arg.extract={0} [directory]\n\tExtract all bundled data to the specific directory.\n\tIf directory is not specified then extract to the current directory +nlw.arg.classpatha={0} \n\tAppend classpath with +nlw.arg.classpathp={0} \n\tPrepend classpath with +nlw.arg.disable.space.check={0}\n\tDisable free space check +nlw.arg.locale={0} \n\tOverride system default locale with +nlw.arg.silent={0} \n\tRun installer silently +nlw.arg.help={0}\n\tShow help message + + +nlw.msg.create.tmpdir=Creating temporary directory ... +nlw.msg.extract=Extracting data ... +nlw.msg.jvmsearch=Finding JVM on your system ... +nlw.msg.setoptions=Setting command options ... +nlw.msg.running=Running JVM ... +nlw.msg.title=Please wait while the launcher prepares data to run the installer ... +nlw.msg.messagebox.title=Java EE 5 Tools Bundle Installer +nlw.msg.progress.title=Configuring the installer ... +nlw.msg.button.error=Exit Installer +nlw.msg.main.title=Java EE 5 Tools Bundle Installer diff --git a/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/Bundle.properties b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/Bundle.properties new file mode 100644 index 000000000000..8fcae60d2a0e --- /dev/null +++ b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/Bundle.properties @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# WizardComponent.java +WC.title=Java EE 5 Tools Bundle Installer +WC.description=Java EE 5 Tools Bundle Installer Description + +WC.help.button.text=&Help! +WC.back.button.text=< &Back +WC.next.button.text=&Next > +WC.cancel.button.text=Cancel +WC.finish.button.text=&Finish + +WC.cancel.dialog.title=Cancel +WC.cancel.dialog.text=Are you sure you want to cancel? + +##################################################################################### +# WizardAction.java +WA.error.interrupted.exception=An InterruptedException occured. + +WA.canceling.progress.title=Canceling, finishing the current operation... + +WA.cancel.dialog.title=Cancel +WA.cancel.dialog.text=Are you sure you want to cancel? diff --git a/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties new file mode 100644 index 000000000000..f5b0ad8a6e70 --- /dev/null +++ b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties @@ -0,0 +1,33 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################### +# NbInitializationAction.java +NIA.title=Configuring the Installer... +NIA.description=Please wait while Java EE 5 Tools Bundle installer initializes +NIA.progress.title=Configuring the Installer... + +############################################################################### +# NbServiceTagCreateAction.java + +#NOI18N +NSTCA.installer.source.name=NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jdk={0} and NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jtb=Java EE 5 Tools Bundle {jtb-display-version} Installer diff --git a/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties new file mode 100644 index 000000000000..0f47b0caba8e --- /dev/null +++ b/nbbuild/installer/engine/branding/jtb/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties @@ -0,0 +1,24 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# MainSequence.java +MS.IA.title=Installation +MS.IA.description=Please wait while the installer installs NetBeans IDE and runtimes. + +MS.error.mode=A terrible and weird error happened - installer's execution mode is not recognized diff --git a/nbbuild/installer/engine/branding/mysql/src/data/engine.properties b/nbbuild/installer/engine/branding/mysql/src/data/engine.properties new file mode 100644 index 000000000000..59a3f3eb8471 --- /dev/null +++ b/nbbuild/installer/engine/branding/mysql/src/data/engine.properties @@ -0,0 +1,128 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#NOI18N +nbi.wizard.ui.swing.frame.icon=resource:org/netbeans/installer/wizard/wizard-icon.png + +nbi.wizard.ui.swing.frame.title.prefix= NetBeans IDE with GlassFish and MySQL Installer + +#NOI18N +nbi.wizard.ui.swing.frame.title.pattern={0} + +#NOI18N +nbi.macosx.application.directory.name=NetBeans IDE with GlassFish and MySQL Installer +#NOI18N +nbi.java.application.icon=resource:org/netbeans/installer/utils/system/launchers/impl/java.icns + +#NOI18N +nbi.overall.license.resource=org/netbeans/installer/product/components/netbeans-license.txt +#NOI18N +nbi.overall.license.jdk5.resource=org/netbeans/installer/product/components/netbeans-license-jdk5.txt +#NOI18N +nbi.overall.license.jdk6.resource=org/netbeans/installer/product/components/netbeans-license-jdk6.txt +#NOI18N +nbi.overall.license.jtb.resource=org/netbeans/installer/product/components/netbeans-license-jtb.txt +#NOI18N +nbi.overall.license.mysql.resource=org/netbeans/installer/product/components/netbeans-license-mysql.txt + +#NOI18N +nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png + +#NOI18N +nbi.wizard.ui.swing.frame.head.right.image=resource:org/netbeans/installer/wizard/wizard-title-right.png +#NOI18N +nbi.wizard.ui.swing.frame.head.left.image=resource:org/netbeans/installer/wizard/wizard-title-left.png + +#NOI18N +nbi.wizard.ui.swing.frame.resizable=false +#NOI18N +nbi.product.remove.corrupted.products.silently=true + +#NOI18N +#servicetag.allow.create=true +#NOI18N +#servicetag.allow.register=true +#NOI18N +show.uninstallation.survey=true + +#NOI18N +nbi.wizard.ui.swing.frame.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.default=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.classic=522 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.xp=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.motif=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.metal=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.height.aqua=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.height.gtk=529 +#NOI18N +nbi.wizard.ui.swing.frame.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.nimbus=529 + + +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.default=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.classic=522 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.xp=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.motif=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.metal=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.aqua=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.gtk=529 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.nimbus=529 diff --git a/nbbuild/installer/engine/branding/mysql/src/native/launcher/windows/i18n/launcher.properties b/nbbuild/installer/engine/branding/mysql/src/native/launcher/windows/i18n/launcher.properties new file mode 100644 index 000000000000..046c45019e9c --- /dev/null +++ b/nbbuild/installer/engine/branding/mysql/src/native/launcher/windows/i18n/launcher.properties @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +nlw.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://www.oracle.com/technetwork/java/javase/downloads +nlw.jvm.usererror=Java Runtime Environment (JRE) was not found\nThere is no JRE at the specified location {0} +nlw.jvm.unsupportedversion=Unsupported Java VM version\nThe Java VM at {0} has the unsupported version +nlw.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder. Clean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument +nlw.tmpdir=Can't create temporary directory\nThe temporary directory for extracting data {0} was not created +nlw.integrity=Installer file is corrupted\nInstaller file {0} seems to be corrupted +nlw.output.error=Data extraction error\nCan't create file {0}!\nThe following error occured :\n{1} +nlw.java.process.error=An error occured while running java process\n{0} +nlw.missing.external.resource=Can`t run NetBeans Installer.\nAn external file with necessary data is required but missing:\n{0} +nlw.bundled.jvm.extract.error=Cannot prepare bundled JVM to run the installer.\nMost probably the bundled JVM is not compatible with the current platform. +nlw.bundled.jvm.verify.error=An error occured while verifying bundled JVM.\nMost probably the bundled JVM is not compatible with the current platform. + +nlw.arg.output={0} \n\tRedirect output to file +nlw.arg.javahome={0} \n\tRun jar file using JVM from +nlw.arg.verbose={0}\n\tUse verbose output +nlw.arg.tempdir={0} \n\tUse for extracting data +nlw.arg.extract={0} [directory]\n\tExtract all bundled data to the specific directory.\n\tIf directory is not specified then extract to the current directory +nlw.arg.classpatha={0} \n\tAppend classpath with +nlw.arg.classpathp={0} \n\tPrepend classpath with +nlw.arg.disable.space.check={0}\n\tDisable free space check +nlw.arg.locale={0} \n\tOverride system default locale with +nlw.arg.silent={0} \n\tRun installer silently +nlw.arg.help={0}\n\tShow help message + + +nlw.msg.create.tmpdir=Creating temporary directory ... +nlw.msg.extract=Extracting data ... +nlw.msg.jvmsearch=Finding JVM on your system ... +nlw.msg.setoptions=Setting command options ... +nlw.msg.running=Running JVM ... +nlw.msg.title=Please wait while the launcher prepares data to run the installer ... +nlw.msg.messagebox.title=NetBeans IDE with GlassFish and MySQL Installer +nlw.msg.progress.title=Configuring the installer ... +nlw.msg.button.error=Exit Installer +nlw.msg.main.title=NetBeans IDE with GlassFish and MySQL Installer diff --git a/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/Bundle.properties b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/Bundle.properties new file mode 100644 index 000000000000..30af22cb5b94 --- /dev/null +++ b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/Bundle.properties @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# WizardComponent.java +WC.title=NetBeans IDE with GlassFish and MySQL Installer +WC.description=NetBeans IDE with GlassFish and MySQL Installer Description + +WC.help.button.text=&Help! +WC.back.button.text=< &Back +WC.next.button.text=&Next > +WC.cancel.button.text=Cancel +WC.finish.button.text=&Finish + +WC.cancel.dialog.title=Cancel +WC.cancel.dialog.text=Are you sure you want to cancel? + +##################################################################################### +# WizardAction.java +WA.error.interrupted.exception=An InterruptedException occured. + +WA.canceling.progress.title=Canceling, finishing the current operation... + +WA.cancel.dialog.title=Cancel +WA.cancel.dialog.text=Are you sure you want to cancel? diff --git a/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties new file mode 100644 index 000000000000..d5821ae9b775 --- /dev/null +++ b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties @@ -0,0 +1,33 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################### +# NbInitializationAction.java +NIA.title=Configuring the Installer... +NIA.description=Please wait while Installer initializes +NIA.progress.title=Configuring the Installer... + +############################################################################### +# NbServiceTagCreateAction.java + +#NOI18N +NSTCA.installer.source.name=NetBeans IDE {display-version} with GlassFish and MySQL Installer +#NOI18N +NSTCA.installer.source.name.jdk={0} and NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jtb=Java EE 5 Tools Bundle {jtb-display-version} Installer diff --git a/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties new file mode 100644 index 000000000000..5921e7a03a8d --- /dev/null +++ b/nbbuild/installer/engine/branding/mysql/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties @@ -0,0 +1,24 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# MainSequence.java +MS.IA.title=Installation +MS.IA.description=Please wait while the installer installs selected components. + +MS.error.mode=A terrible and weird error happened - installer's execution mode is not recognized diff --git a/nbbuild/installer/engine/branding/weblogic/src/data/engine.properties b/nbbuild/installer/engine/branding/weblogic/src/data/engine.properties new file mode 100644 index 000000000000..24aedd3cd238 --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/data/engine.properties @@ -0,0 +1,128 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#NOI18N +nbi.wizard.ui.swing.frame.icon=resource:org/netbeans/installer/wizard/wizard-icon.png + +nbi.wizard.ui.swing.frame.title.prefix= NetBeans IDE and Oracle WebLogic Server Installer + +#NOI18N +nbi.wizard.ui.swing.frame.title.pattern={0} + +#NOI18N +nbi.macosx.application.directory.name=NetBeans IDE Installer + +#NOI18N +nbi.wizard.ui.swing.frame.head.right.image=resource:org/netbeans/installer/wizard/wizard-description-background.png + +#NOI18N +nbi.overall.license.resource=org/netbeans/installer/product/components/netbeans-license.txt +#NOI18N +nbi.junit.license.resource=org/netbeans/installer/product/components/junit-license.txt +#NOI18N +nbi.overall.license.jdk5.resource=org/netbeans/installer/product/components/netbeans-license-jdk5.txt +#NOI18N +nbi.overall.license.jdk6.resource=org/netbeans/installer/product/components/netbeans-license-jdk6.txt +#NOI18N +nbi.overall.license.jtb.resource=org/netbeans/installer/product/components/netbeans-license-jtb.txt +#NOI18N +nbi.overall.license.mysql.resource=org/netbeans/installer/product/components/netbeans-license-mysql.txt +#NOI18N +nbi.overall.license.javafx.resource=org/netbeans/installer/product/components/netbeans-license-javafx.txt + +#NOI18N +#nbi.wizard.ui.swing.welcome.left.top.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png +#NOI18N +nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png + +#NOI18N +nbi.product.remove.corrupted.products.silently=false + +#NOI18N +#servicetag.allow.create=true +#NOI18N +#servicetag.allow.register=true +#NOI18N +#show.uninstallation.survey=true + +#NOI18N +nbi.wizard.ui.swing.frame.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.classic=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.xp=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.motif=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.metal=472 +#NOI18N +nbi.wizard.ui.swing.frame.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.nimbus=512 + + +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.classic=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.xp=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.motif=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.metal=472 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.nimbus=512 diff --git a/nbbuild/installer/engine/branding/weblogic/src/native/launcher/windows/i18n/launcher.properties b/nbbuild/installer/engine/branding/weblogic/src/native/launcher/windows/i18n/launcher.properties new file mode 100644 index 000000000000..a317dda64c3b --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/native/launcher/windows/i18n/launcher.properties @@ -0,0 +1,53 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +nlw.jvm.notfoundmessage=Java SE Development Kit (JDK) was not found on this computer\nJDK 6 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again. You can specify valid JDK location using {0} installer argument.\n\nTo download the JDK, visit http://www.oracle.com/technetwork/java/javase/downloads +nlw.jvm.usererror=Java Runtime Environment (JRE) was not found\nThere is no JRE at the specified location {0} +nlw.jvm.unsupportedversion=Unsupported Java VM version\nThe Java VM at {0} has the unsupported version +nlw.freespace=There is not enough free disk space to extract installation data\n{0} MB of free disk space is required in a temporary folder. Clean up the disk space and run installer again. You can specify a temporary folder with sufficient disk space using {1} installer argument +nlw.tmpdir=Can't create temporary directory\nThe temporary directory for extracting data {0} was not created +nlw.integrity=Installer file is corrupted\nInstaller file {0} seems to be corrupted +nlw.output.error=Data extraction error\nCan't create file {0}!\nThe following error occured :\n{1} +nlw.java.process.error=An error occured while running java process\n{0} +nlw.missing.external.resource=Can`t run NetBeans Installer.\nAn external file with necessary data is required but missing:\n{0} +nlw.bundled.jvm.extract.error=Cannot prepare bundled JVM to run the installer.\nMost probably the bundled JVM is not compatible with the current platform. +nlw.bundled.jvm.verify.error=An error occured while verifying bundled JVM.\nMost probably the bundled JVM is not compatible with the current platform. + +nlw.arg.output={0} \n\tRedirect output to file +nlw.arg.javahome={0} \n\tRun jar file using JVM from +nlw.arg.verbose={0}\n\tUse verbose output +nlw.arg.tempdir={0} \n\tUse for extracting data +nlw.arg.extract={0} [directory]\n\tExtract all bundled data to the specific directory.\n\tIf directory is not specified then extract to the current directory +nlw.arg.classpatha={0} \n\tAppend classpath with +nlw.arg.classpathp={0} \n\tPrepend classpath with +nlw.arg.disable.space.check={0}\n\tDisable free space check +nlw.arg.locale={0} \n\tOverride system default locale with +nlw.arg.silent={0} \n\tRun installer silently +nlw.arg.help={0}\n\tShow help message + + +nlw.msg.create.tmpdir=Creating temporary directory ... +nlw.msg.extract=Extracting data ... +nlw.msg.jvmsearch=Finding JVM on your system ... +nlw.msg.setoptions=Setting command options ... +nlw.msg.running=Running JVM ... +nlw.msg.title=Please wait while the launcher prepares data to run the installer ... +nlw.msg.messagebox.title=NetBeans IDE and Oracle WebLogic Server Installer +nlw.msg.progress.title=Configuring the installer ... +nlw.msg.button.error=Exit Installer +nlw.msg.main.title=NetBeans IDE and Oracle WebLogic Server Installer diff --git a/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/Bundle.properties b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/Bundle.properties new file mode 100644 index 000000000000..d54e0b71c33a --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/Bundle.properties @@ -0,0 +1,40 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# WizardComponent.java +WC.title=NetBeans IDE and Oracle WebLogic Server Installer +WC.description=NetBeans IDE and Oracle WebLogic Server Installer Description + +WC.help.button.text=&Help! +WC.back.button.text=< &Back +WC.next.button.text=&Next > +WC.cancel.button.text=Cancel +WC.finish.button.text=&Finish + +WC.cancel.dialog.title=Cancel +WC.cancel.dialog.text=Are you sure you want to cancel? + +##################################################################################### +# WizardAction.java +WA.error.interrupted.exception=An InterruptedException occured. + +WA.canceling.progress.title=Canceling, finishing the current operation... + +WA.cancel.dialog.title=Cancel +WA.cancel.dialog.text=Are you sure you want to cancel? diff --git a/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties new file mode 100644 index 000000000000..61f836e4f71e --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################### +# NbInitializationAction.java +NIA.title=Configuring the Installer... +NIA.description=Please wait while NetBeans IDE and Oracle WebLogic Server installer initializes +NIA.progress.title=Configuring the Installer... + +############################################################################### diff --git a/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties new file mode 100644 index 000000000000..8a498665deb7 --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/components/sequences/Bundle.properties @@ -0,0 +1,23 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# MainSequence.java +MS.IA.title=Installation +MS.IA.description=Please wait while the installer installs NetBeans IDE and Oracle WebLogic Server + diff --git a/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-components.xml b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-components.xml new file mode 100644 index 000000000000..e8b1760f4067 --- /dev/null +++ b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-components.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-description-background.png b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-description-background.png new file mode 100644 index 000000000000..3fd13c55c403 Binary files /dev/null and b/nbbuild/installer/engine/branding/weblogic/src/org/netbeans/installer/wizard/wizard-description-background.png differ diff --git a/nbbuild/installer/engine/build.properties b/nbbuild/installer/engine/build.properties new file mode 100644 index 000000000000..350336a151c1 --- /dev/null +++ b/nbbuild/installer/engine/build.properties @@ -0,0 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +jar.contents.list=data/engine.list +jar.contents.includes=native/** org/** com/sun/servicetag/** com/apple/** data/clioptions.list data/engine*.properties \ No newline at end of file diff --git a/nbbuild/installer/engine/build.xml b/nbbuild/installer/engine/build.xml new file mode 100644 index 000000000000..8ac71e18f725 --- /dev/null +++ b/nbbuild/installer/engine/build.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + ${engine.files} + + + + + + + diff --git a/nbbuild/installer/engine/manifest.mf b/nbbuild/installer/engine/manifest.mf new file mode 100644 index 000000000000..464ca3d3fe50 --- /dev/null +++ b/nbbuild/installer/engine/manifest.mf @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 +Main-Class: org.netbeans.installer.Installer diff --git a/nbbuild/installer/engine/nbproject/build-impl.xml b/nbbuild/installer/engine/nbproject/build-impl.xml new file mode 100644 index 000000000000..a888cd769edf --- /dev/null +++ b/nbbuild/installer/engine/nbproject/build-impl.xml @@ -0,0 +1,1429 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/engine/nbproject/genfiles.properties b/nbbuild/installer/engine/nbproject/genfiles.properties new file mode 100644 index 000000000000..85b166d75908 --- /dev/null +++ b/nbbuild/installer/engine/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=8f661a73 +build.xml.script.CRC32=f2f0e306 +build.xml.stylesheet.CRC32=a12b3d02 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=a0bbe1ec +nbproject/build-impl.xml.script.CRC32=d2b4a5b8 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/nbbuild/installer/engine/nbproject/project.properties b/nbbuild/installer/engine/nbproject/project.properties new file mode 100644 index 000000000000..d2e8199befd4 --- /dev/null +++ b/nbbuild/installer/engine/nbproject/project.properties @@ -0,0 +1,113 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.title=NetBeans Installer Engine +application.vendor= +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/nbi-engine.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.junit-4.12.jar=../../libs.junit4/external/junit-4.12.jar +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${reference.NBI_Engine.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${file.reference.junit-4.12.jar} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=org.netbeans.installer.Installer +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.NBI_Engine=../../nbi/engine +reference.NBI_Engine.jar=${project.NBI_Engine}/dist/nbi-engine.jar +run.classpath=\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs=-Dnbi.product.bundled.registry.uri=file:/D:/temp/nbi-build/dist/registry-temp/registry.xml +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbbuild/installer/engine/nbproject/project.xml b/nbbuild/installer/engine/nbproject/project.xml new file mode 100644 index 000000000000..31d3e368c16c --- /dev/null +++ b/nbbuild/installer/engine/nbproject/project.xml @@ -0,0 +1,46 @@ + + + + org.netbeans.modules.java.j2seproject + + + NetBeans NBI Engine + 1.6.5 + + + + + + + + + + NBI_Engine + jar + + jar + clean + jar + + + + diff --git a/nbbuild/installer/engine/src/data/engine.properties b/nbbuild/installer/engine/src/data/engine.properties new file mode 100644 index 000000000000..459dc370a8d0 --- /dev/null +++ b/nbbuild/installer/engine/src/data/engine.properties @@ -0,0 +1,128 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#NOI18N +nbi.wizard.ui.swing.frame.icon=resource:org/netbeans/installer/wizard/wizard-icon.png + +nbi.wizard.ui.swing.frame.title.prefix= Apache NetBeans IDE Installer + +#NOI18N +nbi.wizard.ui.swing.frame.title.pattern={0} + +#NOI18N +nbi.macosx.application.directory.name=NetBeans IDE Installer + +#NOI18N +nbi.wizard.ui.swing.frame.head.right.image=resource:org/netbeans/installer/wizard/wizard-description-background.png + +#NOI18N +nbi.overall.license.resource=org/netbeans/installer/product/components/netbeans-license.txt +#NOI18N +nbi.junit.license.resource=org/netbeans/installer/product/components/junit-license.txt +#NOI18N +nbi.overall.license.jdk5.resource=org/netbeans/installer/product/components/netbeans-license-jdk5.txt +#NOI18N +nbi.overall.license.jdk6.resource=org/netbeans/installer/product/components/netbeans-license-jdk6.txt +#NOI18N +nbi.overall.license.jtb.resource=org/netbeans/installer/product/components/netbeans-license-jtb.txt +#NOI18N +nbi.overall.license.mysql.resource=org/netbeans/installer/product/components/netbeans-license-mysql.txt +#NOI18N +nbi.overall.license.javafx.resource=org/netbeans/installer/product/components/netbeans-license-javafx.txt + +#NOI18N +#nbi.wizard.ui.swing.welcome.left.top.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png +#NOI18N +nbi.wizard.ui.swing.welcome.left.bottom.image=resource:org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png + +#NOI18N +nbi.product.remove.corrupted.products.silently=true + +#NOI18N +#servicetag.allow.create=true +#NOI18N +#servicetag.allow.register=true +#NOI18N +#show.uninstallation.survey=true + +#NOI18N +nbi.wizard.ui.swing.frame.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.classic=442 +#NOI18N +nbi.wizard.ui.swing.frame.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.height.win.xp=450 +#NOI18N +nbi.wizard.ui.swing.frame.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.motif=470 +#NOI18N +nbi.wizard.ui.swing.frame.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.metal=470 +#NOI18N +nbi.wizard.ui.swing.frame.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.height.nimbus=512 + + +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.default=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.default=500 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.classic=588 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.classic=442 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.win.xp=600 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.win.xp=450 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.motif=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.motif=470 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.metal=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.metal=470 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.aqua=640 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.aqua=480 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.gtk=704 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.gtk=528 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.width.nimbus=624 +#NOI18N +nbi.wizard.ui.swing.frame.minimum.height.nimbus=512 diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/Bundle.properties b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/Bundle.properties new file mode 100644 index 000000000000..ad3d7b7649b9 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/Bundle.properties @@ -0,0 +1,80 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +################################################################################ +# NbClusterConfigurationLogic.java +NCCL.install.netbeans.clusters=Adding {0} to the active clusters list +NCCL.install.productid=Adding {0} to the 'productid' file +NCCL.install.irrelevant.files=Removing files irrelevant to the current platform +NCCL.install.files.permissions=Correcting files permissions +NCCL.install.netbeans.update.tracking=Update CRC sums for update tracking files + +NCCL.uninstall.productid=Removing {0} from the productid file +NCCL.uninstall.netbeans.clusters=Removing {0} from the active clusters list +NCCL.uninstall.update.files=Removing update files + +NCCL.install.error.netbeans.clusters=Cannot add {0} to the active clusters list +NCCL.install.error.productid=Cannot add {0} to the 'productid' file +NCCL.install.error.irrelevant.files=Cannot completely remove irrelevant files +NCCL.install.error.files.permissions=Cannot completely correct files permissions +NCCL.install.error.netbeans.update.tracking=Cannot update CRC sums of update tracking files + +NCCL.uninstall.error.update.files=Cannot remove update files + +NCCL.uninstall.error.productid=Cannot remove {0} from the 'productid' file +NCCL.uninstall.error.netbeans.clusters=Cannot remove {0} from the active clusters list + +################################################################################ +# ProductConfigurationLogic.java +PCL.validation.directory.missing=The installation directory {0} is missing.\nMost likely it was deleted manually. +PCL.validation.directory.file=The installation directory {0} is in fact a file.\nMost likely it was previously deleted manually and overwritten with a file. +PCL.validation.directory.empty=The installation directory {0} is empty.\nMost likely its contents were deleted manually. +PCL.validation.directory.null=The installation directory cannot be detected. + +################################################################################ +# Product.java +P.error.cannot.initialize.product=Cannot initialize data for {0} +P.error.cannot.load.logic=Cannot load configuration logic for {0} +P.error.installdir.not.set=Installation location is not set for {0} +P.error.installdir.set.empty=Installation location is set to empty string for {0} +P.error.cannot.create.cache.dir=Cannot create the local cache directory {0} for {1} +P.error.local.cache.not.dir=The local cache directory {0} for {1} is not a directory +P.error.cannot.load.product=Could not load product {0} +P.error.logic.not.yet.downloaded=Configuration logic for {0} is not yet downloaded +P.error.installation.data.not.cached=Installation data is not cached for {0} +P.error.cannot.extract.data=Cannot extract installation data for {0} +P.error.cannot.save.files.list=Cannot save installed files list +P.error.cannot.get.wizard.components=Cannot get component's wizard components +P.error.cannot.wrap.for.macos=Cannot create directory hierarchy for MacOS Application +P.error.cannot.get.files.list=Cannot get the installation files list +P.error.cannot.delete.files.list=Cannot delete installed files list +P.error.cannot.delete.file=Cannot delete the file +P.error.cannot.remove.from.system=Cannot remove {0} from the system install manager +P.error.not.enough.space=Cannot extract installation data -- not enough disk space in the target directory. +P.error.cannot.clear.cache=Cannot clear installation data cache file {0} +P.error.system.integartion.failed=Integration of {0} with the system package manager failed + +P.message.installation=Installing {0} +P.message.uninstallation=Uninstalling {0} +P.message.configuration=Configuring {0} +P.message.unconfiguration=Unconfiguring {0} +P.message.legal.artifacts=Creating legal artifacts +P.message.run.logic=Running custom configuration logic +P.message.system.registration=Registering in the system package manager +P.message.save.installation.files.list=Saving installed files list +P.message.delete=Deleting {0} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/NbClusterConfigurationLogic.java b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/NbClusterConfigurationLogic.java new file mode 100644 index 000000000000..c55b60a7b14b --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/NbClusterConfigurationLogic.java @@ -0,0 +1,304 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.product.components; + +import java.io.File; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.applications.NetBeansUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.InstallationException; +import org.netbeans.installer.utils.exceptions.UninstallationException; +import org.netbeans.installer.utils.helper.Dependency; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.netbeans.installer.utils.helper.RemovalMode; +import org.netbeans.installer.utils.helper.Text; +import org.netbeans.installer.utils.progress.Progress; +import org.netbeans.installer.wizard.components.WizardAction; +import org.netbeans.installer.wizard.components.WizardComponent; +import org.netbeans.installer.wizard.components.actions.SetInstallationLocationAction; + +/** + * + + */ +public abstract class NbClusterConfigurationLogic extends ProductConfigurationLogic { + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String BASE_IDE_UID = + "nb-base"; // NOI18N + + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private String[] clusterNames; + private String productId; + private String sourceUid; + + private List wizardComponents = + new LinkedList(); + + protected NbClusterConfigurationLogic( + final String clusterName, + final String productId, + final String sourceUid) throws InitializationException { + this(new String[]{clusterName}, productId, sourceUid); + } + + protected NbClusterConfigurationLogic( + final String[] clusterNames, + final String productId, + final String sourceUid) throws InitializationException { + this.clusterNames = clusterNames; + this.productId = productId; + this.sourceUid = sourceUid; + + WizardAction action; + + action = new SetInstallationLocationAction(); + action.setProperty( + SetInstallationLocationAction.SOURCE_UID_PROPERTY, + sourceUid); + wizardComponents.add(action); + } + + protected NbClusterConfigurationLogic( + final String clusterName, + final String productId) throws InitializationException { + this(new String[]{clusterName}, productId); + } + + protected NbClusterConfigurationLogic( + final String[] clusterNames, + final String productId) throws InitializationException { + this(clusterNames, productId, BASE_IDE_UID); + } + + public void install( + final Progress progress) throws InstallationException { + final File installLocation = getProduct().getInstallationLocation(); + + // get the list of suitable netbeans ide installations + final List dependencies = + getProduct().getDependencyByUid(sourceUid); + final List sources = + Registry.getInstance().getProducts(dependencies.get(0)); + + // pick the first one and integrate with it + final File nbLocation = sources.get(0).getInstallationLocation(); + + // add the cluster to the active clusters list ////////////////////////////// + for (String clusterName: clusterNames) { + try { + progress.setDetail(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.netbeans.clusters", // NOI18N + clusterName)); + File lastModified = new File(new File(installLocation, clusterName), + NetBeansUtils.LAST_MODIFIED_MARKER); + if(!FileUtils.exists(lastModified)) { + getProduct().getInstalledFiles().add(lastModified); + } + NetBeansUtils.addCluster(nbLocation, clusterName); + } catch (IOException e) { + throw new InstallationException(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.error.netbeans.clusters", // NOI18N + clusterName), + e); + } + } + + // update the update_tracking files information ////////////////////////////// + for (String clusterName: clusterNames) { + try { + progress.setDetail(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.netbeans.update.tracking", // NOI18N + clusterName)); + + NetBeansUtils.updateTrackingFilesInfo(nbLocation, clusterName); + } catch (IOException e) { + throw new InstallationException(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.error.netbeans.update.tracking", // NOI18N + clusterName), + e); + } + } + + // add the product id to the productid file ///////////////////////////////// + try { + if(productId!=null) { + progress.setDetail(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.productid", // NOI18N + productId)); + + NetBeansUtils.addPackId(nbLocation, productId); + } + } catch (IOException e) { + throw new InstallationException(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.install.error.productid", // NOI18N + productId), + e); + } + + // remove files that are not suited for the current platform //////////////// + //for (String clusterName: clusterNames) { + // final File cluster = new File(installLocation, clusterName); + // + // try { + // progress.setDetail(ResourceUtils.getString( + // NbClusterConfigurationLogic.class, + // "NCCL.install.irrelevant.files")); // NOI18N + // + // SystemUtils.removeIrrelevantFiles(cluster); + // } catch (IOException e) { + // throw new InstallationException(ResourceUtils.getString( + // NbClusterConfigurationLogic.class, + // "NCCL.install.error.irrelevant.files"), // NOI18N + // e); + // } + //} + + // corrent permisions on executable files /////////////////////////////////// + //for (String clusterName: clusterNames) { + // final File cluster = new File(installLocation, clusterName); + // + // try { + // progress.setDetail(ResourceUtils.getString( + // NbClusterConfigurationLogic.class, + // "NCCL.install.files.permissions")); // NOI18N + // + // SystemUtils.correctFilesPermissions(cluster); + // } catch (IOException e) { + // throw new InstallationException(ResourceUtils.getString( + // NbClusterConfigurationLogic.class, + // "NCCL.install.error.files.permissions"), // NOI18N + // e); + // } + //} + + } + + public void uninstall(final Progress progress) throws UninstallationException { + checkNetbeansRunning(); + + final File installLocation = getProduct().getInstallationLocation(); + + // get the list of suitable netbeans ide installations + final List dependencies = + getProduct().getDependencyByUid(sourceUid); + + if(dependencies.isEmpty()) { + LogManager.log(ErrorLevel.WARNING, + "Can`t uninstall " + getProduct().getDisplayName()); + LogManager.log(ErrorLevel.WARNING, + "Can`t find parent product with uid " + sourceUid); + return; + } + + final List sources = + Registry.getInstance().getProducts(dependencies.get(0)); + + // pick the first one and assume that we're integrated with it + final File nbLocation = sources.get(0).getInstallationLocation(); + + // remove the product id from the productid file //////////////////////////// + try { + if(productId!=null) { + progress.setDetail(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.uninstall.productid", // NOI18N + productId)); + + NetBeansUtils.removePackId(nbLocation, productId); + } + } catch (IOException e) { + throw new UninstallationException(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.uninstall.error.productid", // NOI18N + productId), + e); + } + + // remove the cluster from the active clusters list ///////////////////////// + for (String clusterName: clusterNames) { + try { + progress.setDetail(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.uninstall.netbeans.clusters", // NOI18N + clusterName)); + + NetBeansUtils.removeCluster(nbLocation, clusterName); + } catch (IOException e) { + throw new UninstallationException(ResourceUtils.getString( + NbClusterConfigurationLogic.class, + "NCCL.uninstall.error.netbeans.clusters", // NOI18N + clusterName), + e); + } + } + } + + public List getWizardComponents() { + return wizardComponents; + } + + @Override + public boolean registerInSystem() { + return false; + } + + @Override + public RemovalMode getRemovalMode() { + return RemovalMode.LIST; + } + + @Override + public Text getLicense() { + return null; + } + + protected void checkNetbeansRunning() { + List dependencies = + getProduct().getDependencyByUid(BASE_IDE_UID); + + if (dependencies.size() > 0 ) { + List sources = + Registry.getInstance().getProducts(dependencies.get(0)); + + // pick the first one and integrate with it + final File nbLocation = sources.get(0).getInstallationLocation(); + NetBeansUtils.warnNetbeansRunning(nbLocation); + } else { + LogManager.log(ErrorLevel.DEBUG, + "... no dependencies on IDE was found for " + getProduct().getDisplayName()); + LogManager.log(ErrorLevel.DEBUG, + "... so skipping checking for running netbeans IDE"); + } + } +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/junit-license.txt b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/junit-license.txt new file mode 100644 index 000000000000..55d402c38c81 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/junit-license.txt @@ -0,0 +1,235 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +JUnit + +Common Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and +documentation distributed under this Agreement, and +b) in the case of each subsequent Contributor: + +i) changes to the Program, and + +ii) additions to the Program; + +where such changes and/or additions to the Program originate from and are +distributed by that particular Contributor. A Contribution 'originates' from a +Contributor if it was added to the Program by such Contributor itself or anyone +acting on such Contributor's behalf. Contributions do not include additions to +the Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) are +not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + +a) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free copyright license to +reproduce, prepare derivative works of, publicly display, publicly perform, +distribute and sublicense the Contribution of such Contributor, if any, and +such derivative works, in source code and object code form. + +b) Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free patent license under +Licensed Patents to make, use, sell, offer to sell, import and otherwise +transfer the Contribution of such Contributor, if any, in source code and +object code form. This patent license shall apply to the combination of the +Contribution and the Program if, at the time the Contribution is added by the +Contributor, such addition of the Contribution causes such combination to be +covered by the Licensed Patents. The patent license shall not apply to any +other combinations which include the Contribution. No hardware per se is +licensed hereunder. + +c) Recipient understands that although each Contributor grants the +licenses to its Contributions set forth herein, no assurances are provided by +any Contributor that the Program does not infringe the patent or other +intellectual property rights of any other entity. Each Contributor disclaims +any liability to Recipient for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a condition to +exercising the rights and licenses granted hereunder, each Recipient hereby +assumes sole responsibility to secure any other intellectual property rights +needed, if any. For example, if a third party patent license is required to +allow Recipient to distribute the Program, it is Recipient's responsibility to +acquire that license before distributing the Program. + +d) Each Contributor represents that to its knowledge it has sufficient +copyright rights in its Contribution, if any, to grant the copyright license +set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under +its own license agreement, provided that: + +a) it complies with the terms and conditions of this Agreement; and + +b) its license agreement: + +i) effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose; + +ii) effectively excludes on behalf of all Contributors all liability for +damages, including direct, indirect, special, incidental and consequential +damages, such as lost profits; + +iii) states that any provisions which differ from this Agreement are +offered by that Contributor alone and not by any other party; and + +iv) states that source code for the Program is available from such +Contributor, and informs licensees how to obtain it in a reasonable manner on +or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + +a) it must be made available under this Agreement; and + +b) a copy of this Agreement must be included with each copy of the +Program. + +Contributors may not remove or alter any copyright notices contained within the +Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with its exercise +of rights under this Agreement, including but not limited to the risks and +costs of program errors, compliance with applicable laws, damage to or loss of +data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such +Recipient under this Agreement shall terminate as of the date such litigation +is filed. In addition, if Recipient institutes patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software or +hardware) infringes such Recipient's patent(s), then such Recipient's rights +granted under Section 2(b) shall terminate as of the date such litigation is +filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue +and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +IBM is the initial Agreement Steward. IBM may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial +in any resulting litigation. + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-javafx.txt b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-javafx.txt new file mode 100644 index 000000000000..9e179d2172e3 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-javafx.txt @@ -0,0 +1,1865 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +NETBEANS IDE 6.5 ("Product") + +Please review the complete list of open-source licenses +governing software included in the Product. They can be +found in the THIRDPARTYLICENSE.txt file. Sun elects to use +only the GNU Lesser General Public License version 2.1 +(LGPL)/GNU General Public License version 2 (GPL) for any +software where a choice of LGPL/GPL license versions are +made available with the language indicating that +LGPLv2.1/GPLv2 or any later version may be used, or where a +choice of which version of the LGPL/GPL is applied is +unspecified. + +Please review the list of libraries and licenses provided +for use. This license file contains four distinct licenses. + +Unless specified below, the use of NetBeans IDE 6.5 and +components from the GlassFish runtime are governed by the +terms of either the GNU General Public License Version 2 +with Classpath Exception ("GPLv2 with Classpath Exception") +or the Common Development and Distribution License ("CDDL"). +The Product also contains components which are governed +exclusively by the terms of the GPLv2 with Classpath +Exception (e.g., components from OpenJDK) . + + +LICENSE #1: GPLv2 with Classpath Exception. + +LICENSE #2: CDDL. + +LICENSE #3: The use of JGo 5.1 in the SOA pack is subject to +this Software License Agreement. + +LICENSE #4: The use of the Sun Java Wireless Toolkit 2.5.2 +for CLDC in the Java ME pack is subject to this Software +License Agreement. + +LICENSE #5: The use of the JavaFX 1.1 Software Development +Kit (SDK) is subject to this Software License Agreement. + +************************************************************ + +LICENSE #1: + +The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away +your freedom to share and change it. By contrast, the GNU +General Public License is intended to guarantee your freedom +to share and change free software--to make sure the software +is free for all its users. This General Public License +applies to most of the Free Software Foundation's software +and to any other program whose authors commit to using it. +(Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can +apply it to your programs, too. When we speak of free +software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and +charge for this service if you wish), that you receive +source code or can get it if you want it, that you can +change the software or use pieces of it in new free +programs; and that you know you can do these things. To +protect your rights, we need to make restrictions that +forbid anyone to deny you these rights or to ask you to +surrender the rights. These restrictions translate to +certain responsibilities for you if you distribute copies of +the software, or if you modify it. + +For example, if you distribute copies of such a program, +whether gratis or for a fee, you must give the recipients +all the rights that you have. You must make sure that they, +too, receive or can get the source code. And you must show +them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the +software, and (2) offer you this license which gives you +legal permission to copy, distribute and/or modify the +software. + +Also, for each author's protection and ours, we want to make +certain that everyone understands that there is no warranty +for this free software. If the software is modified by +someone else and passed on, we want its recipients to know +that what they have is not the original, so that any +problems introduced by others will not reflect on the +original authors' reputations. + +Finally, any free program is threatened constantly by +software patents. We wish to avoid the danger that +redistributors of a free program will individually obtain +patent licenses, in effect making the program proprietary. +To prevent this, we have made it clear that any patent must +be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution +and modification follow. TERMS AND CONDITIONS FOR COPYING, +DISTRIBUTION AND MODIFICATION 0. This License applies to any +program or other work which contains a notice placed by the +copyright holder saying it may be distributed under the +terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the +Program" means either the Program or any derivative work +under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with +modifications and/or translated into another language. +(Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as +"you". + +Activities other than copying, distribution and modification +are not covered by this License; they are outside its scope. +The act of running the Program is not restricted, and the +output from the Program is covered only if its contents +constitute a work based on the Program (independent of +having been made by running the Program). Whether that is +true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the +Program's source code as you receive it, in any medium, +provided that you conspicuously and appropriately publish on +each copy an appropriate copyright notice and disclaimer of +warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any +other recipients of the Program a copy of this License along +with the Program. + +You may charge a fee for the physical act of transferring a +copy, and you may at your option offer warranty protection +in exchange for a fee. + +2. You may modify your copy or copies of the Program or any +portion of it, thus forming a work based on the Program, and +copy and distribute such modifications or work under the +terms of Section 1 above, provided that you also meet all of +these conditions: + +a) You must cause the modified files to carry prominent +notices stating that you changed the files and the date of +any change. + +b) You must cause any work that you distribute or publish, +that in whole or in part contains or is derived from the +Program or any part thereof, to be licensed as a whole at no +charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands +interactively when run, you must cause it, when started +running for such interactive use in the most ordinary way, +to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or +else, saying that you provide a warranty) and that users may +redistribute the program under these conditions, and telling +the user how to view a copy of this License. (Exception: if +the Program itself is interactive but does not normally +print such an announcement, your work based on the Program +is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the +Program, and can be reasonably considered independent and +separate works in themselves, then this License, and its +terms, do not apply to those sections when you distribute +them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the +Program, the distribution of the whole must be on the terms +of this License, whose permissions for other licensees +extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights +or contest your rights to work written entirely by you; +rather, the intent is to exercise the right to control the +distribution of derivative or collective works based on the +Program. In addition, mere aggregation of another work not +based on the Program with the Program (or with a work based +on the Program) on a volume of a storage or distribution +medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based +on it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you +also do one of the following: + +a) Accompany it with the complete corresponding +machine-readable source code, which must be distributed +under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least +three years, to give any third party, for a charge no more +than your cost of physically performing source distribution, +a complete machine-readable copy of the corresponding source +code, to be distributed under the terms of Sections 1 and 2 +above on a medium customarily used for software interchange; +or, + +c) Accompany it with the information you received as to the +offer to distribute corresponding source code. (This +alternative is allowed only for noncommercial distribution +and only if you received the program in object code or +executable form with such an offer, in accord with +Subsection b above.) + +The source code for a work means the preferred form of the +work for making modifications to it. For an executable work, +complete source code means all the source code for all +modules it contains, plus any associated interface +definition files, plus the scripts used to control +compilation and installation of the executable. However, as +a special exception, the source code distributed need not +include anything that is normally distributed (in either +source or binary form) with the major components (compiler, +kernel, and so on) of the operating system on which the +executable runs, unless that component itself accompanies +the executable. If distribution of executable or object code +is made by offering access to copy from a designated place, +then offering equivalent access to copy the source code from +the same place counts as distribution of the source code, +even though third parties are not compelled to copy the +source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the +Program except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense or distribute +the Program is void, and will automatically terminate your +rights under this License. However, parties who have +received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties +remain in full compliance. + +5. You are not required to accept this License, since you +have not signed it. However, nothing else grants you +permission to modify or distribute the Program or its +derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or +distributing the Program (or any work based on the Program), +you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or +modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based +on the Program), the recipient automatically receives a +license from the original licensor to copy, distribute or +modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. You are +not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of +patent infringement or for any other reason (not limited to +patent issues), conditions are imposed on you (whether by +court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as +to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a +consequence you may not distribute the Program at all. For +example, if a patent license would not permit royalty-free +redistribution of the Program by all those who receive +copies directly or indirectly through you, then the only way +you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or +unenforceable under any particular circumstance, the balance +of the section is intended to apply and the section as a +whole is intended to apply in other circumstances. It is not +the purpose of this section to induce you to infringe any +patents or other property right claims or to contest +validity of any such claims; this section has the sole +purpose of protecting the integrity of the free software +distribution system, which is implemented by public license +practices. Many people have made generous contributions to +the wide range of software distributed through that system +in reliance on consistent application of that system; it is +up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee +cannot impose that choice. + +This section is intended to make thoroughly clear what is +believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is +restricted in certain countries either by patents or by +copyrighted interfaces, the original copyright holder who +places the Program under this License may add an explicit +geographical distribution limitation excluding those +countries, so that distribution is permitted only in or +among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the +body of this License. + +9. The Free Software Foundation may publish revised and/or +new versions of the General Public License from time to +time. Such new versions will be similar in spirit to the +present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If +the Program specifies a version number of this License which +applies to it and "any later version", you have the option +of following the terms and conditions either of that version +or of any later version published by the Free Software +Foundation. If the Program does not specify a version number +of this License, you may choose any version ever published +by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into +other free programs whose distribution conditions are +different, write to the author to ask for permission. For +software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be +guided by the two goals of preserving the free status of all +derivatives of our free software and of promoting the +sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS +NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE +COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR +IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED +TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY +WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED +ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF +THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT +LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the +greatest possible use to the public, the best way to achieve +this is to make it free software which everyone can +redistribute and change under these terms. + +To do so, attach the following notices to the program. It is +safest to attach them to the start of each source file to +most effectively convey the exclusion of warranty; and each +file should have at least the "copyright" line and a pointer +to where the full notice is found. + +One line to give the program's name and a brief idea of what +it does. + +Copyright (C) + +This program is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. This program is distributed in the hope that it +will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for +more details. You should have received a copy of the GNU +General Public License along with this program; if not, +write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and +paper mail. + +If the program is interactive, make it output a short notice +like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome to +redistribute it under certain conditions; type `show c' for +details. The hypothetical commands `show w' and `show c' +should show the appropriate parts of the General Public +License. Of course, the commands you use may be called +something other than `show w' and `show c'; they could even +be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a +programmer) or your school, if any, to sign a "copyright +disclaimer" for the program, if necessary. Here is a sample; +alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the program `Gnomovision' (which makes passes at compilers) +written by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating +your program into proprietary programs. If your program is a +subroutine library, you may consider it more useful to +permit linking proprietary applications with the library. If +this is what you want to do, use the GNU Library General +Public License instead of this License. + +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 + +Certain source files distributed by Sun Microsystems, Inc. +are subject to the following clarification and special +exception to the GPL Version 2, but only where Sun has +expressly included in the particular source file's header +the words "Sun designates this particular file as subject +to the "Classpath" exception as provided by Sun in the +License file that accompanied this code." + +Linking this library statically or dynamically with other +modules is making a combined work based on this library. +Thus, the terms and conditions of the GNU General Public +License Version 2 cover the whole combination. + +As a special exception, the copyright holders of this +library give you permission to link this library with +independent modules to produce an executable, regardless of +the license terms of these independent modules, and to copy +and distribute the resulting executable under terms of your +choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license +of that module. An independent module is a module which is +not derived from or based on this library. If you modify +this library, you may extend this exception to your version +of the library, but you are not obligated to do so. If you +do not wish to do so, delete this exception statement from +your version. + + +************************************************************ + +LICENSE #2: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) + Version 1.0 + +1. Definitions. +1.1. "Contributor" means each individual or entity that +creates or contributes to the creation of Modifications. + +1.2. "Contributor Version" means the combination of the +Original Software, prior Modifications used by a +Contributor (if any), and the Modifications made by that +particular Contributor. + +1.3. "Covered Software" means (a) the Original Software, or +(b) Modifications, or (c) the combination of files +containing Original Software with files containing +Modifications, in each case including portions thereof. + +1.4. "Executable" means the Covered Software in any form +other than Source Code. + +1.5. "Initial Developer" means the individual or entity +that first makes Original Software available under this +License. + +1.6. "Larger Work" means a work which combines Covered +Software or portions thereof with code not governed by the +terms of this License. + +1.7. "License" means this document. + +1.8. "Licensable" means having the right to grant, to the +maximum extent possible, whether at the time of the initial +grant or subsequently acquired, any and all of the rights +conveyed herein. + +1.9. "Modifications" means the Source Code and Executable +form of any of the following: + +A. Any file that results from an addition to, +deletion from or modification of the contents of a +file containing Original Software or previous +Modifications; + +B. Any new file that contains any part of the +Original Software or previous Modification; or + +C. Any new file that is contributed or otherwise made +available under the terms of this License. + +1.10. "Original Software" means the Source Code and +Executable form of computer software code that is +originally released under this License. + +1.11. "Patent Claims" means any patent claim(s), now owned +or hereafter acquired, including without limitation, +method, process, and apparatus claims, in any patent +Licensable by grantor. + +1.12. "Source Code" means (a) the common form of computer +software code in which modifications are made and (b) +associated documentation included in or with such code. + +1.13. "You" (or "Your") means an individual or a legal +entity exercising rights under, and complying with all of +the terms of, this License. For legal entities, "You" +includes any entity which controls, is controlled by, or is +under common control with You. For purposes of this +definition, "control" means (a) the power, direct or +indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (b) ownership +of more than fifty percent (50%) of the outstanding shares +or beneficial ownership of such entity. + +2. License Grants. + +2.1. The Initial Developer Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, the +Initial Developer hereby grants You a world-wide, +royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Initial Developer, +to use, reproduce, modify, display, perform, +sublicense and distribute the Original Software (or +portions thereof), with or without Modifications, +and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using or selling of Original Software, to make, have +made, use, practice, sell, and offer for sale, and/or +otherwise dispose of the Original Software (or +portions thereof). + +(c) The licenses granted in Sections 2.1(a) and (b) +are effective on the date Initial Developer first +distributes or otherwise makes the Original Software +available to a third party under the terms of this +License. + +(d) Notwithstanding Section 2.1(b) above, no patent +license is granted: (1) for code that You delete from +the Original Software, or (2) for infringements +caused by: (i) the modification of the Original +Software, or (ii) the combination of the Original +Software with other software or devices. + +2.2. Contributor Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, each +Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Contributor to +use, reproduce, modify, display, perform, sublicense +and distribute the Modifications created by such +Contributor (or portions thereof), either on an +unmodified basis, with other Modifications, as +Covered Software and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using, or selling of Modifications made by that +Contributor either alone and/or in combination with +its Contributor Version (or portions of such +combination), to make, use, sell, offer for sale, +have made, and/or otherwise dispose of: (1) +Modifications made by that Contributor (or portions +thereof); and (2) the combination of Modifications +made by that Contributor with its Contributor Version +(or portions of such combination). + +(c) The licenses granted in Sections 2.2(a) and +2.2(b) are effective on the date Contributor first +distributes or otherwise makes the Modifications +available to a third party. + +(d) Notwithstanding Section 2.2(b) above, no patent +license is granted: (1) for any code that Contributor +has deleted from the Contributor Version; (2) for +infringements caused by: (i) third party +modifications of Contributor Version, or (ii) the +combination of Modifications made by that Contributor +with other software (except as part of the +Contributor Version) or other devices; or (3) under +Patent Claims infringed by Covered Software in the +absence of Modifications made by that Contributor. + +3. Distribution Obligations. + +3.1. Availability of Source Code. +Any Covered Software that You distribute or otherwise make +available in Executable form must also be made available in +Source Code form and that Source Code form must be +distributed only under the terms of this License. You must +include a copy of this License with every copy of the +Source Code form of the Covered Software You distribute or +otherwise make available. You must inform recipients of any +such Covered Software in Executable form as to how they can +obtain such Covered Software in Source Code form in a +reasonable manner on or through a medium customarily used +for software exchange. + +3.2. Modifications. +The Modifications that You create or to which You +contribute are governed by the terms of this License. You +represent that You believe Your Modifications are Your +original creation(s) and/or You have sufficient rights to +grant the rights conveyed by this License. + +3.3. Required Notices. +You must include a notice in each of Your Modifications +that identifies You as the Contributor of the Modification. +You may not remove or alter any copyright, patent or +trademark notices contained within the Covered Software, or +any notices of licensing or any descriptive text giving +attribution to any Contributor or the Initial Developer. + +3.4. Application of Additional Terms. +You may not offer or impose any terms on any Covered +Software in Source Code form that alters or restricts the +applicable version of this License or the recipients' +rights hereunder. You may choose to offer, and to charge a +fee for, warranty, support, indemnity or liability +obligations to one or more recipients of Covered Software. +However, you may do so only on Your own behalf, and not on +behalf of the Initial Developer or any Contributor. You +must make it absolutely clear that any such warranty, +support, indemnity or liability obligation is offered by +You alone, and You hereby agree to indemnify the Initial +Developer and every Contributor for any liability incurred +by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + +3.5. Distribution of Executable Versions. +You may distribute the Executable form of the Covered +Software under the terms of this License or under the terms +of a license of Your choice, which may contain terms +different from this License, provided that You are in +compliance with the terms of this License and that the +license for the Executable form does not attempt to limit +or alter the recipient's rights in the Source Code form +from the rights set forth in this License. If You +distribute the Covered Software in Executable form under a +different license, You must make it absolutely clear that +any terms which differ from this License are offered by You +alone, not by the Initial Developer or Contributor. You +hereby agree to indemnify the Initial Developer and every +Contributor for any liability incurred by the Initial +Developer or such Contributor as a result of any such terms +You offer. + +3.6. Larger Works. +You may create a Larger Work by combining Covered Software +with other code not governed by the terms of this License +and distribute the Larger Work as a single product. In such +a case, You must make sure the requirements of this License +are fulfilled for the Covered Software. + +4. Versions of the License. + +4.1. New Versions. +Sun Microsystems, Inc. is the initial license steward and +may publish revised and/or new versions of this License +from time to time. Each version will be given a +distinguishing version number. Except as provided in +Section 4.3, no one other than the license steward has the +right to modify this License. + +4.2. Effect of New Versions. +You may always continue to use, distribute or otherwise +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. If the Initial Developer includes a +notice in the Original Software prohibiting it from being +distributed or otherwise made available under any +subsequent version of the License, You must distribute and +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. Otherwise, You may also choose to +use, distribute or otherwise make the Covered Software +available under the terms of any subsequent version of the +License published by the license steward. + +4.3. Modified Versions. +When You are an Initial Developer and You want to create a +new license for Your Original Software, You may create and +use a modified version of this License if You: (a) rename +the license and remove any references to the name of the +license steward (except to note that the license differs +from this License); and (b) otherwise make it clear that +the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS +IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR +IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE +COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A +PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH +YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY +RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER +CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, +REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY +CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY +COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS +DISCLAIMER. + +6. TERMINATION. + +6.1. This License and the rights granted hereunder will +terminate automatically if You fail to comply with terms +herein and fail to cure such breach within 30 days of +becoming aware of the breach. Provisions which, by their +nature, must remain in effect beyond the termination of +this License shall survive. + +6.2. If You assert a patent infringement claim (excluding +declaratory judgment actions) against Initial Developer or +a Contributor (the Initial Developer or Contributor against +whom You assert such claim is referred to as "Participant") +alleging that the Participant Software (meaning the +Contributor Version where the Participant is a Contributor +or the Original Software where the Participant is the +Initial Developer) directly or indirectly infringes any +patent, then any and all rights granted directly or +indirectly to You by such Participant, the Initial +Developer (if the Initial Developer is not the Participant) +and all Contributors under Sections 2.1 and/or 2.2 of this +License shall, upon 60 days notice from Participant +terminate prospectively and automatically at the expiration +of such 60 day notice period, unless if within such 60 day +period You withdraw Your claim with respect to the +Participant Software against such Participant either +unilaterally or pursuant to a written agreement with +Participant. + +6.3. In the event of termination under Sections 6.1 or 6.2 +above, all end user licenses that have been validly granted +by You or any distributor hereunder prior to termination +(excluding licenses granted to You by any distributor) +shall survive termination. + +7. LIMITATION OF LIABILITY. + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER +TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL +YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY +DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF +SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY +CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST +PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE +OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR +LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE +POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY +SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY +RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT +APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS +DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR +CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY +NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + +The Covered Software is a "commercial item," as that term is +defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of +"commercial computer software" (as that term is defined at +48 C.F.R. 252.227-7014(a)(1)) and "commercial computer +software documentation" as such terms are used in 48 C.F.R. +12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 +C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. +Government End Users acquire Covered Software with only +those rights set forth herein. This U.S. Government Rights +clause is in lieu of, and supersedes, any other FAR, DFAR, +or other clause or provision that addresses Government +rights in computer software under this License. + +9. MISCELLANEOUS. + +This License represents the complete agreement concerning +subject matter hereof. If any provision of this License is +held to be unenforceable, such provision shall be reformed +only to the extent necessary to make it enforceable. This +License shall be governed by the law of the jurisdiction +specified in a notice contained within the Original Software +(except to the extent applicable law, if any, provides +otherwise), excluding such jurisdiction's conflict-of-law +provisions. Any litigation relating to this License shall be +subject to the jurisdiction of the courts located in the +jurisdiction and venue specified in a notice contained +within the Original Software, with the losing party +responsible for costs, including, without limitation, court +costs and reasonable attorneys' fees and expenses. The +application of the United Nations Convention on Contracts +for the International Sale of Goods is expressly excluded. +Any law or regulation which provides that the language of a +contract shall be construed against the drafter shall not +apply to this License. You agree that You alone are +responsible for compliance with the United States export +administration regulations (and the export control laws and +regulation of any other countries) when You use, distribute +or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + +As between Initial Developer and the Contributors, each +party is responsible for claims and damages arising, +directly or indirectly, out of its utilization of rights +under this License and You agree to work with Initial +Developer and Contributors to distribute such responsibility +on an equitable basis. Nothing herein is intended or shall +be deemed to constitute any admission of liability. + + +************************************************************ + +LICENSE #3: + +JGO 5.1 IN SOA PACK + +Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE + +Licensee/Company: Entity receiving Software. + +Effective Date: Date Sun delivers the Software to You. + +Software: JGo 5.1 + +License Term: Perpetual (subject to termination under the +SLA). + +Licensed Unit: Software Copy. + +Licensed unit Count: Unlimited. + +Permitted Uses: You may reproduce and use the Software for +Individual, Commercial, Research and Instructional and +Service Provider Use, subject to and conditioned on Your +compliance with the Additional Terms below. + +Additional Terms: + +1. Software includes only the versions of the above products +that are made initially available to You. + +2. Notwithstanding anything to the contrary in any Master +Terms between the parties or in the SLA, Master Terms do +not apply to Software under this Agreement. + +3. You may only use the Software in binary form and only in +conjunction with NetBeans. + + +Sun Microsystems, Inc. ("Sun") +SOFTWARE LICENSE AGREEMENT + +READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY +BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE +MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF +YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR +ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" (OR +EQUIVALENT) BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO +NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED +SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF +SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" +(OR EQUIVALENT) BUTTON AT THE END OF THIS AGREEMENT. IF YOU +HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR +YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS +AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT +AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE. + +1. Definitions. + +(a) "Entitlement" means the collective set of applicable +documents authorized by Sun evidencing your obligation to +pay associated fees (if any) for the license, associated +Services, and the authorized scope of use of Software under +this Agreement. + +(b) "Licensed Unit" means the unit of measure by which your +use of Software and/or Service is licensed, as described in +your Entitlement. + +(c) "Permitted Use" means the licensed Software use(s) +authorized in this Agreement as specified in your +Entitlement. The Permitted Use for any bundled Sun software +not specified in your Entitlement will be evaluation use as +provided in Section 3. + +(d) "Service" means the service(s) that Sun or its delegate +will provide, if any, as selected in your Entitlement and as +further described in the applicable service listings at +www.sun.com/service/servicelist. + +(e) "Software" means the Sun software described in your +Entitlement. Also, certain software may be included for +evaluation use under Section 3. + +(f) "You" and "Your" means the individual or legal entity +specified in the Entitlement, or for evaluation purposes, +the entity performing the evaluation. + +2. License Grant and Entitlement. + +Subject to the terms of your Entitlement, Sun grants you a +nonexclusive, nontransferable limited license to use +Software for its Permitted Use for the license term. Your +Entitlement will specify (a) Software licensed, (b) the +Permitted Use, (c) the license term, and (d) the Licensed +Units. + +Additionally, if your Entitlement includes Services, then it +will also specify the (e) Service and (f) service term. + +If your rights to Software or Services are limited in +duration and the date such rights begin is other than the +purchase date, your Entitlement will provide that beginning +date(s). + +The Entitlement may be delivered to you in various ways +depending on the manner in which you obtain Software and +Services, for example, the Entitlement may be provided in +your receipt, invoice or your contract with Sun or +authorized Sun reseller. It may also be in electronic format +if you download Software. + +3. Permitted Use. + +As selected in your Entitlement, one or more of the +following Permitted Uses will apply to your use of Software. +Unless you have an Entitlement that expressly permits it, +you may not use Software for any of the other Permitted +Uses. If you don't have an Entitlement, or if your +Entitlement doesn't cover additional software delivered to +you, then such software is for your Evaluation Use. + +(a) Evaluation Use. You may evaluate Software internally for +a period of 90 days from your first use. + +(b) Research and Instructional Use. You may use Software +internally to design, develop and test, and also to provide +instruction on such uses. + +(c) Individual Use. You may use Software internally for +personal, individual use. + +(d) Commercial Use. You may use Software internally for your +own commercial purposes. + +(e) Service Provider Use. You may make Software +functionality accessible (but not by providing Software +itself or through outsourcing services) to your end users in +an extranet deployment, but not to your affiliated companies +or to government agencies. + +4. Licensed Units. + +Your Permitted Use is limited to the number of Licensed +Units stated in your Entitlement. If you require additional +Licensed Units, you will need additional Entitlement(s). + +5. Restrictions. + +(a) The copies of Software provided to you under this +Agreement is licensed, not sold, to you by Sun. Sun reserves +all rights not expressly granted. (b) You may make a single +archival copy of Software, but otherwise may not copy, +modify, or distribute Software. However if the Sun +documentation accompanying Software lists specific portions +of Software, such as header files, class libraries, +reference source code, and/or redistributable files, that +may be handled differently, you may do so only as provided +in the Sun documentation. (c) You may not rent, lease, lend +or encumber Software. (d) Unless enforcement is prohibited +by applicable law, you may not decompile, or reverse +engineer Software. (e) The terms and conditions of this +Agreement will apply to any Software updates, provided to +you at Sun's discretion, that replace and/or supplement the +original Software, unless such update contains a separate +license. (f) You may not publish or provide the results of +any benchmark or comparison tests run on Software to any +third party without the prior written consent of Sun. (g) +Software is confidential and copyrighted. (h) Unless +otherwise specified, if Software is delivered with embedded +or bundled software that enables functionality of Software, +you may not use such software on a stand-alone basis or use +any portion of such software to interoperate with any +program(s) other than Software. (i) Software may contain +programs that perform automated collection of system data +and/or automated software updating services. System data +collected through such programs may be used by Sun, its +subcontractors, and its service delivery partners for the +purpose of providing you with remote system services and/or +improving Sun's software and systems. (j) Software is not +designed, licensed or intended for use in the design, +construction, operation or maintenance of any nuclear +facility and Sun and its licensors disclaim any express or +implied warranty of fitness for such uses. (k) No right, +title or interest in or to any trademark, service mark, logo +or trade name of Sun or its licensors is granted under this +Agreement. + +6. Java Compatibility and Open Source. + +Software may contain Java technology. You may not create +additional classes to, or modifications of, the Java +technology, except under compatibility requirements +available under a separate agreement available at +www.java.net. + +Sun supports and benefits from the global community of open +source developers, and thanks the community for its +important contributions and open standards-based technology, +which Sun has adopted into many of its products. + +Please note that portions of Software may be provided with +notices and open source licenses from such communities and +third parties that govern the use of those portions, and any +licenses granted hereunder do not alter any rights and +obligations you may have under such open source licenses, +however, the disclaimer of warranty and limitation of +liability provisions in this Agreement will apply to all +Software in this distribution. + +7. Term and Termination. + +The license and service term are set forth in your +Entitlement(s). Your rights under this Agreement will +terminate immediately without notice from Sun if you +materially breach it or take any action in derogation of +Sun's and/or its licensors' rights to Software. Sun may +terminate this Agreement should any Software become, or in +Sun's reasonable opinion likely to become, the subject of a +claim of intellectual property infringement or trade secret +misappropriation. Upon termination, you will cease use of, +and destroy, Software and confirm compliance in writing to +Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination +of the Agreement. + +8. Limited Warranty. + +Sun warrants to you that for a period of 90 days from the +date of purchase, as evidenced by a copy of the receipt, the +media on which Software is furnished (if any) will be free +of defects in materials and workmanship under normal use. +Except for the foregoing, Software is provided "AS IS". Your +exclusive remedy and Sun's entire liability under this +limited warranty will be at Sun's option to replace Software +media or refund the fee paid for Software. Some states do +not allow limitations on certain implied warranties, so the +above may not apply to you. This limited warranty gives you +specific legal rights. You may have others, which vary from +state to state. + +9. Disclaimer of Warranty. + +UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED +CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY +IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, +EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE +LEGALLY INVALID. + +10. Limitation of Liability. + +TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR +ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR +DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR +PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF +LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR +INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's +liability to you, whether in contract, tort (including +negligence), or otherwise, exceed the amount paid by you for +Software under this Agreement. The foregoing limitations +will apply even if the above stated warranty fails of its +essential purpose. Some states do not allow the exclusion of +incidental or consequential damages, so some of the terms +above may not be applicable to you. + +11. Export Regulations. + +All Software, documents, technical data, and any other +materials delivered under this Agreement are subject to U.S. +export control laws and may be subject to export or import +regulations in other countries. You agree to comply strictly +with these laws and regulations and acknowledge that you +have the responsibility to obtain any licenses to export, +re-export, or import as may be required after delivery to +you. + +12. U.S. Government Restricted Rights. + +If Software is being acquired by or on behalf of the U.S. +Government or by a U.S. Government prime contractor or +subcontractor (at any tier), then the Government's rights in +Software and accompanying documentation will be only as set +forth in this Agreement; this is in accordance with 48 CFR +227.7201 through 227.7202-4 (for Department of Defense (DOD) +acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD +acquisitions). + +13. Governing Law. + +Any action related to this Agreement will be governed by +California law and controlling U.S. federal law. No choice +of law rules of any jurisdiction will apply. + +14. Severability. + +If any provision of this Agreement is held to be +unenforceable, this Agreement will remain in effect with the +provision omitted, unless omission would frustrate the +intent of the parties, in which case this Agreement will +immediately terminate. + +15. Integration. + +This Agreement, including any terms contained in your +Entitlement, is the entire agreement between you and Sun +relating to its subject matter. It supersedes all prior or +contemporaneous oral or written communications, proposals, +representations and warranties and prevails over any +conflicting or additional terms of any quote, order, +acknowledgment, or other communication between the parties +relating to its subject matter during the term of this +Agreement. No modification of this Agreement will be +binding, unless in writing and signed by an authorized +representative of each party. + +Please contact Sun Microsystems, Inc. 4150 Network Circle, +Santa Clara, California 95054 if you have questions. + + +************************************************************ + +LICENSE #4: + +SUN JAVA WIRELESS TOOLKIT 2.5.2 FOR CLDC + +Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE + +Licensee/Company: Entity receiving Software. + +Effective Date: Date of delivery of the Software to You. + +Software: +-Sun Java Wireless Toolkit 2.5.2 for CLDC +-SVG Renderer Library + +License Term: Perpetual (subject to termination under the +SLA). + +Licensed Unit: Software Copy. + +Licensed unit Count: Unlimited. + +Permitted Uses: + +1. You may reproduce and use the Software for Your own +Individual, Commercial and Research and Instructional Use +only for the purposes of designing, developing, testing, +and running Your applets and applications ("Programs"). + +2. Subject to the terms and conditions of this Agreement and +restrictions and exceptions set forth in the Software's +documentation, You may reproduce and distribute portions of +Software identified as a redistributable in the +documentation (each a "Redistributable"), provided that You +comply with the following (note that You may be entitled to +reproduce and distribute other portions of the Software not +defined in the documentation as a Redistributable under +certain other licenses as described in the +THIRDPARTYLICENSEREADME, if applicable): + +(a) You distribute Redistributable complete and unmodified +and only bundled as part of Your Programs, + +(b) Your Programs add significant and primary functionality +to the Redistributable, + +(c) You distribute Redistributable for the sole purpose of +running Your Programs, + +(d) You do not distribute additional software intended to +replace any component(s) of the Redistributable, + +(e) You do not remove or alter any proprietary legends or +notices contained in or on the Redistributable. + +(f) You only distribute the Redistributable subject to a +license agreement that protects Sun's interests consistent +with the terms contained in this Agreement, and + +(g) You agree to defend and indemnify Sun and its licensors +from and against any damages, costs, liabilities, +settlement amounts and/or expenses (including attorneys' +fees) incurred in connection with any claim, lawsuit or +action by any third party that arises or results from the +use or distribution of any and all Programs and/or +Redistributable. + +3. Java Technology Restrictions. You may not create, +modify, or change the behavior of, or authorize Your +licensees to create, modify, or change the behavior of, +classes, interfaces, or subpackages that are in any way +identified as "java", "javax", "sun" or similar convention +as specified by Sun in any naming convention designation. + + +Sun Microsystems, Inc. ("Sun") SOFTWARE LICENSE AGREEMENT + +READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY +BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE +MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF +YOU DO NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE +UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND. IF +YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") +FOR YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-5 OF THIS +AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT +AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE. + +1. Definitions. + +(a) "Entitlement" means the collective set of applicable +documents authorized by Sun evidencing your obligation to +pay associated fees (if any) for the license, associated +Services, and the authorized scope of use of Software under +this Agreement. + +(b) "Licensed Unit" means the unit of measure by which +your use of Software and/or Service is licensed, as +described in your Entitlement. + +(c) "Permitted Use" means the licensed Software use(s) +authorized in this Agreement as specified in your +Entitlement. The Permitted Use for any bundled Sun software +not specified in your Entitlement will be evaluation use as +provided in Section 3. + +(d) "Service" means the service(s) that Sun or its +delegate will provide, if any, as selected in your +Entitlement and as further described in the applicable +service listings at www.sun.com/service/servicelist. + +(e) "Software" means the Sun software described in your +Entitlement. Also, certain software may be included for +evaluation use under Section 3. + +(f) "You" and "Your" means the individual or legal +entity specified in the Entitlement, or for evaluation +purposes, the entity performing the evaluation. + +2. License Grant and Entitlement. + +Subject to the terms of your Entitlement, Sun grants you a +nonexclusive, nontransferable limited license to use +Software for its Permitted Use for the license term. Your +Entitlement will specify (a) Software licensed, (b) the +Permitted Use, (c) the license term, and (d) the Licensed +Units. + +Additionally, if your Entitlement includes Services, then it +will also specify the (e) Service and (f) service term. + +If your rights to Software or Services are limited in +duration and the date such rights begin is other than the +purchase date, your Entitlement will provide that beginning +date(s). + +The Entitlement may be delivered to you in various ways +depending on the manner in which you obtain Software and +Services, for example, the Entitlement may be provided in +your receipt, invoice or your contract with Sun or +authorized Sun reseller. It may also be in electronic format +if you download Software. + +3. Permitted Use. + +As selected in your Entitlement, one or more of the +following Permitted Uses will apply to your use of Software. +Unless you have an Entitlement that expressly permits it, +you may not use Software for any of the other Permitted +Uses. If you don't have an Entitlement, or if your +Entitlement doesn't cover additional software delivered to +you, then such software is for your Evaluation Use. + +(a) Evaluation Use. You may evaluate Software internally for +a period of 90 days from your first use. + +(b) Research and Instructional Use. You may use Software +internally to design, develop and test, and also to provide +instruction on such uses. + +(c) Individual Use. You may use Software internally for +personal, individual use. + +(d) Commercial Use. You may use Software internally for your +own commercial purposes. + +(e) Service Provider Use. You may make Software +functionality accessible (but not by providing Software +itself or through outsourcing services) to your end users in +an extranet deployment, but not to your affiliated companies +or to government agencies. + +4. Licensed Units. + +Your Permitted Use is limited to the number of Licensed +Units stated in your Entitlement. If you require additional +Licensed Units, you will need additional Entitlement(s). + +5. Restrictions. + +(a) The copies of Software provided to you under this +Agreement is licensed, not sold, to you by Sun. Sun reserves +all rights not expressly granted. (b) You may make a single +archival copy of Software, but otherwise may not copy, +modify, or distribute Software. However if the Sun +documentation accompanying Software lists specific portions +of Software, such as header files, class libraries, +reference source code, and/or redistributable files, that +may be handled differently, you may do so only as provided +in the Sun documentation. (c) You may not rent, lease, lend +or encumber Software. (d) Unless enforcement is prohibited +by applicable law, you may not decompile, or reverse +engineer Software. (e) The terms and conditions of this +Agreement will apply to any Software updates, provided to +you at Sun's discretion, that replace and/or supplement the +original Software, unless such update contains a separate +license. (f) You may not publish or provide the results of +any benchmark or comparison tests run on Software to any +third party without the prior written consent of Sun. (g) +Software is confidential and copyrighted. (h) Unless +otherwise specified, if Software is delivered with embedded +or bundled software that enables functionality of Software, +you may not use such software on a stand-alone basis or use +any portion of such software to interoperate with any +program(s) other than Software. (i) Software may contain +programs that perform automated collection of system data +and/or automated software updating services. System data +collected through such programs may be used by Sun, its +subcontractors, and its service delivery partners for the +purpose of providing you with remote system services and/or +improving Sun's software and systems. (j) Software is not +designed, licensed or intended for use in the design, +construction, operation or maintenance of any nuclear +facility and Sun and its licensors disclaim any express or +implied warranty of fitness for such uses. (k) No right, +title or interest in or to any trademark, service mark, logo +or trade name of Sun or its licensors is granted under this +Agreement. + +6. Term and Termination. + +The license and service term are set forth in your +Entitlement(s). Your rights under this Agreement will +terminate immediately without notice from Sun if you +materially breach it or take any action in derogation of +Sun's and/or its licensors' rights to Software. Sun may +terminate this Agreement should any Software become, or in +Sun's reasonable opinion likely to become, the subject of a +claim of intellectual property infringement or trade secret +misappropriation. Upon termination, you will cease use of, +and destroy, Software and confirm compliance in writing to +Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination +of the Agreement. + +7. Java Compatibility and Open Source. + +Software may contain Java technology. You may not create +additional classes to, or modifications of, the Java +technology, except under compatibility requirements +available under a separate agreement available at +www.java.net. + +Sun supports and benefits from the global community of open +source developers, and thanks the community for its +important contributions and open standards- based +technology, which Sun has adopted into many of its products. + +Please note that portions of Software may be provided with +notices and open source licenses from such communities and +third parties that govern the use of those portions, and any +licenses granted hereunder do not alter any rights and +obligations you may have under such open source licenses, +however, the disclaimer of warranty and limitation of +liability provisions in this Agreement will apply to all +Software in this distribution. + +8. Limited Warranty. + +Sun warrants to you that for a period of 90 days from the +date of purchase, as evidenced by a copy of the receipt, the +media on which Software is furnished (if any) will be free +of defects in materials and workmanship under normal use. +Except for the foregoing, Software is provided "AS IS". Your +exclusive remedy and Sun's entire liability under this +limited warranty will be at Sun's option to replace Software +media or refund the fee paid for Software. Some states do +not allow limitations on certain implied warranties, so the +above may not apply to you. This limited warranty gives you +specific legal rights. You may have others, which vary from +state to state. + +9. Disclaimer of Warranty. + +UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED +CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY +IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, +EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE +LEGALLY INVALID. + +10. Limitation of Liability. + +TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR +ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR +DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR +PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF +LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR +INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's +liability to you, whether in contract, tort (including +negligence), or otherwise, exceed the amount paid by you for +Software under this Agreement. The foregoing limitations +will apply even if the above stated warranty fails of its +essential purpose. Some states do not allow the exclusion of +incidental or consequential damages, so some of the terms +above may not be applicable to you. + +11. Export Regulations. + +All Software, documents, technical data, and any other +materials delivered under this Agreement are subject to U.S. +export control laws and may be subject to export or import +regulations in other countries. You agree to comply strictly +with these laws and regulations and acknowledge that you +have the responsibility to obtain any licenses to export, +re-export, or import as may be required after delivery to +you. + +12. U.S. Government Restricted Rights. + +If Software is being acquired by or on behalf of the U.S. +Government or by a U.S. Government prime contractor or +subcontractor (at any tier), then the Government's rights +in Software and accompanying documentation will be only as +set forth in this Agreement; this is in accordance with 48 +CFR 227.7201 through 227.7202-4 (for Department of Defense +(DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for +non-DOD acquisitions). + +13. Governing Law. + +Any action related to this Agreement will be governed by +California law and controlling U.S. federal law. No choice +of law rules of any jurisdiction will apply. + +14. Severability. + +If any provision of this Agreement is held to be +unenforceable, this Agreement will remain in effect with +the provision omitted, unless omission would frustrate the +intent of the parties, in which case this Agreement will +immediately terminate. + +15. Integration. + +This Agreement, including any terms contained in your +Entitlement, is the entire agreement between you and Sun +relating to its subject matter. It supersedes all prior or +contemporaneous oral or written communications, proposals, +representations and warranties and prevails over any +conflicting or additional terms of any quote, order, +acknowledgment, or other communication between the parties +relating to its subject matter during the term of this +Agreement. No modification of this Agreement will be +binding, unless in writing and signed by an authorized +representative of each party. + +Please contact Sun Microsystems, Inc. 4150 Network Circle, +Santa Clara, California 95054 if you have questions. + +************************************************************ + +LICENSE #5: + +Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE + +Licensee/Company: Entity receiving Software. + +Effective Date: Date of delivery of the Software to You. + +Software: JavaFX 1.1 Software Development Kit (SDK). + +License Term: Perpetual (subject to termination under the SLA). + +Licensed Unit: Software Copy. + +Licensed Unit Count: One (1). + +Permitted Uses: You may use the Software for Your own +Individual, Commercial, or Research and Instructional Use +for the purposes of designing, developing, testing, and +running Your Programs, subject to and conditioned on Your +compliance with the Additional Terms below. + +Additional Terms: + +1. "Programs" means applications intended to run on the +JavaFX Desktop Runtime on JavaFX-enabled General Purpose +Desktop Computers and Servers. + +2. "General Purpose Desktop Computers and Servers" means +computers, including desktop, laptop and tablet computers, +or servers, used for general computing functions under end +user control (such as but not specifically limited to email, +general purpose Internet browsing, and office suite +productivity tools). The use of Software in systems and +solutions that provide dedicated functionality (other than +as mentioned above) or designed for use in embedded or +function-specific software applications, for example but not +limited to: Software embedded in or bundled with industrial +control systems, wireless mobile telephones, wireless +handheld devices, kiosks, TV/STB, Blu-ray Disc devices, +telematics and network control switching equipment, printers +and storage management systems, and other related systems, +are excluded from the definition of General Purpose Desktop +Computers and Servers and are not licensed under this Agreement. + +3. Notwithstanding anything to the contrary in any Master +Terms between the parties or in the SLA, Master Terms do not +apply to Software under this Agreement. + +4. JavaFX Technology Restrictions. You may not create, +modify, or change the behavior of classes, interfaces, or +subpackages that are in any way identified as “javafx”, +“sun” or similar convention as specified by Sun in any +naming convention designation. + +5. Installation and Auto-Update. The Software's +installation and auto-update processes transmit a limited +amount of data to Sun (or its service provider) about those +specific processes to help Sun understand and optimize them. + Sun does not associate the data with personally +identifiable information. You can find more information +about the data Sun collects at http://java.com/data/. + + +Sun Microsystems, Inc. ("Sun") +SOFTWARE LICENSE AGREEMENT + +READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY +BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE +MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF +YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR +ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" (OR +EQUIVALENT) BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO +NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED +SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF +SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" +(OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT. IF YOU HAVE +SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR YOUR +LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS +AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT +AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE. + +1. Definitions. + +(a) "Entitlement" means the collective set of applicable +documents authorized by Sun evidencing your obligation to +pay associated fees (if any) for the license, associated +Services, and the authorized scope of use of Software under +this Agreement. + +(b) "Licensed Unit" means the unit of measure by which your +use of Software and/or Service is licensed, as described in +your Entitlement. + +(c) "Permitted Use" means the licensed Software use(s) +authorized in this Agreement as specified in your +Entitlement. The Permitted Use for any bundled Sun software +not specified in your Entitlement will be evaluation use as +provided in Section 3. + +(d) "Service" means the service(s) that Sun or its delegate +will provide, if any, as selected in your Entitlement and as +further described in the applicable service listings at +www.sun.com/service/servicelist. + +(e) "Software" means the Sun software described in your +Entitlement. Also, certain software may be included for +evaluation use under Section 3. + +(f) "You" and "Your" means the individual or legal entity +specified in the Entitlement, or for evaluation purposes, +the entity performing the evaluation. + +2. License Grant and Entitlement. + +Subject to the terms of your Entitlement, Sun grants you a +nonexclusive, nontransferable limited license to use +Software for its Permitted Use for the license term. Your +Entitlement will specify (a) Software licensed, (b) the +Permitted Use, (c) the license term, and (d) the Licensed +Units. + +Additionally, if your Entitlement includes Services, then it +will also specify the (e) Service and (f) service term. + +If your rights to Software or Services are limited in +duration and the date such rights begin is other than the +purchase date, your Entitlement will provide that beginning +date(s). + +The Entitlement may be delivered to you in various ways +depending on the manner in which you obtain Software and +Services, for example, the Entitlement may be provided in +your receipt, invoice or your contract with Sun or +authorized Sun reseller. It may also be in electronic format +if you download Software. + +3. Permitted Use. + +As selected in your Entitlement, one or more of the +following Permitted Uses will apply to your use of Software. +Unless you have an Entitlement that expressly permits it, +you may not use Software for any of the other Permitted +Uses. If you don't have an Entitlement, or if your +Entitlement doesn't cover additional software delivered to +you, then such software is for your Evaluation Use. + +(a) Evaluation Use. You may evaluate Software internally for +a period of 90 days from your first use. + +(b) Research and Instructional Use. You may use Software +internally to design, develop and test, and also to provide +instruction on such uses. + +(c) Individual Use. You may use Software internally for +personal, individual use. + +(d) Commercial Use. You may use Software internally for your +own commercial purposes. + +(e) Service Provider Use. You may make Software +functionality accessible (but not by providing Software +itself or through outsourcing services) to your end users in +an extranet deployment, but not to your affiliated companies +or to government agencies. + +4. Licensed Units. + +Your Permitted Use is limited to the number of Licensed +Units stated in your Entitlement. If you require additional +Licensed Units, you will need additional Entitlement(s). + +5. Restrictions. + +(a) The copies of Software provided to you under this +Agreement are licensed, not sold, to you by Sun. Sun +reserves all rights not expressly granted. (b) You may make +a single archival copy of Software, but otherwise may not +copy, modify, or distribute Software. However if the Sun +documentation accompanying Software lists specific portions +of Software, such as header files, class libraries, +reference source code, and/or redistributable files, that +may be handled differently, you may do so only as provided +in the Sun documentation. (c) You may not rent, lease, lend +or encumber Software. (d) Unless enforcement is prohibited +by applicable law, you may not decompile, or reverse +engineer Software. (e) The terms and conditions of this +Agreement will apply to any Software updates, provided to +you at Sun's discretion, that replace and/or supplement the +original Software, unless such update contains a separate +license. (f) You may not publish or provide the results of +any benchmark or comparison tests run on Software to any +third party without the prior written consent of Sun. (g) +Software is confidential and copyrighted. (h) Unless +otherwise specified, if Software is delivered with embedded +or bundled software that enables functionality of Software, +you may not use such software on a stand-alone basis or use +any portion of such software to interoperate with any +program(s) other than Software. (i) Software may contain +programs that perform automated collection of system data +and/or automated software updating services. System data +collected through such programs may be used by Sun, its +subcontractors, and its service delivery partners for the +purpose of providing you with remote system services and/or +improving Sun's software and systems. (j) Software is not +designed, licensed or intended for use in the design, +construction, operation or maintenance of any nuclear +facility and Sun and its licensors disclaim any express or +implied warranty of fitness for such uses. (k) No right, +title or interest in or to any trademark, service mark, logo +or trade name of Sun or its licensors is granted under this +Agreement. + +6. Java Compatibility and Open Source. + +Software may contain Java technology. You may not create +additional classes to, or modifications of, the Java +technology, except under compatibility requirements +available under a separate agreement available at www.java.net. + +Sun supports and benefits from the global community of open +source developers, and thanks the community for its +important contributions and open standards-based technology, +which Sun has adopted into many of its products. + +Please note that portions of Software may be provided with +notices and open source licenses from such communities and +third parties that govern the use of those portions, and any +licenses granted hereunder do not alter any rights and +obligations you may have under such open source licenses, +however, the disclaimer of warranty and limitation of +liability provisions in this Agreement will apply to all +Software in this distribution. + +7. Term and Termination. + +The license and service term are set forth in your +Entitlement(s). Your rights under this Agreement will +terminate immediately without notice from Sun if you +materially breach it or take any action in derogation of +Sun's and/or its licensors' rights to Software. Sun may +terminate this Agreement should any Software become, or in +Sun's reasonable opinion likely to become, the subject of a +claim of intellectual property infringement or trade secret +misappropriation. Upon termination, you will cease use of, +and destroy, Software and confirm compliance in writing to +Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination +of the Agreement. + +8. Limited Warranty. + +Sun warrants to you that for a period of 90 days from the +date of purchase, as evidenced by a copy of the receipt, the +media on which Software is furnished (if any) will be free +of defects in materials and workmanship under normal use. +Except for the foregoing, Software is provided "AS IS". Your +exclusive remedy and Sun's entire liability under this +limited warranty will be at Sun's option to replace Software +media or refund the fee paid for Software. Some states do +not allow limitations on certain implied warranties, so the +above may not apply to you. This limited warranty gives you +specific legal rights. You may have others, which vary from +state to state. + +9. Disclaimer of Warranty. + +UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED +CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY +IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, +EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE +LEGALLY INVALID. + +10. Limitation of Liability. + +TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR +ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR +DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR +PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF +LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR +INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's +liability to you, whether in contract, tort (including +negligence), or otherwise, exceed the amount paid by you for +Software under this Agreement. The foregoing limitations +will apply even if the above stated warranty fails of its +essential purpose. Some states do not allow the exclusion of +incidental or consequential damages, so some of the terms +above may not be applicable to you. + +11. Export Regulations. + +All Software, documents, technical data, and any other +materials delivered under this Agreement are subject to U.S. +export control laws and may be subject to export or import +regulations in other countries. You agree to comply strictly +with these laws and regulations and acknowledge that you +have the responsibility to obtain any licenses to export, +re-export, or import as may be required after delivery to you. + +12. U.S. Government Restricted Rights. + +If Software is being acquired by or on behalf of the U.S. +Government or by a U.S. Government prime contractor or +subcontractor (at any tier), then the Government's rights in +Software and accompanying documentation will be only as set +forth in this Agreement; this is in accordance with 48 CFR +227.7201 through 227.7202-4 (for Department of Defense (DOD) +acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD +acquisitions). + +13. Governing Law. + +Any action related to this Agreement will be governed by +California law and controlling U.S. federal law. No choice +of law rules of any jurisdiction will apply. + +14. Severability. + +If any provision of this Agreement is held to be +unenforceable, this Agreement will remain in effect with the +provision omitted, unless omission would frustrate the +intent of the parties, in which case this Agreement will +immediately terminate. + +15. Integration. + +This Agreement, including any terms contained in your +Entitlement, is the entire agreement between you and Sun +relating to its subject matter. It supersedes all prior or +contemporaneous oral or written communications, proposals, +representations and warranties and prevails over any +conflicting or additional terms of any quote, order, +acknowledgment, or other communication between the parties +relating to its subject matter during the term of this +Agreement. No modification of this Agreement will be +binding, unless in writing and signed by an authorized +representative of each party. + +Please contact Sun Microsystems, Inc. 4150 Network Circle, +Santa Clara, California 95054 if you have questions. + + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-jtb.txt b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-jtb.txt new file mode 100644 index 000000000000..e3219ea42887 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-jtb.txt @@ -0,0 +1,671 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +Java Platform, Enterprise Edition 5 Tools Bundle Update 7 + +Please review the complete list of open-source licenses governing software included in this software. They can be found in the THIRDPARTYREADME.txt file. Please review the list of libraries and licenses provided for use and redistribution by other parties. These libraries are redistributable subject to the conditions in the DISTRIBUTION.txt file. + +This license file contains three (3) distinct licenses. + +Unless specified below, the use of NetBeans IDE 6.5, and components from the GlassFish runtime are governed by the terms of either the GNU General Public License Version 2 with Classpath Exception ("GPLv2 with Classpath Exception") or the Common Development and Distribution License ("CDDL"). The Product also contains components from OpenJDK, which are governed exclusively by the terms of the GPLv2 with Classpath Exception. + +LICENSE #1: GPLv2 with Classpath Exception. + +LICENSE #2: The CDDL governs your use of Portal Pack 3.0 Beta. + +LICENSE #3: The Software License Agreement governs your use of Java Platform, Enterprise Edition 5 SDK Update 7 + + +*********************************************************************** + +LICENSE #1: + +The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. + +One line to give the program's name and a brief idea of what it does. + +Copyright (C) +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. + +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 + +Certain source files distributed by Sun Microsystems, Inc.  are subject to +the following clarification and special exception to the GPL Version 2, but only where Sun has expressly included in the particular source file's header the words +"Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the License file that accompanied this code." + +   Linking this library statically or dynamically with other modules is making a combined work based on this library.  Thus, the terms and conditions of the GNU General Public License Version 2 cover the whole combination. + +   As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent modules, +and to copy and distribute the resulting executable under terms of your +choice, provided that you also meet, for each linked independent module, +the terms and conditions of the license of that module.  An independent +module is a module which is not derived from or based on this library.  If +you modify this library, you may extend this exception to your version of +the library, but you are not obligated to do so.  If you do not wish to do +so, delete this exception statement from your version. + + +*********************************************************************** + +LICENSE #2: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 + +1. Definitions. +1.1. "Contributor" means each individual or entity that +creates or contributes to the creation of Modifications. + +1.2. "Contributor Version" means the combination of the +Original Software, prior Modifications used by a +Contributor (if any), and the Modifications made by that +particular Contributor. + +1.3. "Covered Software" means (a) the Original Software, or +(b) Modifications, or (c) the combination of files +containing Original Software with files containing +Modifications, in each case including portions thereof. + +1.4. "Executable" means the Covered Software in any form +other than Source Code. + +1.5. "Initial Developer" means the individual or entity +that first makes Original Software available under this +License. + +1.6. "Larger Work" means a work which combines Covered +Software or portions thereof with code not governed by the +terms of this License. + +1.7. "License" means this document. + +1.8. "Licensable" means having the right to grant, to the +maximum extent possible, whether at the time of the initial +grant or subsequently acquired, any and all of the rights +conveyed herein. + +1.9. "Modifications" means the Source Code and Executable +form of any of the following: + +A. Any file that results from an addition to, +deletion from or modification of the contents of a +file containing Original Software or previous +Modifications; + +B. Any new file that contains any part of the +Original Software or previous Modification; or + +C. Any new file that is contributed or otherwise made +available under the terms of this License. + +1.10. "Original Software" means the Source Code and +Executable form of computer software code that is +originally released under this License. + +1.11. "Patent Claims" means any patent claim(s), now owned +or hereafter acquired, including without limitation, +method, process, and apparatus claims, in any patent +Licensable by grantor. + +1.12. "Source Code" means (a) the common form of computer +software code in which modifications are made and (b) +associated documentation included in or with such code. + +1.13. "You" (or "Your") means an individual or a legal +entity exercising rights under, and complying with all of +the terms of, this License. For legal entities, "You" +includes any entity which controls, is controlled by, or is +under common control with You. For purposes of this +definition, "control" means (a) the power, direct or +indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (b) ownership +of more than fifty percent (50%) of the outstanding shares +or beneficial ownership of such entity. + +2. License Grants. + +2.1. The Initial Developer Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, the +Initial Developer hereby grants You a world-wide, +royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Initial Developer, +to use, reproduce, modify, display, perform, +sublicense and distribute the Original Software (or +portions thereof), with or without Modifications, +and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using or selling of Original Software, to make, have +made, use, practice, sell, and offer for sale, and/or +otherwise dispose of the Original Software (or +portions thereof). + +(c) The licenses granted in Sections 2.1(a) and (b) +are effective on the date Initial Developer first +distributes or otherwise makes the Original Software +available to a third party under the terms of this +License. + +(d) Notwithstanding Section 2.1(b) above, no patent +license is granted: (1) for code that You delete from +the Original Software, or (2) for infringements +caused by: (i) the modification of the Original +Software, or (ii) the combination of the Original +Software with other software or devices. + +2.2. Contributor Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, each +Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Contributor to +use, reproduce, modify, display, perform, sublicense +and distribute the Modifications created by such +Contributor (or portions thereof), either on an +unmodified basis, with other Modifications, as +Covered Software and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using, or selling of Modifications made by that +Contributor either alone and/or in combination with +its Contributor Version (or portions of such +combination), to make, use, sell, offer for sale, +have made, and/or otherwise dispose of: (1) +Modifications made by that Contributor (or portions +thereof); and (2) the combination of Modifications +made by that Contributor with its Contributor Version +(or portions of such combination). + +(c) The licenses granted in Sections 2.2(a) and +2.2(b) are effective on the date Contributor first +distributes or otherwise makes the Modifications +available to a third party. + +(d) Notwithstanding Section 2.2(b) above, no patent +license is granted: (1) for any code that Contributor +has deleted from the Contributor Version; (2) for +infringements caused by: (i) third party +modifications of Contributor Version, or (ii) the +combination of Modifications made by that Contributor +with other software (except as part of the +Contributor Version) or other devices; or (3) under +Patent Claims infringed by Covered Software in the +absence of Modifications made by that Contributor. + +3. Distribution Obligations. + +3.1. Availability of Source Code. +Any Covered Software that You distribute or otherwise make +available in Executable form must also be made available in +Source Code form and that Source Code form must be +distributed only under the terms of this License. You must +include a copy of this License with every copy of the +Source Code form of the Covered Software You distribute or +otherwise make available. You must inform recipients of any +such Covered Software in Executable form as to how they can +obtain such Covered Software in Source Code form in a +reasonable manner on or through a medium customarily used +for software exchange. + +3.2. Modifications. +The Modifications that You create or to which You +contribute are governed by the terms of this License. You +represent that You believe Your Modifications are Your +original creation(s) and/or You have sufficient rights to +grant the rights conveyed by this License. + +3.3. Required Notices. +You must include a notice in each of Your Modifications +that identifies You as the Contributor of the Modification. +You may not remove or alter any copyright, patent or +trademark notices contained within the Covered Software, or +any notices of licensing or any descriptive text giving +attribution to any Contributor or the Initial Developer. + +3.4. Application of Additional Terms. +You may not offer or impose any terms on any Covered +Software in Source Code form that alters or restricts the +applicable version of this License or the recipients' +rights hereunder. You may choose to offer, and to charge a +fee for, warranty, support, indemnity or liability +obligations to one or more recipients of Covered Software. +However, you may do so only on Your own behalf, and not on +behalf of the Initial Developer or any Contributor. You +must make it absolutely clear that any such warranty, +support, indemnity or liability obligation is offered by +You alone, and You hereby agree to indemnify the Initial +Developer and every Contributor for any liability incurred +by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + +3.5. Distribution of Executable Versions. +You may distribute the Executable form of the Covered +Software under the terms of this License or under the terms +of a license of Your choice, which may contain terms +different from this License, provided that You are in +compliance with the terms of this License and that the +license for the Executable form does not attempt to limit +or alter the recipient's rights in the Source Code form +from the rights set forth in this License. If You +distribute the Covered Software in Executable form under a +different license, You must make it absolutely clear that +any terms which differ from this License are offered by You +alone, not by the Initial Developer or Contributor. You +hereby agree to indemnify the Initial Developer and every +Contributor for any liability incurred by the Initial +Developer or such Contributor as a result of any such terms +You offer. + +3.6. Larger Works. +You may create a Larger Work by combining Covered Software +with other code not governed by the terms of this License +and distribute the Larger Work as a single product. In such +a case, You must make sure the requirements of this License +are fulfilled for the Covered Software. + +4. Versions of the License. + +4.1. New Versions. +Sun Microsystems, Inc. is the initial license steward and +may publish revised and/or new versions of this License +from time to time. Each version will be given a +distinguishing version number. Except as provided in +Section 4.3, no one other than the license steward has the +right to modify this License. + +4.2. Effect of New Versions. +You may always continue to use, distribute or otherwise +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. If the Initial Developer includes a +notice in the Original Software prohibiting it from being +distributed or otherwise made available under any +subsequent version of the License, You must distribute and +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. Otherwise, You may also choose to +use, distribute or otherwise make the Covered Software +available under the terms of any subsequent version of the +License published by the license steward. + +4.3. Modified Versions. +When You are an Initial Developer and You want to create a +new license for Your Original Software, You may create and +use a modified version of this License if You: (a) rename +the license and remove any references to the name of the +license steward (except to note that the license differs +from this License); and (b) otherwise make it clear that +the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" +BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED +SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR +PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY +COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE +INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF +ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF +WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF +ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS +DISCLAIMER. + +6. TERMINATION. + +6.1. This License and the rights granted hereunder will +terminate automatically if You fail to comply with terms +herein and fail to cure such breach within 30 days of +becoming aware of the breach. Provisions which, by their +nature, must remain in effect beyond the termination of +this License shall survive. + + +6.2. If You assert a patent infringement claim (excluding +declaratory judgment actions) against Initial Developer or +a Contributor (the Initial Developer or Contributor against +whom You assert such claim is referred to as "Participant") +alleging that the Participant Software (meaning the +Contributor Version where the Participant is a Contributor +or the Original Software where the Participant is the +Initial Developer) directly or indirectly infringes any +patent, then any and all rights granted directly or +indirectly to You by such Participant, the Initial +Developer (if the Initial Developer is not the Participant) +and all Contributors under Sections 2.1 and/or 2.2 of this +License shall, upon 60 days notice from Participant +terminate prospectively and automatically at the expiration +of such 60 day notice period, unless if within such 60 day +period You withdraw Your claim with respect to the +Participant Software against such Participant either +unilaterally or pursuant to a written agreement with +Participant. + +6.3. In the event of termination under Sections 6.1 or 6.2 +above, all end user licenses that have been validly granted +by You or any distributor hereunder prior to termination +(excluding licenses granted to You by any distributor) +shall survive termination. + +7. LIMITATION OF LIABILITY. + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT +(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE +INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF +COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE +LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR +CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT +LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK +STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER +COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN +INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF +LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL +INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT +APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO +NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR +CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT +APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + +The Covered Software is a "commercial item," as that term is +defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial +computer software" (as that term is defined at 48 C.F.R. ¤ +252.227-7014(a)(1)) and "commercial computer software +documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. +1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 +through 227.7202-4 (June 1995), all U.S. Government End Users +acquire Covered Software with only those rights set forth herein. +This U.S. Government Rights clause is in lieu of, and supersedes, +any other FAR, DFAR, or other clause or provision that addresses +Government rights in computer software under this License. + +9. MISCELLANEOUS. + +This License represents the complete agreement concerning subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the +extent necessary to make it enforceable. This License shall be +governed by the law of the jurisdiction specified in a notice +contained within the Original Software (except to the extent +applicable law, if any, provides otherwise), excluding such +jurisdiction's conflict-of-law provisions. Any litigation +relating to this License shall be subject to the jurisdiction of +the courts located in the jurisdiction and venue specified in a +notice contained within the Original Software, with the losing +party responsible for costs, including, without limitation, court +costs and reasonable attorneys' fees and expenses. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. Any law or +regulation which provides that the language of a contract shall +be construed against the drafter shall not apply to this License. +You agree that You alone are responsible for compliance with the +United States export administration regulations (and the export +control laws and regulation of any other countries) when You use, +distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + +As between Initial Developer and the Contributors, each party is +responsible for claims and damages arising, directly or +indirectly, out of its utilization of rights under this License +and You agree to work with Initial Developer and Contributors to +distribute such responsibility on an equitable basis. Nothing +herein is intended or shall be deemed to constitute any admission +of liability. + +*********************************************************************** + + +License #3 + +Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE + +Licensee/Company: Entity receiving Software. + +Effective Date: Date of delivery of the Software to You. + +Software: Java Application Platform SDK Update 7, which includes the following: + +i)Sun GlassFish Enterprise Server v2.1 +ii)Open ESB v2 +iii)Sun Java System Access Manager 7.1 Patch 1 +iv)Portlet Container 2.1 +v)Web Services for Remote Portlets 2.0 Beta 2 +vi)Java Platform, Enterprise Edition 5 Samples +vii)Java BluePrints +viii)API Documentation +ix)Your First Cup: An Introduction to the Java EE Platform + +Host Software: The software product described in the Software's documentation with which the Software is intended to be used. + +Permitted Use: The Permitted Use shall be the same as the Permitted Use in Your Host Software's Software License Agreement. Software may only be used in conjunction with the Host Software. Use of the Software on a stand-alone basis is not permitted under this license. If You do not have a valid license to use the Host Software, You may not use the Software for any Permitted Use, including Evaluation Use. + +License Term: The License Term shall be the same as the License Term set forth in your Host Software's Software License Agreement. + +Licensed Unit: The Licensed Unit shall be the same as the Licensed Unit set forth in your Host Software's Software License Agreement. + +Licensed Unit Count: The License Unit Count shall be the same as the Licensed Unit Count set forth in your Host Software's Software License Agreement. + +Sun Microsystems, Inc. ("Sun") +SOFTWARE LICENSE AGREEMENT + +READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" (OR EQUIVALENT) BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT. IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE. + +1. Definitions. + +(a) "Entitlement" means the collective set of applicable documents authorized by Sun evidencing your obligation to pay associated fees (if any) for the license, associated Services, and the authorized scope of use of Software under this Agreement. + +(b) "Licensed Unit" means the unit of measure by which your use of Software and/or Service is licensed, as described in your Entitlement. + +(c) "Permitted Use" means the licensed Software use(s) authorized in this Agreement as specified in your Entitlement. The Permitted Use for any bundled Sun software not specified in your Entitlement will be evaluation use as provided in Section 3. + +(d) "Service" means the service(s) that Sun or its delegate will provide, if any, as selected in your Entitlement and as further described in the applicable service listings at www.sun.com/service/servicelist. + +(e) "Software" means the Sun software described in your Entitlement. Also, certain software may be included for evaluation use under Section 3. + +(f) "You" and "Your" means the individual or legal entity specified in the Entitlement, or for evaluation purposes, the entity performing the evaluation. + +2. License Grant and Entitlement. + +Subject to the terms of your Entitlement, Sun grants you a nonexclusive, nontransferable limited license to use Software for its Permitted Use for the license term. Your Entitlement will specify (a) Software licensed, (b) the Permitted Use, (c) the license term, and (d) the Licensed Units. + +Additionally, if your Entitlement includes Services, then it will also specify the (e) Service and (f) service term. + +If your rights to Software or Services are limited in duration and the date such rights begin is other than the purchase date, your Entitlement will provide that beginning date(s). + +The Entitlement may be delivered to you in various ways depending on the manner in which you obtain Software and Services, for example, the Entitlement may be provided in your receipt, invoice or your contract with Sun or authorized Sun reseller. It may also be in electronic format if you download Software. + +3. Permitted Use. + +As selected in your Entitlement, one or more of the following Permitted Uses will apply to your use of Software. Unless you have an Entitlement that expressly permits it, you may not use Software for any of the other Permitted Uses. If you don't have an Entitlement, or if your Entitlement doesn't cover additional software delivered to you, then such software is for your Evaluation Use. + +(a) Evaluation Use. You may evaluate Software internally for a period of 90 days from your first use. + +(b) Research and Instructional Use. You may use Software internally to design, develop and test, and also to provide instruction on such uses. + +(c) Individual Use. You may use Software internally for personal, individual use. + +(d) Commercial Use. You may use Software internally for your own commercial purposes. + +(e) Service Provider Use. You may make Software functionality accessible (but not by providing Software itself or through outsourcing services) to your end users in an extranet deployment, but not to your affiliated companies or to government agencies. + +4. Licensed Units. + +Your Permitted Use is limited to the number of Licensed Units stated in your Entitlement. If you require additional Licensed Units, you will need additional Entitlement(s). + +5. Restrictions. + +(a) The copies of Software provided to you under this Agreement are licensed, not sold, to you by Sun. Sun reserves all rights not expressly granted. (b) You may make a single archival copy of Software, but otherwise may not copy, modify, or distribute Software. However if the Sun documentation accompanying Software lists specific portions of Software, such as header files, class libraries, reference source code, and/or redistributable files, that may be handled differently, you may do so only as provided in the Sun documentation. (c) You may not rent, lease, lend or encumber Software. (d) Unless enforcement is prohibited by applicable law, you may not decompile, or reverse engineer Software. (e) The terms and conditions of this Agreement will apply to any Software updates, provided to you at Sun's discretion, that replace and/or supplement the original Software, unless such update contains a separate license. (f) You may not publish or provide the results of any benchmark or comparison tests run on Software to any third party without the prior written consent of Sun. (g) Software is confidential and copyrighted. (h) Unless otherwise specified, if Software is delivered with embedded or bundled software that enables functionality of Software, you may not use such software on a stand-alone basis or use any portion of such software to interoperate with any program(s) other than Software. (i) Software may contain programs that perform automated collection of system data and/or automated software updating services. System data collected through such programs may be used by Sun, its subcontractors, and its service delivery partners for the purpose of providing you with remote system services and/or improving Sun's software and systems. (j) Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility and Sun and its licensors disclaim any express or implied warranty of fitness for such uses. (k) No right, title or interest in or to any trademark, service mark, logo or trade name of Sun or its licensors is granted under this Agreement. + +6. Java Compatibility and Open Source. + +Software may contain Java technology. You may not create additional classes to, or modifications of, the Java technology, except under compatibility requirements available under a separate agreement available at www.java.net. + +Sun supports and benefits from the global community of open source developers, and thanks the community for its important contributions and open standards-based technology, which Sun has adopted into many of its products. + +Please note that portions of Software may be provided with notices and open source licenses from such communities and third parties that govern the use of those portions, and any licenses granted hereunder do not alter any rights and obligations you may have under such open source licenses, however, the disclaimer of warranty and limitation of liability provisions in this Agreement will apply to all Software in this distribution. + +7. Term and Termination. + +The license and service term are set forth in your Entitlement(s). Your rights under this Agreement will terminate immediately without notice from Sun if you materially breach it or take any action in derogation of Sun's and/or its licensors' rights to Software. Sun may terminate this Agreement should any Software become, or in Sun's reasonable opinion likely to become, the subject of a claim of intellectual property infringement or trade secret misappropriation. Upon termination, you will cease use of, and destroy, Software and confirm compliance in writing to Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination of the Agreement. + +8. Limited Warranty. + +Sun warrants to you that for a period of 90 days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished (if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. Some states do not allow limitations on certain implied warranties, so the above may not apply to you. This limited warranty gives you specific legal rights. You may have others, which vary from state to state. + +9. Disclaimer of Warranty. + +UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. + +10. Limitation of Liability. + +TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. Some states do not allow the exclusion of incidental or consequential damages, so some of the terms above may not be applicable to you. + +11. Export Regulations. + +All Software, documents, technical data, and any other materials delivered under this Agreement are subject to U.S. export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with these laws and regulations and acknowledge that you have the responsibility to obtain any licenses to export, re-export, or import as may be required after delivery to you. + +12. U.S. Government Restricted Rights. + +If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement; this is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD acquisitions). + +13. Governing Law. + +Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply. + +14. Severability. + +If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. + +15. Integration. + +This Agreement, including any terms contained in your Entitlement, is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. + +Please contact Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054 if you have questions. diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-mysql.txt b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-mysql.txt new file mode 100644 index 000000000000..270a1906871c --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license-mysql.txt @@ -0,0 +1,830 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +NETBEANS IDE 6.1 WITH GLASSFISH AND MYSQL + +Please review the complete list of open-source licenses +governing software included in the Product. They can be +found in the THIRDPARTYLICENSE.txt file. Please review the +list of libraries and licenses provided for use. This +license file contains two distinct licenses. + +Unless specified below, the use of NetBeans IDE 6.1 +and components from the GlassFish runtime are governed by +the terms of either the GNU General Public License Version 2 +with Classpath Exception or the Common Development and +Distribution License (CDDL). The Product also contains components +from OpenJDK, which are governed exclusively by the terms of +the GPLv2 with Classpath Exception. + +LICENSE #1: GPLv2 with Classpath Exception. + +LICENSE #2: CDDL. + + +*********************************************************** + +LICENSE #1: + +The GNU General Public License (GPL) Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away +your freedom to share and change it. By contrast, the GNU +General Public License is intended to guarantee your freedom +to share and change free software--to make sure the software +is free for all its users. This General Public License +applies to most of the Free Software Foundation's software +and to any other program whose authors commit to using it. +(Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can +apply it to your programs, too. When we speak of free +software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and +charge for this service if you wish), that you receive +source code or can get it if you want it, that you can +change the software or use pieces of it in new free +programs; and that you know you can do these things. To +protect your rights, we need to make restrictions that +forbid anyone to deny you these rights or to ask you to +surrender the rights. These restrictions translate to +certain responsibilities for you if you distribute copies of +the software, or if you modify it. + +For example, if you distribute copies of such a program, +whether gratis or for a fee, you must give the recipients +all the rights that you have. You must make sure that they, +too, receive or can get the source code. And you must show +them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the +software, and (2) offer you this license which gives you +legal permission to copy, distribute and/or modify the +software. + +Also, for each author's protection and ours, we want to make +certain that everyone understands that there is no warranty +for this free software. If the software is modified by +someone else and passed on, we want its recipients to know +that what they have is not the original, so that any +problems introduced by others will not reflect on the +original authors' reputations. + +Finally, any free program is threatened constantly by +software patents. We wish to avoid the danger that +redistributors of a free program will individually obtain +patent licenses, in effect making the program proprietary. +To prevent this, we have made it clear that any patent must +be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution +and modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND +MODIFICATION + +0. This License applies to any program or other work which +contains a notice placed by the copyright holder saying it +may be distributed under the terms of this General Public +License. The "Program", below, refers to any such program or +work, and a "work based on the Program" means either the +Program or any derivative work under copyright law: that is +to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into +another language. (Hereinafter, translation is included +without limitation in the term "modification".) Each +licensee is addressed as "you". + +Activities other than copying, distribution and modification +are not covered by this License; they are outside its scope. +The act of running the Program is not restricted, and the +output from the Program is covered only if its contents +constitute a work based on the Program (independent of +having been made by running the Program). Whether that is +true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the +Program's source code as you receive it, in any medium, +provided that you conspicuously and appropriately publish on +each copy an appropriate copyright notice and disclaimer of +warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and give any +other recipients of the Program a copy of this License along +with the Program. + +You may charge a fee for the physical act of transferring a +copy, and you may at your option offer warranty protection +in exchange for a fee. + +2. You may modify your copy or copies of the Program or any +portion of it, thus forming a work based on the Program, and +copy and distribute such modifications or work under the +terms of Section 1 above, provided that you also meet all of +these conditions: + +a) You must cause the modified files to carry prominent +notices stating that you changed the files and the date of +any change. + +b) You must cause any work that you distribute or publish, +that in whole or in part contains or is derived from the +Program or any part thereof, to be licensed as a whole at no +charge to all third parties under the terms of this License. + +c) If the modified program normally reads commands +interactively when run, you must cause it, when started +running for such interactive use in the most ordinary way, +to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or +else, saying that you provide a warranty) and that users may +redistribute the program under these conditions, and telling +the user how to view a copy of this License. (Exception: if +the Program itself is interactive but does not normally +print such an announcement, your work based on the Program +is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the +Program, and can be reasonably considered independent and +separate works in themselves, then this License, and its +terms, do not apply to those sections when you distribute +them as separate works. But when you distribute the same +sections as part of a whole which is a work based on the +Program, the distribution of the whole must be on the terms +of this License, whose permissions for other licensees +extend to the entire whole, and thus to each and every part +regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights +or contest your rights to work written entirely by you; +rather, the intent is to exercise the right to control the +distribution of derivative or collective works based on the +Program. In addition, mere aggregation of another work not +based on the Program with the Program (or with a work based +on the Program) on a volume of a storage or distribution +medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based +on it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you +also do one of the following: + +a) Accompany it with the complete corresponding +machine-readable source code, which must be distributed +under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +b) Accompany it with a written offer, valid for at least +three years, to give any third party, for a charge no more +than your cost of physically performing source distribution, +a complete machine-readable copy of the corresponding source +code, to be distributed under the terms of Sections 1 and 2 +above on a medium customarily used for software interchange; +or, + +c) Accompany it with the information you received as to the +offer to distribute corresponding source code. (This +alternative is allowed only for noncommercial distribution +and only if you received the program in object code or +executable form with such an offer, in accord with +Subsection b above.) + +The source code for a work means the preferred form of the +work for making modifications to it. For an executable work, +complete source code means all the source code for all +modules it contains, plus any associated interface +definition files, plus the scripts used to control +compilation and installation of the executable. However, as +a special exception, the source code distributed need not +include anything that is normally distributed (in either +source or binary form) with the major components (compiler, +kernel, and so on) of the operating system on which the +executable runs, unless that component itself accompanies +the executable. If distribution of executable or object code +is made by offering access to copy from a designated place, +then offering equivalent access to copy the source code from +the same place counts as distribution of the source code, +even though third parties are not compelled to copy the +source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the +Program except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense or distribute +the Program is void, and will automatically terminate your +rights under this License. However, parties who have +received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties +remain in full compliance. + +5. You are not required to accept this License, since you +have not signed it. However, nothing else grants you +permission to modify or distribute the Program or its +derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or +distributing the Program (or any work based on the Program), +you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or +modifying the Program or works based on it. + +6. Each time you redistribute the Program (or any work based +on the Program), the recipient automatically receives a +license from the original licensor to copy, distribute or +modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. You are +not responsible for enforcing compliance by third parties to +this License. + +7. If, as a consequence of a court judgment or allegation of +patent infringement or for any other reason (not limited to +patent issues), conditions are imposed on you (whether by +court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as +to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a +consequence you may not distribute the Program at all. For +example, if a patent license would not permit royalty-free +redistribution of the Program by all those who receive +copies directly or indirectly through you, then the only way +you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or +unenforceable under any particular circumstance, the balance +of the section is intended to apply and the section as a +whole is intended to apply in other circumstances. It is not +the purpose of this section to induce you to infringe any +patents or other property right claims or to contest +validity of any such claims; this section has the sole +purpose of protecting the integrity of the free software +distribution system, which is implemented by public license +practices. Many people have made generous contributions to +the wide range of software distributed through that system +in reliance on consistent application of that system; it is +up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee +cannot impose that choice. + +This section is intended to make thoroughly clear what is +believed to be a consequence of the rest of this License. + +8. If the distribution and/or use of the Program is +restricted in certain countries either by patents or by +copyrighted interfaces, the original copyright holder who +places the Program under this License may add an explicit +geographical distribution limitation excluding those +countries, so that distribution is permitted only in or +among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the +body of this License. + +9. The Free Software Foundation may publish revised and/or +new versions of the General Public License from time to +time. Such new versions will be similar in spirit to the +present version, but may differ in detail to address new +problems or concerns. + +Each version is given a distinguishing version number. If +the Program specifies a version number of this License which +applies to it and "any later version", you have the option +of following the terms and conditions either of that version +or of any later version published by the Free Software +Foundation. If the Program does not specify a version number +of this License, you may choose any version ever published +by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into +other free programs whose distribution conditions are +different, write to the author to ask for permission. For +software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be +guided by the two goals of preserving the free status of all +derivatives of our free software and of promoting the +sharing and reuse of software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS +NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE +COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR +IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED +TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY +WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED +ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF +THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT +LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE +PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the +greatest possible use to the public, the best way to achieve +this is to make it free software which everyone can +redistribute and change under these terms. + +To do so, attach the following notices to the program. It is +safest to attach them to the start of each source file to +most effectively convey the exclusion of warranty; and each +file should have at least the "copyright" line and a pointer +to where the full notice is found. + +One line to give the program's name and a brief idea of what +it does. + +Copyright (C) +This program is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. This program is distributed in the hope that it +will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the GNU General Public License for +more details. You should have received a copy of the GNU +General Public License along with this program; if not, +write to the Free Software Foundation, Inc., 59 Temple +Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and +paper mail. If the program is interactive, make it output a +short notice like this when it starts in an interactive +mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome to +redistribute it under certain conditions; type `show c' for +details. The hypothetical commands `show w' and `show c' +should show the appropriate parts of the General Public +License. Of course, the commands you use may be called +something other than `show w' and `show c'; they could even +be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a +programmer) or your school, if any, to sign a "copyright +disclaimer" for the program, if necessary. Here is a sample; +alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the program `Gnomovision' (which makes passes at compilers) +written by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice +This General Public License does not permit incorporating +your program into proprietary programs. If your program is a +subroutine library, you may consider it more useful to +permit linking proprietary applications with the library. If +this is what you want to do, use the GNU Library General +Public License instead of this License. + +"CLASSPATH" EXCEPTION TO THE GPL VERSION 2 + +Certain source files distributed by Sun Microsystems, Inc. +are subject to the following clarification and special +exception to the GPL Version 2, but only where Sun has +expressly included in the particular source file's header +the words "Sun designates this particular file as subject +to the "Classpath" exception as provided by Sun in the +License file that accompanied this code." + + Linking this library statically or dynamically with other +modules is making a combined work based on this library. +Thus, the terms and conditions of the GNU General Public +License Version 2 cover the whole combination. + +  As a special exception, the copyright holders of this +library give you permission to link this library with +independent modules to produce an executable, regardless of +the license terms of these independent modules, and to copy +and distribute the resulting executable under terms of your +choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license +of that module. An independent module is a module which is +not derived from or based on this library. If you modify +this library, you may extend this exception to your version +of the library, but you are not obligated to do so. If you +do not wish to do so, delete this exception statement from +your version. + +*********************************************************** + +LICENSE #2: + +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version +1.0 + +1. Definitions. +1.1. "Contributor" means each individual or entity that +creates or contributes to the creation of Modifications. + +1.2. "Contributor Version" means the combination of the +Original Software, prior Modifications used by a +Contributor (if any), and the Modifications made by that +particular Contributor. + +1.3. "Covered Software" means (a) the Original Software, or +(b) Modifications, or (c) the combination of files +containing Original Software with files containing +Modifications, in each case including portions thereof. + +1.4. "Executable" means the Covered Software in any form +other than Source Code. + +1.5. "Initial Developer" means the individual or entity +that first makes Original Software available under this +License. + +1.6. "Larger Work" means a work which combines Covered +Software or portions thereof with code not governed by the +terms of this License. + +1.7. "License" means this document. + +1.8. "Licensable" means having the right to grant, to the +maximum extent possible, whether at the time of the initial +grant or subsequently acquired, any and all of the rights +conveyed herein. + +1.9. "Modifications" means the Source Code and Executable +form of any of the following: + +A. Any file that results from an addition to, +deletion from or modification of the contents of a +file containing Original Software or previous +Modifications; + +B. Any new file that contains any part of the +Original Software or previous Modification; or + +C. Any new file that is contributed or otherwise made +available under the terms of this License. + +1.10. "Original Software" means the Source Code and +Executable form of computer software code that is +originally released under this License. + +1.11. "Patent Claims" means any patent claim(s), now owned +or hereafter acquired, including without limitation, +method, process, and apparatus claims, in any patent +Licensable by grantor. + +1.12. "Source Code" means (a) the common form of computer +software code in which modifications are made and (b) +associated documentation included in or with such code. + +1.13. "You" (or "Your") means an individual or a legal +entity exercising rights under, and complying with all of +the terms of, this License. For legal entities, "You" +includes any entity which controls, is controlled by, or is +under common control with You. For purposes of this +definition, "control" means (a) the power, direct or +indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (b) ownership +of more than fifty percent (50%) of the outstanding shares +or beneficial ownership of such entity. + +2. License Grants. + +2.1. The Initial Developer Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, the +Initial Developer hereby grants You a world-wide, +royalty-free, non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Initial Developer, +to use, reproduce, modify, display, perform, +sublicense and distribute the Original Software (or +portions thereof), with or without Modifications, +and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using or selling of Original Software, to make, have +made, use, practice, sell, and offer for sale, and/or +otherwise dispose of the Original Software (or +portions thereof). + +(c) The licenses granted in Sections 2.1(a) and (b) +are effective on the date Initial Developer first +distributes or otherwise makes the Original Software +available to a third party under the terms of this +License. + +(d) Notwithstanding Section 2.1(b) above, no patent +license is granted: (1) for code that You delete from +the Original Software, or (2) for infringements +caused by: (i) the modification of the Original +Software, or (ii) the combination of the Original +Software with other software or devices. + +2.2. Contributor Grant. +Conditioned upon Your compliance with Section 3.1 below and +subject to third party intellectual property claims, each +Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than +patent or trademark) Licensable by Contributor to +use, reproduce, modify, display, perform, sublicense +and distribute the Modifications created by such +Contributor (or portions thereof), either on an +unmodified basis, with other Modifications, as +Covered Software and/or as part of a Larger Work; and + +(b) under Patent Claims infringed by the making, +using, or selling of Modifications made by that +Contributor either alone and/or in combination with +its Contributor Version (or portions of such +combination), to make, use, sell, offer for sale, +have made, and/or otherwise dispose of: (1) +Modifications made by that Contributor (or portions +thereof); and (2) the combination of Modifications +made by that Contributor with its Contributor Version +(or portions of such combination). + +(c) The licenses granted in Sections 2.2(a) and +2.2(b) are effective on the date Contributor first +distributes or otherwise makes the Modifications +available to a third party. + +(d) Notwithstanding Section 2.2(b) above, no patent +license is granted: (1) for any code that Contributor +has deleted from the Contributor Version; (2) for +infringements caused by: (i) third party +modifications of Contributor Version, or (ii) the +combination of Modifications made by that Contributor +with other software (except as part of the +Contributor Version) or other devices; or (3) under +Patent Claims infringed by Covered Software in the +absence of Modifications made by that Contributor. + +3. Distribution Obligations. + +3.1. Availability of Source Code. +Any Covered Software that You distribute or otherwise make +available in Executable form must also be made available in +Source Code form and that Source Code form must be +distributed only under the terms of this License. You must +include a copy of this License with every copy of the Source +Code form of the Covered Software You distribute or +otherwise make available. You must inform recipients of any +such Covered Software in Executable form as to how they can +obtain such Covered Software in Source Code form in a +reasonable manner on or through a medium customarily used +for software exchange. + +3.2. Modifications. +The Modifications that You create or to which You +contribute are governed by the terms of this License. You +represent that You believe Your Modifications are Your +original creation(s) and/or You have sufficient rights to +grant the rights conveyed by this License. + +3.3. Required Notices. +You must include a notice in each of Your Modifications +that identifies You as the Contributor of the Modification. +You may not remove or alter any copyright, patent or +trademark notices contained within the Covered Software, or +any notices of licensing or any descriptive text giving +attribution to any Contributor or the Initial Developer. + +3.4. Application of Additional Terms. +You may not offer or impose any terms on any Covered +Software in Source Code form that alters or restricts the +applicable version of this License or the recipients' +rights hereunder. You may choose to offer, and to charge a +fee for, warranty, support, indemnity or liability +obligations to one or more recipients of Covered Software. +However, you may do so only on Your own behalf, and not on +behalf of the Initial Developer or any Contributor. You +must make it absolutely clear that any such warranty, +support, indemnity or liability obligation is offered by +You alone, and You hereby agree to indemnify the Initial +Developer and every Contributor for any liability incurred +by the Initial Developer or such Contributor as a result of +warranty, support, indemnity or liability terms You offer. + +3.5. Distribution of Executable Versions. +You may distribute the Executable form of the Covered +Software under the terms of this License or under the terms +of a license of Your choice, which may contain terms +different from this License, provided that You are in +compliance with the terms of this License and that the +license for the Executable form does not attempt to limit +or alter the recipient's rights in the Source Code form +from the rights set forth in this License. If You +distribute the Covered Software in Executable form under a +different license, You must make it absolutely clear that +any terms which differ from this License are offered by You +alone, not by the Initial Developer or Contributor. You +hereby agree to indemnify the Initial Developer and every +Contributor for any liability incurred by the Initial +Developer or such Contributor as a result of any such terms +You offer. + +3.6. Larger Works. +You may create a Larger Work by combining Covered Software +with other code not governed by the terms of this License +and distribute the Larger Work as a single product. In such +a case, You must make sure the requirements of this License +are fulfilled for the Covered Software. + +4. Versions of the License. + +4.1. New Versions. +Sun Microsystems, Inc. is the initial license steward and +may publish revised and/or new versions of this License +from time to time. Each version will be given a +distinguishing version number. Except as provided in +Section 4.3, no one other than the license steward has the +right to modify this License. + +4.2. Effect of New Versions. +You may always continue to use, distribute or otherwise +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. If the Initial Developer includes a +notice in the Original Software prohibiting it from being +distributed or otherwise made available under any +subsequent version of the License, You must distribute and +make the Covered Software available under the terms of the +version of the License under which You originally received +the Covered Software. Otherwise, You may also choose to +use, distribute or otherwise make the Covered Software +available under the terms of any subsequent version of the +License published by the license steward. + +4.3. Modified Versions. +When You are an Initial Developer and You want to create a +new license for Your Original Software, You may create and +use a modified version of this License if You: (a) rename +the license and remove any references to the name of the +license steward (except to note that the license differs +from this License); and (b) otherwise make it clear that +the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + +COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS +IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR +IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE +COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A +PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH +YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY +RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER +CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, +REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY +CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY +COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS +DISCLAIMER. + +6. TERMINATION. + +6.1. This License and the rights granted hereunder will +terminate automatically if You fail to comply with terms +herein and fail to cure such breach within 30 days of +becoming aware of the breach. Provisions which, by their +nature, must remain in effect beyond the termination of +this License shall survive. + +6.2. If You assert a patent infringement claim (excluding +declaratory judgment actions) against Initial Developer or +a Contributor (the Initial Developer or Contributor against +whom You assert such claim is referred to as "Participant") +alleging that the Participant Software (meaning the +Contributor Version where the Participant is a Contributor +or the Original Software where the Participant is the +Initial Developer) directly or indirectly infringes any +patent, then any and all rights granted directly or +indirectly to You by such Participant, the Initial +Developer (if the Initial Developer is not the Participant) +and all Contributors under Sections 2.1 and/or 2.2 of this +License shall, upon 60 days notice from Participant +terminate prospectively and automatically at the expiration +of such 60 day notice period, unless if within such 60 day +period You withdraw Your claim with respect to the +Participant Software against such Participant either +unilaterally or pursuant to a written agreement with +Participant. + +6.3. In the event of termination under Sections 6.1 or 6.2 +above, all end user licenses that have been validly granted +by You or any distributor hereunder prior to termination +(excluding licenses granted to You by any distributor) +shall survive termination. + +7. LIMITATION OF LIABILITY. + +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER +TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL +YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY +DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF +SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, +SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY +CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST +PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE +OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR +LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE +POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY +SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY +RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT +APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS +DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR +CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY +NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + +The Covered Software is a "commercial item," as that term is +defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of +"commercial computer software" (as that term is defined at +48 C.F.R. ¤ 252.227-7014(a)(1)) and "commercial computer +software documentation" as such terms are used in 48 C.F.R. +12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 +C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. +Government End Users acquire Covered Software with only +those rights set forth herein. This U.S. Government Rights +clause is in lieu of, and supersedes, any other FAR, DFAR, +or other clause or provision that addresses Government +rights in computer software under this License. + +9. MISCELLANEOUS. + +This License represents the complete agreement concerning +subject matter hereof. If any provision of this License is +held to be unenforceable, such provision shall be reformed +only to the extent necessary to make it enforceable. This +License shall be governed by the law of the jurisdiction +specified in a notice contained within the Original Software +(except to the extent applicable law, if any, provides +otherwise), excluding such jurisdiction's conflict-of-law +provisions. Any litigation relating to this License shall be +subject to the jurisdiction of the courts located in the +jurisdiction and venue specified in a notice contained +within the Original Software, with the losing party +responsible for costs, including, without limitation, court +costs and reasonable attorneys' fees and expenses. The +application of the United Nations Convention on Contracts +for the International Sale of Goods is expressly excluded. +Any law or regulation which provides that the language of a +contract shall be construed against the drafter shall not +apply to this License. You agree that You alone are +responsible for compliance with the United States export +administration regulations (and the export control laws and +regulation of any other countries) when You use, distribute +or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + +As between Initial Developer and the Contributors, each +party is responsible for claims and damages arising, +directly or indirectly, out of its utilization of rights +under this License and You agree to work with Initial +Developer and Contributors to distribute such responsibility +on an equitable basis. Nothing herein is intended or shall +be deemed to constitute any admission of liability. + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license.txt b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license.txt new file mode 100644 index 000000000000..f5b3307a60ec --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/product/components/netbeans-license.txt @@ -0,0 +1,217 @@ +APACHE NETBEANS IDE DEVELOPMENT VERSION ("Product") + LICENSE AGREEMENT + +PLEASE READ THE FOLLOWING LICENSE AGREEMENT TERMS AND +CONDITIONS CAREFULLY, INCLUDING WITHOUT LIMITATION THOSE +DISPLAYED ELSEWHERE (AS INDICATED BY LINKS LISTED BELOW), +BEFORE USING THE SOFTWARE. THESE TERMS AND CONDITIONS +CONSTITUTE A LEGAL AGREEMENT BETWEEN YOU, OR THE ENTITY FOR +WHICH YOU ARE AN AUTHORIZED REPRESENTATIVE WITH FULL +AUTHORITY TO ENTER INTO THIS AGREEMENT, AND APACHE. BY +CLICKING "ACCEPT" OR THE EQUIVALENT YOU AGREE TO ALL OF +THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT. IF YOU +DO NOT AGREE TO THIS LICENSE DO NOT CLICK "ACCEPT" OR +THE EQUIVALENT AND DO NOT INSTALL OR USE THIS SOFTWARE. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/Bundle.properties b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/Bundle.properties new file mode 100644 index 000000000000..0f6b93cc17bb --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/Bundle.properties @@ -0,0 +1,54 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################ +# NetBeansUtils.java + +NU.warning.running=It appears that the following instance of the NetBeans IDE is still running:\n{0}\nA lock file exists at \n{1}\nPlease close this NetBeans IDE prior to continuing with uninstallation. +NU.error.branding.cluster.not.exists=The NetBeans branding cluster does not exist +NU.error.cannot.get.userdir=Can`t get netbeans userdir from {0} +NU.error.cannot.get.javahome=Can`t get information from file {0} which Java environment NetBeans uses +############################################################################ +# JavaUtils.java +JU.error.verification=Failed to execute the JDK verification procedure +JU.error.cannot.delete=Cannot delete {0} +JU.error.cannot.download.testjdk=Cannot download TestJDK.class from {0} +JU.error.cannot.canonize=Cannot canonize {0} + +############################################################################ +#GlassFishUtils.java +GU.error.configure.parser=Cannot configure parser +GU.error.configure.transformer=Cannot configure transformer +GU.error.transformer.wrong=Something wrong with transformer +GU.error.parsing=Something wrong while parsing + +GU.error.create.domain.passfile=Could not create domain - failed to create the password file. +GU.error.create.domain.errno="Could not create domain - error {0} occurred. +GU.error.create.domain.exitcode=Could not create domain - the process returned {0} +GU.error.create.domain.timeout=Could not create domain - the process was killed due to timeout. +GU.error.deployment.timeout=Deployment failed to finish in a timely manner + +############################################################################ +#WebLogicUtils.java +WU.error.configure.errno=Could not create domain - configuration error {0} occurred. +WU.error.configure.env=Could not create domain - can not set up environment. +WU.error.create.domain.errno=Could not create domain - error {0} occurred. +WU.error.create.domain.exitcode=Could not create domain - the process returned {0} +WU.error.create.domain.timeout=Could not create domain - the process was killed due to timeout. +WU.error.unpacking.errno=Could not unpack server files - error {0} occurred. + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java new file mode 100644 index 000000000000..99b8887746be --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/GlassFishUtils.java @@ -0,0 +1,700 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.utils.applications; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.net.URL; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.helper.ExecutionResults; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.XMLUtils; +import org.netbeans.installer.utils.exceptions.XMLException; +import org.netbeans.installer.utils.helper.Version; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * + + */ +public class GlassFishUtils { + private static Map knownVersions = new HashMap(); + + private GlassFishUtils() { + // does nothing + } + + public static void createDomain(File location, String domainName, String username, String adminPassword, String httpPort, String httpsPort, String adminPort) throws IOException { + createDomain(location, domainName, username, adminPassword, httpPort, httpsPort, adminPort, null); + } + public static void createDomain(File location, String domainName, String username, String adminPassword, String httpPort, String httpsPort, String adminPort, String domainProperties) throws IOException { + createDomain(location, domainName, username, adminPassword, DEFAULT_MASTER_PASSWORD, httpPort, httpsPort, adminPort, domainProperties); + } + public static void createDomain(File location, String domainName, String username, String adminPassword, String masterPassword, String httpPort, String httpsPort, String adminPort, String domainProperties) throws IOException { + final File passwordFile = createPasswordFile(adminPassword, masterPassword, location); + + if (passwordFile == null) { + throw new DomainCreationException(); + } + + final ExecutionResults results = SystemUtils.executeCommand(location, + getAsadmin(location).getAbsolutePath(), + "create-domain", + "--interactive=false", + "--adminport", + adminPort, + "--user", + username, + "--passwordfile", + passwordFile.getAbsolutePath(), + "--instanceport", + httpPort, + "--domainproperties", + "http.ssl.port=" + httpsPort + (domainProperties != null ? ":" + domainProperties : ""), + "--savelogin", + domainName + ); + + if (results.getStdOut().indexOf(COULD_NOT_CREATE_DOMAIN_MARKER) != -1 || + results.getStdErr().indexOf(COULD_NOT_CREATE_DOMAIN_MARKER) != -1) { + throw new DomainCreationException(CLI_130); + } + + if (results.getErrorCode() > 0) { + throw new DomainCreationException(results.getErrorCode()); + } + } + + public static boolean startDomain(File location, String domainName) throws IOException { + String executable = getAsadmin(location).getAbsolutePath(); + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + START_DOMAIN_COMMAND, + domainName + ); + + return results.getErrorCode() != ExecutionResults.TIMEOUT_ERRORCODE; + } + + public static boolean startDefaultDomain(File location) throws IOException { + return startDomain(location, DEFAULT_DOMAIN); + } + + public static boolean stopDomain(File location, String domainName) throws IOException { + String executable = getAsadmin(location).getAbsolutePath(); + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + STOP_DOMAIN_COMMAND, + domainName + ); + + return results.getErrorCode() != ExecutionResults.TIMEOUT_ERRORCODE; + } + + public static boolean stopDefaultDomain(File location) throws IOException { + return stopDomain(location, DEFAULT_DOMAIN); + } + + public static boolean deleteDomain(File location, String domainName) throws IOException { + String executable = getAsadmin(location).getAbsolutePath(); + + if (!stopDomain(location, domainName)) { + return false; + } + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + DELETE_DOMAIN_COMMAND, + domainName + ); + + return results.getErrorCode() != ExecutionResults.TIMEOUT_ERRORCODE; + } + + public static boolean stopDerby(File location) throws IOException { + String executable = getAsadmin(location).getAbsolutePath(); + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + STOP_DATABASE_COMMAND + ); + + return results.getErrorCode() != ExecutionResults.TIMEOUT_ERRORCODE; + } + + public static File createPasswordFile(String adminPassword, File location) throws IOException { + return createPasswordFile(adminPassword,DEFAULT_MASTER_PASSWORD,location); + } + + public static File createPasswordFile(String adminPassword, String masterPassword, File location) throws IOException { + File passwordFile = FileUtils.createTempFile(location); + + String contents = + "AS_ADMIN_PASSWORD=" + adminPassword + "\n" + + "AS_ADMIN_MASTERPASSWORD=" + masterPassword; + + FileUtils.writeFile(passwordFile, contents); + + return passwordFile; + } + + public static File getJavaHome(File location) throws IOException { + File asconf; + + if (SystemUtils.isWindows()) { + asconf = new File(location, "config/asenv.bat"); + } else { + asconf = new File(location, "config/asenv.conf"); + } + + String contents = FileUtils.readFile(asconf); + + Matcher matcher = Pattern.compile("AS_JAVA=\"?(.+?)\"?$", Pattern.MULTILINE).matcher(contents); + + if (matcher.find()) { + return new File(matcher.group(1)); + } else { + return null; + } + } + + public static Version getVersion(File location) throws IOException { + if (knownVersions.get(location) != null) { + return knownVersions.get(location); + } + + String executable = getAsadmin(location).getAbsolutePath(); + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + "version", + "--verbose"); + + Version version = null; + + Matcher matcher = Pattern.compile("[0-9][0-9_\\.]+[0-9]").matcher(results.getStdOut()); + + if (matcher.find()) { + version = Version.getVersion(matcher.group()); + } + + if (version != null) { + knownVersions.put(location, version); + } + + return version; + } + public static boolean validateCredentials(File location, String domainName, String username, String adminPassword) throws IOException, XMLException { + return validateCredentials(location,domainName,username,adminPassword, DEFAULT_MASTER_PASSWORD); + } + + public static boolean validateCredentials(File location, String domainName, String username, String adminPassword, String masterPassword) throws IOException, XMLException { + String executable = getAsadmin(location).getAbsolutePath(); + + int adminPort = getAdminPort(location, domainName); + + File passwordFile = createPasswordFile(adminPassword, masterPassword, location); + + startDomain(location, domainName); + + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + "list-admin-objects", + "--port", + Integer.toString(adminPort), + "--user", + username, + "--passwordfile", + passwordFile.getAbsolutePath() + ); + + FileUtils.deleteFile(passwordFile); + + stopDomain(location, domainName); + + if (results.getStdOut().contains("successfully")) { + return true; + } else { + return false; + } + } + + public static List getDomainNames(File location) { + final List names = new LinkedList(); + + final File domainsDir = new File(location, "domains"); + if (domainsDir.exists() && domainsDir.isDirectory()) { + final File[] children = domainsDir.listFiles(); + + if (children != null) { + for (File child: children) { + final File domainXml = new File(child, "config/domain.xml"); + + if (domainXml.exists() && domainXml.isFile()) { + names.add(child.getName()); + } + } + } + } + + return names; + } + + public static int getAdminPort(File location, String domainName) throws IOException, XMLException { + try { + final DocumentBuilder builder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + builder.setEntityResolver(new GlassFishDtdEntityResolver(location)); + + final Element documentElement = builder.parse(getDomainXml( + location, + domainName)).getDocumentElement(); + + final Element httpServiceElement = XMLUtils.getChild( + documentElement, + "configs/config/http-service"); + + if (httpServiceElement != null) { + for (Element element: XMLUtils.getChildren( + httpServiceElement, + "http-listener")) { + if (element.getAttribute("security-enabled").equals("false")) { + final String id = element.getAttribute("id"); + final String port = element.getAttribute("port"); + + if (id.contains("admin")) { + return new Integer(port); + } + } + } + } + + return Integer.parseInt("4848"); + } catch (ParserConfigurationException e) { + throw new XMLException(ERROR_CANNOT_CONFIGURE_PARSER_STRING, e); + } catch (SAXException e) { + throw new XMLException(ERROR_PARSING_STRING, e); + } + } + + public static int getHttpPort(File location, String domainName) throws IOException, XMLException { + try { + final DocumentBuilder builder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + builder.setEntityResolver(new GlassFishDtdEntityResolver(location)); + + final Element documentElement = builder.parse(getDomainXml( + location, + domainName)).getDocumentElement(); + + final Element httpServiceElement = XMLUtils.getChild( + documentElement, + "configs/config/http-service"); + + if (httpServiceElement != null) { + for (Element element: XMLUtils.getChildren( + httpServiceElement, + "http-listener")) { + if (element.getAttribute("security-enabled").equals("false")) { + return Integer.parseInt(element.getAttribute("port")); + } + } + } + + return Integer.parseInt("8080"); + } catch (ParserConfigurationException e) { + throw new XMLException(ERROR_CANNOT_CONFIGURE_PARSER_STRING, e); + } catch (SAXException e) { + throw new XMLException(ERROR_PARSING_STRING, e); + } + } + + public static int getHttpsPort(File location, String domainName) throws IOException, XMLException { + try { + final DocumentBuilder builder = + DocumentBuilderFactory.newInstance().newDocumentBuilder(); + builder.setEntityResolver(new GlassFishDtdEntityResolver(location)); + + final Element documentElement = builder.parse(getDomainXml( + location, + domainName)).getDocumentElement(); + + final Element httpServiceElement = XMLUtils.getChild( + documentElement, + "configs/config/http-service"); + + if (httpServiceElement != null) { + for (Element element: XMLUtils.getChildren( + httpServiceElement, + "http-listener")) { + if (element.getAttribute("security-enabled").equals("true")) { + return Integer.parseInt(element.getAttribute("port")); + } + } + } + + return Integer.parseInt("8080"); + } catch (ParserConfigurationException e) { + throw new XMLException(ERROR_CANNOT_CONFIGURE_PARSER_STRING, e); + } catch (SAXException e) { + throw new XMLException(ERROR_PARSING_STRING, e); + } + } + + public static void deployWar(File location, File war, String domainName, String user, String adminPassword) throws IOException, XMLException { + deployWar(location, war, domainName, user, adminPassword, DEFAULT_MASTER_PASSWORD); + } + public static void deployWar(File location, File war, String domainName, String user, String adminPassword, String masterPassword) throws IOException, XMLException { + String executable = getAsadmin(location).getAbsolutePath(); + + File passwordFile = createPasswordFile(adminPassword, masterPassword, location); + String adminPort = Integer.toString(getAdminPort(location, domainName)); + + try { + ExecutionResults results = SystemUtils.executeCommand(location, + executable, + "deploy", + "--host", + "localhost", + "--port", + adminPort, + "--user", + user, + "--passwordfile", + passwordFile.getAbsolutePath(), + war.getAbsolutePath() + ); + + if (results.getErrorCode() == ExecutionResults.TIMEOUT_ERRORCODE) { + throw new IOException(ERROR_DEPLOYMENT_TIMEOUT_STRING); + } + } finally { + FileUtils.deleteFile(passwordFile); + } + } + public static void undeployWar(File location, String name, String domainName, String user, String adminPassword) throws IOException, XMLException { + undeployWar(location, name, domainName, user, adminPassword, DEFAULT_MASTER_PASSWORD); + } + + public static void undeployWar(File location, String name, String domainName, String user, String adminPassword, String masterPassword) throws IOException, XMLException { + String executable = getAsadmin(location).getAbsolutePath(); + + File passwordFile = createPasswordFile(adminPassword, masterPassword, location); + String adminPort = Integer.toString(getAdminPort(location, domainName)); + + try { + SystemUtils.executeCommand(location, + executable, + "undeploy", + "--host", + "localhost", + "--port", + adminPort, + "--user", + user, + "--passwordfile", + passwordFile.getAbsolutePath(), + name + ); + } finally { + FileUtils.deleteFile(passwordFile); + } + } + + public static void prependClassPath(File location, String domainName, File file) throws IOException, XMLException { + final Document document = + getDomainXmlDocument(location, domainName); + + final Element element = XMLUtils.getChild( + document.getDocumentElement(), + "configs/config/java-config"); + + final String separator = SystemUtils.getPathSeparator(); + + String contents = element.getAttribute("classpath-suffix"); + + contents = file.getAbsolutePath() + separator + contents; + contents = contents.replace(separator + separator, separator); + contents = contents.replaceAll("^" + separator, ""); + contents = contents.replaceAll(separator + "$", ""); + + element.setTextContent(contents); + + saveDomainXmlDocument(location, domainName, document); + } + + public static void appendClassPath(File location, String domainName, File file) throws IOException, XMLException { + final Document document = + getDomainXmlDocument(location, domainName); + + final Element element = XMLUtils.getChild( + document.getDocumentElement(), + "configs/config/java-config"); + + final String separator = SystemUtils.getPathSeparator(); + + String contents = element.getAttribute("classpath-suffix"); + + contents = contents + separator + file.getAbsolutePath(); + contents = contents.replace(separator + separator, separator); + contents = contents.replaceAll("^" + separator, ""); + contents = contents.replaceAll(separator + "$", ""); + + element.setTextContent(contents); + + saveDomainXmlDocument(location, domainName, document); + } + + public static void removeClassPath(File location, String domainName, File file) throws IOException, XMLException { + final Document document = + getDomainXmlDocument(location, domainName); + + final Element element = XMLUtils.getChild( + document.getDocumentElement(), + "configs/config/java-config"); + + final String separator = SystemUtils.getPathSeparator(); + + String contents = element.getAttribute("classpath-suffix"); + + contents = contents.replace(file.getAbsolutePath(), ""); + contents = contents.replace(separator + separator, separator); + contents = contents.replaceAll("^" + separator, ""); + contents = contents.replaceAll(separator + "$", ""); + + element.setTextContent(contents); + + saveDomainXmlDocument(location, domainName, document); + } + + @Deprecated + public static void addJvmOption(File location, String domainName, String option) throws IOException, XMLException { + setJvmOption(location, domainName, option); + } + + public static void setJvmOption(File location, String domainName, String option) throws IOException, XMLException { + final Document document = + getDomainXmlDocument(location, domainName); + + final Element element = XMLUtils.getChild( + document.getDocumentElement(), + "configs/config/java-config"); + + final Element jvmOptionElement = document.createElement("jvm-options"); + jvmOptionElement.setTextContent(option); + + element.appendChild(jvmOptionElement); + + saveDomainXmlDocument(location, domainName, document); + } + + public static void removeJvmOption(File location, String domainName, String option) throws IOException, XMLException { + final Document document = + getDomainXmlDocument(location, domainName); + + final Element element = XMLUtils.getChild( + document.getDocumentElement(), + "configs/config/java-config"); + + for (Element child: XMLUtils.getChildren(element, "jvm-options")) { + if (child.getTextContent().equals(option)) { + element.removeChild(child); + } + } + + saveDomainXmlDocument(location, domainName, document); + } + + public static File getAsadmin(File location) { + return new File(location, "bin/" + (SystemUtils.isWindows() ? "asadmin.bat" : "asadmin")); + } + + public static File getDomainXml(File location, String domainName) { + return new File(location, "domains/" + domainName + "/config/domain.xml"); + } + + public static Document getDomainXmlDocument(File location, String domainName) throws IOException, XMLException { + try { + DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + builder.setEntityResolver(new GlassFishDtdEntityResolver(location)); + + return builder.parse(getDomainXml(location, domainName)); + } catch (ParserConfigurationException e) { + throw new XMLException(ERROR_CANNOT_CONFIGURE_PARSER_STRING, e); + } catch (SAXException e) { + throw new XMLException(ERROR_PARSING_STRING, e); + } + } + + public static void saveDomainXmlDocument(File location, String domainName, Document document) throws IOException, XMLException { + try { + OutputStream outputStream = new FileOutputStream(getDomainXml(location, domainName)); + + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, document.getDoctype().getPublicId()); + transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, document.getDoctype().getSystemId()); + transformer.transform(new DOMSource(document), new StreamResult(outputStream)); + + outputStream.close(); + } catch (TransformerConfigurationException e) { + throw new XMLException(ERROR_CANNOT_CONFIGURE_TRANSFORMER_STRING, e); + } catch (TransformerException e) { + throw new XMLException(ERROR_TRANSFORMER_UNKNOWN_STRING, e); + } + } + + public static File getDomainConfig(File location, String domainName) { + return new File(location, "domains/" + domainName + "/config"); + } + + private static class GlassFishDtdEntityResolver implements EntityResolver { + private File dtdsLocation; + + public GlassFishDtdEntityResolver(File location) { + this.dtdsLocation = new File(location, "lib/dtds"); + } + + public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { + String filename = new File(new URL(systemId).getFile()).getName(); + + return new InputSource(new FileInputStream(new File(dtdsLocation, filename))); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class DomainCreationException extends IOException { + private String message; + + public DomainCreationException() { + super(); + setMessage(ERROR_CREATE_DOMAIN_PASSFILE_STRING); + } + + public DomainCreationException(String errorNumber) { + super(); + setMessage(StringUtils.format(ERROR_CREATE_DOMAIN_ERROR_STRING, errorNumber)); + } + + public DomainCreationException(int errorCode) { + super(); + + if (errorCode != ExecutionResults.TIMEOUT_ERRORCODE) { + setMessage(StringUtils.format(ERROR_CREATE_DOMAIN_EXIT_CODE_STRING, errorCode)); + } else { + setMessage(ERROR_CREATE_DOMAIN_TIMEOUT_STRING); + } + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public String getMessage() { + return message; + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String INSTALL_ADDON_COMMAND = + "install-addon"; // NOI18N + + public static final String UNINSTALL_ADDON_COMMAND = + "uninstall-addon"; // NOI18N + + public static final String DEFAULT_DOMAIN = + "domain1"; // NOI18N + + public static final String CLI_130 = + "CLI130"; // NOI18N + public static final String START_DOMAIN_COMMAND = + "start-domain"; //NOI18N + public static final String STOP_DOMAIN_COMMAND = + "stop-domain"; //NOI18N + public static final String DELETE_DOMAIN_COMMAND = + "delete-domain";//NOI18N + + public static final String START_DATABASE_COMMAND = + "start-database"; //NOI18N + public static final String STOP_DATABASE_COMMAND = + "stop-database"; //NOI18N + public static final String DEFAULT_MASTER_PASSWORD = + "changeit"; //NOI18N + + public static final String COULD_NOT_CREATE_DOMAIN_MARKER = + CLI_130 + " Could not create domain"; // NOI18N + + public static final String ERROR_CANNOT_CONFIGURE_PARSER_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.configure.parser");//NOI18N + public static final String ERROR_CANNOT_CONFIGURE_TRANSFORMER_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.configure.transformer");//NOI18N + public static final String ERROR_TRANSFORMER_UNKNOWN_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.transformer.wrong");//NOI18N + public static final String ERROR_PARSING_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.parsing");//NOI18N + public static final String ERROR_CREATE_DOMAIN_PASSFILE_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.create.domain.passfile");//NOI18N + public static final String ERROR_CREATE_DOMAIN_ERROR_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.create.domain.errno"); + public static final String ERROR_CREATE_DOMAIN_EXIT_CODE_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.create.domain.exitcode"); + public static final String ERROR_CREATE_DOMAIN_TIMEOUT_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.create.domain.timeout"); + public static final String ERROR_DEPLOYMENT_TIMEOUT_STRING = + ResourceUtils.getString(GlassFishUtils.class, + "GU.error.deployment.timeout");//NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/JavaFXUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/JavaFXUtils.java new file mode 100644 index 000000000000..935cfbfff207 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/JavaFXUtils.java @@ -0,0 +1,212 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.utils.applications; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.helper.Platform; +import org.netbeans.installer.utils.helper.PlatformConstants; +import org.netbeans.installer.utils.helper.Version; +import org.netbeans.installer.utils.system.WindowsNativeUtils; +import org.netbeans.installer.utils.system.windows.WindowsRegistry; +import static org.netbeans.installer.utils.system.windows.WindowsRegistry.HKLM; + +public class JavaFXUtils { + ///////////////////////////////////////////////////////////////////////////////// + // Static + + public static String getJavaFXSDKInstallationPath (Platform platform) { + return getFXRegistryValue(platform, FXSDK_KEY, FX_SDK_HOME_PATH); + } + + public static String getJavaFXRuntimeInstallationPath (Platform platform) { + return getFXRegistryMaxValue(platform, FXRUNTIME_INSTALLATION_KEY); + } + + ///////////////////////////////////////////////////////////////////////////////// + + private static String getFXRegistryValue (Platform platform, String registryKey, String registryItemKey) { + String result = null; + try { + if(SystemUtils.isWindows()) { + String arch = platform.getHardwareArch(); + WindowsRegistry winreg = ((WindowsNativeUtils) SystemUtils.getNativeUtils()).getWindowsRegistry(); + if(arch != null && winreg.isAlternativeModeSupported()) { + final int mode = arch.equals(PlatformConstants.HARDWARE_X86)? WindowsRegistry.MODE_32BIT: + WindowsRegistry.MODE_64BIT; + LogManager.log("... changing registry mode to: " + mode); + winreg.setMode(mode); + } + LogManager.log("... getting JavaFX " + registryKey + " value: " + registryItemKey); + if (winreg.keyExists(HKLM, registryKey)) { + if (winreg.valueExists(HKLM, registryKey, registryItemKey)) { + result = winreg.getStringValue(HKLM, registryKey, registryItemKey); + } else { + LogManager.log("... cannot find " + registryItemKey + " value for this product"); + } + } else { + LogManager.log("... cannot find " + registryKey + " for this product"); + } + } + } catch (NativeException e) { + LogManager.log(e); + } + return result; + } + + private static String getFXRegistryMaxValue (Platform platform, String registryKey) { + String result = null; + try { + if(SystemUtils.isWindows()) { + String arch = platform.getHardwareArch(); + WindowsRegistry winreg = ((WindowsNativeUtils) SystemUtils.getNativeUtils()).getWindowsRegistry(); + if(arch != null && winreg.isAlternativeModeSupported()) { + final int mode = arch.equals(PlatformConstants.HARDWARE_X86)? WindowsRegistry.MODE_32BIT: + WindowsRegistry.MODE_64BIT; + LogManager.log("... changing registry mode to: " + mode); + winreg.setMode(mode); + } + + if (winreg.keyExists(HKLM, registryKey)) { + String[] javaFXSubKeys = winreg.getSubKeyNames(HKLM, registryKey); + + Version prevVersion = null; + for (String singleKey : javaFXSubKeys) { + LogManager.log("... getting JavaFX " + registryKey + " value: " + singleKey); + if (winreg.valueExists(HKLM, registryKey + singleKey, PATH)) { + Version actualVersion = Version.getVersion(singleKey); + if (actualVersion == null || prevVersion == null || actualVersion.newerThan(prevVersion)) { + result = winreg.getStringValue(HKLM, registryKey + singleKey, PATH); + } + prevVersion = actualVersion; + } else { + LogManager.log("... cannot find " + singleKey + " value for this product"); + } + } + } else { + LogManager.log("... cannot find " + registryKey + " for this product"); + } + } + } catch (NativeException e) { + LogManager.log(e); + } + return result; + } + + public static boolean jdkContainsJavaFX(File jdkLocation) { + File javaFXSDK = new File(jdkLocation, "lib" + File.separator + "ant-javafx.jar"); + if (!javaFXSDK.exists()) + return false; + + File javaFXRuntimeFolder = new File(jdkLocation, "jre" + File.separator + "lib"); + + File javaFXRuntimeDeply = new File(javaFXRuntimeFolder, "deploy.jar"); + if (!javaFXRuntimeDeply.exists()) + return false; + + File javaFXRuntimeJavaws = new File(javaFXRuntimeFolder, "javaws.jar"); + if (!javaFXRuntimeJavaws.exists()) + return false; + + File javaFXRuntimeJfxrt = new File(javaFXRuntimeFolder, "jfxrt.jar"); + if (!javaFXRuntimeJfxrt.exists()) + return false; + + File javaFXRuntimePlugin = new File(javaFXRuntimeFolder, "plugin.jar"); + if (!javaFXRuntimePlugin.exists()) + return false; + + return true; + } + + /** + * Registers JavaFX into NetBeans IDE. + * + * CAN BE CALLED AFTER IDE IS INSTALLED!!! + * + * @param nbLocation + * @param sdkLocation + * @param reLocation + * @return + * @throws IOException + */ + public static boolean registerJavaFX(File nbLocation, File sdkLocation, File reLocation) throws IOException { + File javaExe = JavaUtils.getExecutable(new File(System.getProperty("java.home"))); + String [] cp = { + "platform/core/core.jar", + "platform/lib/boot.jar", + "platform/lib/org-openide-modules.jar", + "platform/core/org-openide-filesystems.jar", + "platform/lib/org-openide-util.jar", + "platform/lib/org-openide-util-lookup.jar", + "javafx/modules/org-netbeans-modules-javafx2-platform.jar" + }; + for(String c : cp) { + File f = new File(nbLocation, c); + if(!FileUtils.exists(f)) { + LogManager.log("... cannot find jar required for JavaFX integration: " + f); + return false; + } + } + String mainClass = "org.netbeans.modules.javafx2.platform.registration.AutomaticRegistration"; + List commands = new ArrayList (); + File nbCluster = new File(nbLocation, "nb"); + commands.add(javaExe.getAbsolutePath()); + commands.add("-cp"); + commands.add(StringUtils.asString(cp, File.pathSeparator)); + commands.add(mainClass); + commands.add(nbCluster.getAbsolutePath()); + commands.add(sdkLocation.getAbsolutePath()); + commands.add(reLocation.getAbsolutePath()); + + return SystemUtils.executeCommand(nbLocation, commands.toArray(new String[]{})).getErrorCode() == 0; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private JavaFXUtils() { + // does nothing + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + + public static final String FXSDK_KEY = + "SOFTWARE\\JavaSoft\\JavaFX SDK"; // NOI18N + public static final String FXRUNTIME_KEY = + "SOFTWARE\\JavaSoft\\JavaFX"; // NOI18N + public static final String FXRUNTIME_INSTALLATION_KEY = + "SOFTWARE\\Oracle\\JavaFX\\"; //NOI18N + + public static final String VERSION + = "Version"; // NOI18N + public static final String FX_VERSION + = "FXVersion"; // NOI18N + public static final String FX_SDK_HOME_PATH + = "JFXSDKHome"; //NOI18N + public static final String PATH + = "Path"; //NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java new file mode 100644 index 000000000000..cee48899396e --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/NetBeansUtils.java @@ -0,0 +1,929 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.utils.applications; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.netbeans.installer.utils.*; +import org.netbeans.installer.utils.XMLUtils; +import org.netbeans.installer.utils.exceptions.XMLException; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.netbeans.installer.utils.helper.FilesList; +import org.netbeans.installer.wizard.components.panels.netbeans.NbWelcomePanel; +import org.netbeans.installer.wizard.components.panels.netbeans.NbWelcomePanel.BundleType; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * + */ +public class NetBeansUtils { + ///////////////////////////////////////////////////////////////////////////////// + // Static + public static void addCluster(File nbLocation, String clusterName) throws IOException { + addCluster(nbLocation, clusterName, null); + } + + public static void addCluster(File nbLocation, String clusterName, String afterCluster) throws IOException { + LogManager.log(ErrorLevel.DEBUG, "Modifying netbeans.conf for NetBeans installed at " + nbLocation + " by adding cluster \""+ clusterName + "\"" + (afterCluster==null ? "" : " after cluster \"" + afterCluster + "\"")); + final File netbeansclusters = new File(nbLocation, NETBEANS_CLUSTERS); + touchLastModified(nbLocation, clusterName); + List list = FileUtils.readStringList(netbeansclusters); + LogManager.log(ErrorLevel.DEBUG, "... initial list of clusters : "); + LogManager.indent(); + LogManager.log(ErrorLevel.DEBUG, StringUtils.asString(list, SystemUtils.getLineSeparator())); + LogManager.unindent(); + int length = list.size(); + for (int i=0;i list = FileUtils.readStringList(netbeansclusters); + list.remove(clusterName); + + FileUtils.writeStringList(netbeansclusters, list); + } + + public static FilesList createProductId(File nbLocation) throws IOException { + File nbCluster = getNbCluster(nbLocation); + + File productid = new File(nbCluster, PRODUCT_ID); + + return FileUtils.writeFile(productid, getNetBeansId()); + } + + public static FilesList addPackId(File nbLocation, String packId) throws IOException { + final File nbCluster = getNbCluster(nbLocation); + + final File productid = new File(nbCluster, PRODUCT_ID); + + final String id; + if (!productid.exists()) { + id = getNetBeansId(); + } else { + id = FileUtils.readFile(productid).trim(); + } + + final List ids = + new LinkedList(Arrays.asList(id.split(PACK_ID_SEPARATOR))); + + boolean packAdded = false; + for (int i = 1; i < ids.size(); i++) { + if (packId.equals(ids.get(i))) { + return new FilesList(); + } + + if (packId.compareTo(ids.get(i)) < 0) { + ids.add(i, packId); + packAdded = true; + break; + } + } + + if (!packAdded) { + ids.add(packId); + } + + return FileUtils.writeFile( + productid, + StringUtils.asString(ids, PACK_ID_SEPARATOR)); + } + + public static void updateTrackingFilesInfo(File nbLocation, String clusterName) throws IOException { + + File clusterDir = new File(nbLocation, clusterName); + if (!FileUtils.exists(clusterDir)) { + return; + } + LogManager.log("Update update_tracking files for cluster directory " + clusterDir); + File[] files = new File(clusterDir,UPDATE_TRACKING_DIR).listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.getName().endsWith(".xml"); + } + }); + + if (files != null) { + for (File f : files) { + updateTrackingFilesCRC(f, clusterDir); + } + } + } + + private static void updateTrackingFilesCRC(File f, File clusterDir) throws IOException { + try { + LogManager.log("... check if correct CRC sums are used in update_tracking file " + f); + Element root = XMLUtils.getDocumentElement(f); + boolean needSave = false; + for (Element el : XMLUtils.getChildren(root, "module_version")) { + if ("true".equals(el.getAttribute("last"))) { + for (Element fileEl : XMLUtils.getChildren(el)) { + String crc = fileEl.getAttribute("crc"); + String name = fileEl.getAttribute("name"); + if (name != null && crc != null) { + File utFile = new File(clusterDir, name); + if (FileUtils.exists(utFile)) { + long crcValue = Long.parseLong(crc); + long realCRC = FileUtils.getCrc32(utFile); + if (realCRC != crcValue) { + fileEl.setAttribute("crc", new Long(realCRC).toString()); + needSave = true; + } + } + } + } + break; + } + } + if (needSave) { + XMLUtils.saveXMLDocument(root.getOwnerDocument(), f); + } + } catch (XMLException e) { + LogManager.log(e); + throw new IOException("Can`t update CRC in update_tracking files", e); + } catch (NumberFormatException e) { + LogManager.log(e); + throw new IOException("Can`t update CRC in update_tracking files", e); + } catch (IOException e) { + LogManager.log(e); + throw new IOException("Can`t update CRC in update_tracking files", e); + } + } + + public static void removePackId(File nbLocation, String packId) throws IOException { + File nbCluster = getNbCluster(nbLocation); + + File productid = new File(nbCluster, PRODUCT_ID); + + String id; + if (!productid.exists()) { + id = getNetBeansId(); + } else { + id = FileUtils.readFile(productid).trim(); + } + + String[] components = id.split(PACK_ID_SEPARATOR); + + StringBuilder builder = new StringBuilder(components[0]); + for (int i = 1; i < components.length; i++) { + if (!components[i].equals(packId)) { + builder.append(PACK_ID_SEPARATOR).append(components[i]); + } + } + + FileUtils.writeFile(productid, builder); + } + + public static void removeProductId(File nbLocation) throws IOException { + File nbCluster = getNbCluster(nbLocation); + + File productid = new File(nbCluster, PRODUCT_ID); + + FileUtils.deleteFile(productid); + } + + public static FilesList createLicenseAcceptedMarker(File nbLocation, String text) throws IOException { + File nbCluster = getNbCluster(nbLocation); + + File license_accepted = new File(nbCluster, LICENSE_ACCEPTED); + + //if (!license_accepted.exists()) { + return FileUtils.writeFile(license_accepted, text, false); + //} else { + // return new FilesList(); + //} + } + + public static void removeLicenseAcceptedMarker(File nbLocation) throws IOException { + File nbCluster = getNbCluster(nbLocation); + + File license_accepted = new File(nbCluster, LICENSE_ACCEPTED); + + if (license_accepted.exists()) { + FileUtils.deleteFile(license_accepted); + } + } + + public static FilesList setUsageStatistics(File nbLocation, boolean enabled) throws IOException { + File file = new File(getNbCluster(nbLocation), CORE_PROPERTIES); + String prop = USAGE_STATISTICS_ENABLED_PROPERTY + "=" + enabled; + if (!file.exists()) { + return FileUtils.writeFile(file, + prop); + } else { + List list = FileUtils.readStringList(file); + boolean exist = false; + for (int i = 0; i < list.size(); i++) { + String s = list.get(i); + if (s.startsWith(USAGE_STATISTICS_ENABLED_PROPERTY)) { + exist = true; + if (!s.endsWith("" + enabled)) { + list.remove(i); + list.add(prop); + } + break; + } + } + if (!exist) { + list.add(prop); + } + FileUtils.writeStringList(file, list); + return new FilesList(); + } + } + + public static void setJavaHome(File nbLocation, File javaHome) throws IOException { + File netbeansconf = new File(nbLocation, NETBEANS_CONF); + + String contents = FileUtils.readFile(netbeansconf); + + String correctJavaHome = StringUtils.escapeRegExp(javaHome.getAbsolutePath()); + + contents = contents.replaceAll( + "#?" + NETBEANS_JDKHOME + "\".*?\"", + NETBEANS_JDKHOME + "\"" + correctJavaHome + "\""); + + FileUtils.writeFile(netbeansconf, contents); + } + + public static void setUserDir(File nbLocation, File userDir) throws IOException { + File netbeansconf = new File(nbLocation, NETBEANS_CONF); + + String contents = FileUtils.readFile(netbeansconf); + + String correctUserDir = StringUtils.escapeRegExp(userDir.getAbsolutePath()); + + contents = contents.replaceAll( + NETBEANS_USERDIR + + "\".*?\"", + NETBEANS_USERDIR + + "\"" + correctUserDir + "\""); + + FileUtils.writeFile(netbeansconf, contents); + } + + public static String getJvmOption(File nbLocation, String name) throws IOException { + return getJvmOption(nbLocation, name, "="); + } + + public static String getJvmOption(File nbLocation, String name, String separator) throws IOException { + final File netbeansconf = new File(nbLocation, NETBEANS_CONF); + + final String pattern = StringUtils.format( + NETBEANS_OPTIONS_PATTERN, + StringUtils.escapeRegExp(name), + StringUtils.escapeRegExp(separator)); + + final Matcher matcher = + Pattern.compile(pattern).matcher(FileUtils.readFile(netbeansconf)); + + if (matcher.find()) { + String value = matcher.group(4); + if (value == null) { + value = matcher.group(5); + } + if (value == null) { + value = matcher.group(6); + } + + return value; + } else { + return null; + } + } + + @Deprecated + public static void addJvmOption(File nbLocation, String name) throws IOException { + setJvmOption(nbLocation, name, null); + } + + @Deprecated + public static void addJvmOption(File nbLocation, String name, String value) throws IOException { + setJvmOption(nbLocation, name, value); + } + + @Deprecated + public static void addJvmOption(File nbLocation, String name, String value, boolean quote) throws IOException { + setJvmOption(nbLocation, name, value, quote); + } + + @Deprecated + public static void addJvmOption(File nbLocation, String name, String value, boolean quote, String separator) throws IOException { + setJvmOption(nbLocation, name, value, quote, separator); + } + + public static void setJvmOption(File nbLocation, String name) throws IOException { + setJvmOption(nbLocation, name, null, false); + } + + public static void setJvmOption(File nbLocation, String name, String value) throws IOException { + setJvmOption(nbLocation, name, value, false); + } + + public static void setJvmOption(File nbLocation, String name, String value, boolean quote) throws IOException { + setJvmOption(nbLocation, name, value, quote, "="); + } + + public static void setJvmOption(File nbLocation, String name, String value, boolean quote, String separator) throws IOException { + final File netbeansconf = new File(nbLocation, NETBEANS_CONF); + final String option = "-J" + name + (value != null ? + separator + (quote ? "\\\"" : "") + value + (quote ? "\\\"" : "") : ""); + + final String pattern = StringUtils.format( + NETBEANS_OPTIONS_PATTERN, + StringUtils.escapeRegExp(name), + StringUtils.escapeRegExp(separator)); + + String contents = FileUtils.readFile(netbeansconf); + final Matcher matcher = + Pattern.compile(pattern).matcher(contents); + + if (matcher.find()) { + contents = contents.replace(matcher.group(3), option); + } else { + contents = contents.replace( + NETBEANS_OPTIONS + "\"", + NETBEANS_OPTIONS + "\"" + option + " "); + } + + FileUtils.writeFile(netbeansconf, contents); + } + + public static void removeJvmOption(File nbLocation, String name) throws IOException { + removeJvmOption(nbLocation, name, "="); + } + + public static void removeJvmOption(File nbLocation, String name, String separator) throws IOException { + final File netbeansconf = new File(nbLocation, NETBEANS_CONF); + + String contents = FileUtils.readFile(netbeansconf); + + final String pattern = StringUtils.format( + NETBEANS_OPTIONS_PATTERN, + StringUtils.escapeRegExp(name), + StringUtils.escapeRegExp(separator)); + + final Matcher matcher = + Pattern.compile(pattern).matcher(contents); + + if (matcher.find()) { + contents = contents.replace(" " + matcher.group(3), ""); + contents = contents.replace(matcher.group(3) + " ", ""); + contents = contents.replace(matcher.group(3), ""); + } + + FileUtils.writeFile(netbeansconf, contents); + } + + /** + * Get JVM memory value. + * + * @param nbLocation NetBeans home directory + * @param memoryType Memory type that can be one of the following values + *
  • MEMORY_XMX
  • + *
  • MEMORY_XMS
  • + *
  • MEMORY_XSS
  • + *
+ * @return The size of memory in bytes.
+ * If there is no such option then return 0; + */ + public static long getJvmMemorySize(File nbLocation, String memoryType) throws IOException { + final String size = getJvmOption(nbLocation, memoryType, ""); + + if (size != null) { + return getJavaMemorySize(size); + } else { + return 0; + } + } + + /** + * Get JVM memory value.
+ * If value is zero then remove the jvm option from netbeans options

+ * @param nbLocation NetBeans home directory + * @param memoryType Memory type that can be one of the following values + *
  • MEMORY_XMX
  • + *
  • MEMORY_XMS
  • + *
  • MEMORY_XSS
  • + *
+ * @param value Size of memory to be set + */ + public static void setJvmMemorySize(File nbLocation, String memoryType, long size) throws IOException { + setJvmOption(nbLocation, memoryType, formatJavaMemoryString(size), false, ""); + } + /** + * Get NetBeans branding cluster directory + * @throws IOException if the no cluster directory exists + */ + public static File getNbCluster(File nbLocation) throws IOException { + File location = new File(nbLocation, "netbeans");//NOI18N + for (File child: location.listFiles()) { + LogManager.log(" child = " + child.getName()); + if (child.isDirectory() && child.getName().matches(NB_CLUSTER_PATTERN)) { + return child; + } + } + throw new IOException(ERROR_BRANDING_CLUSTER_NOT_EXIS_STRING); + } + + /** + * Get resolved netbeans user directory + * @param nbLocation NetBeans home directory + * @throws IOException if can`t get netbeans default userdir + */ + public static File getNetBeansUserDirFile(File nbLocation) throws IOException { + String dir = getNetBeansUserDir(nbLocation); + LogManager.log(ErrorLevel.DEBUG, "System.getProperty(netbeans.default_userdir_root): " + System.getProperty("netbeans.default_userdir_root")); + if (dir.contains(DEFAULT_USERDIR_ROOT) && System.getProperty("netbeans.default_userdir_root", null) != null) { + dir = dir.replace(DEFAULT_USERDIR_ROOT, System.getProperty("netbeans.default_userdir_root")); + } + if (dir.contains(USER_HOME_TOKEN)) { + dir = dir.replace(USER_HOME_TOKEN, System.getProperty("user.home")); + } + return new File(dir); + } + + /** + * Get netbeans user directory as it is written in netbeans.conf + * @param nbLocation NetBeans home directory + * @throws IOException if can`t get netbeans default userdir + */ + private static String getNetBeansUserDir(File nbLocation) throws IOException { + File netbeansconf = new File(nbLocation, NETBEANS_CONF); + String contents = FileUtils.readFile(netbeansconf); + Matcher matcher = Pattern.compile( + NEW_LINE_PATTERN + SPACES_PATTERN + + NETBEANS_USERDIR + + "\"(.*?)\"").matcher(contents); + if(matcher.find() && matcher.groupCount() == 1) { + return matcher.group(1); + } else { + throw new IOException(StringUtils.format( + ERROR_CANNOT_GET_USERDIR_STRING,netbeansconf)); + } + } + + /** + * Get resolved netbeans cache directory + * @param nbLocation NetBeans home directory + * @throws IOException if can`t get netbeans default cachedir + */ + public static File getNetBeansCacheDirFile(File nbLocation) throws IOException { + String dir = getNetBeansCacheDir(nbLocation); + LogManager.log(ErrorLevel.DEBUG, "System.getProperty(netbeans.default_cachedir_root): " + System.getProperty("netbeans.default_cachedir_root")); + if (dir.contains(DEFAULT_CACHEDIR_ROOT) && System.getProperty("netbeans.default_cachedir_root", null) != null) { + dir = dir.replace(DEFAULT_CACHEDIR_ROOT, System.getProperty("netbeans.default_cachedir_root")); + } + if (dir.contains(USER_HOME_TOKEN)) { + dir = dir.replace(USER_HOME_TOKEN, System.getProperty("user.home")); + } + return new File(dir); + } + + /** + * Get netbeans user directory as it is written in netbeans.conf + * @param nbLocation NetBeans home directory + * @throws IOException if can`t get netbeans default userdir + */ + private static String getNetBeansCacheDir(File nbLocation) throws IOException { + File netbeansconf = new File(nbLocation, NETBEANS_CONF); + String contents = FileUtils.readFile(netbeansconf); + Matcher matcher = Pattern.compile( + NEW_LINE_PATTERN + SPACES_PATTERN + + NETBEANS_CACHEDIR + + "\"(.*?)\"").matcher(contents); + if(matcher.find() && matcher.groupCount() == 1) { + return matcher.group(1); + } else { + throw new IOException(StringUtils.format( + ERROR_CANNOT_GET_USERDIR_STRING,netbeansconf)); + } + } + + /** + * Get jdkhome as it is written in netbeans.conf + * @param nbLocation NetBeans home directory + * @return JDK location + * @throws IOException if can`t get netbeans_jdkhome value of netbeans.conf + */ + public static String getJavaHome(File nbLocation) throws IOException { + File netbeansconf = new File(nbLocation, NETBEANS_CONF); + String contents = FileUtils.readFile(netbeansconf); + + Matcher matcher = Pattern.compile( + NEW_LINE_PATTERN + SPACES_PATTERN + + NETBEANS_JDKHOME + + "\"(.*?)\"").matcher(contents); + + if(matcher.find() && matcher.groupCount() == 1) { + return matcher.group(1); + } else { + throw new IOException(StringUtils.format( + ERROR_CANNOT_GET_JAVAHOME_STRING, netbeansconf)); + } + } + + /** + * Check if NetBeans is running + * @param nbLocation NetBeans home directory + * @return True if NetBeans is running + * @throws IOException if can`t say for sure whether it is running or not + */ + public static boolean isNbRunning(File nbLocation) throws IOException { + return FileUtils.exists(getLockFile(nbLocation)); + } + + public static File getLockFile(File nbLocation) throws IOException { + return new File(getNetBeansUserDirFile(nbLocation), "lock"); + } + + /** + * Test for running NetBeans IDE.
+ * If the lock file exist - issue a warning but do not throw an exception + */ + public static boolean warnNetbeansRunning(File nbLocation) { + try { + boolean isRunning = isNbRunning(nbLocation); + if (isRunning) { + if(!checkedAndRunning.contains(nbLocation)) { + checkedAndRunning.add(nbLocation); + final String message = ResourceUtils.getString( + NetBeansUtils.class, + "NU.warning.running"); // NOI18N + final String warning = StringUtils.format( + message, + nbLocation, + NetBeansUtils.getLockFile(nbLocation)); + + // uninstallation shouls not run when trying to uninstall + // running instance of NB + ErrorManager.notifyCritical(warning); + } + } else { + checkedAndRunning.remove(nbLocation); + } + + return isRunning; + } catch (IOException e) { + ErrorManager.notifyDebug( + "Can`t say for sure if NetBeans is running or not", + e); + } + + return false; + } + + public static void updateNetBeansHome(final File nbLocation) throws IOException { + FileUtils.modifyFile( + new File(nbLocation, NETBEANS_CONF), + NETBEANS_HOME_TOKEN, + nbLocation.getAbsolutePath()); + } + + public static void runUpdater(File nbLocation) throws IOException { + File jdkLocation = new File(getJavaHome(nbLocation)); + LogManager.log("running the NetBeans updater : "); + LogManager.log(" nbLocation = " + nbLocation); + LogManager.log(" jdkLocation = " + jdkLocation); + + List classes = new ArrayList (); + List nbDirs = new ArrayList (); + + + File netbeansclusters = new File(nbLocation, NETBEANS_CLUSTERS); + List list = FileUtils.readStringList(netbeansclusters); + + File platformCluster = null; + + for(String s : list) { + String cluster = s.trim(); + if(!cluster.startsWith("#") && + !cluster.equals("etc")) { + nbDirs.add(new File(nbLocation, cluster)); + if(cluster.startsWith("platform")) { + platformCluster= new File(nbLocation, cluster); + } + } + } + + String nbDirsString = StringUtils.asString(nbDirs, File.pathSeparator); + + LogManager.log(" adding classes to classpath"); + classes.add(new File(platformCluster, + "lib" + File.separator + "boot.jar")); + if(!SystemUtils.isMacOS()) { + classes.add(new File(jdkLocation, + "lib" + File.separator + "tools.jar" )); + } + classes.add(new File(jdkLocation, + "lib" + File.separator + "dt.jar")); + classes.add(new File(platformCluster, + "modules" + File.separator + + "ext" + File.separator + + "updater.jar")); + String classpath = StringUtils.asString(classes, File.pathSeparator); + + String importClassProp = "netbeans.importclass"; + String nbHomeProp = "netbeans.home"; + String nbHome = platformCluster.getPath(); + String nbUserdir = getNetBeansUserDirFile(nbLocation).getPath(); + String nbUserdirProp = "netbeans.user"; + String nbDirsProp = "netbeans.dirs"; + String sysProp ="-D"; + String eq = "="; + String java = JavaUtils.getExecutable(jdkLocation).getPath(); + LogManager.log(" executing updater..."); + SystemUtils.executeCommand(nbLocation, new String [] { + java, + sysProp + importClassProp + eq + UPDATER_CLASSNAME, + sysProp + nbHomeProp + eq + nbHome, + sysProp + nbUserdirProp + eq + nbUserdir, + sysProp + nbDirsProp + eq + nbDirsString, + "-Xms32m", "-XX:MaxPermSize=96m", "-Xverify:none", "-Xmx128m", + "-cp", classpath, + UPDATER_FRAMENAME, "--nosplash"}); + } + public static boolean setModuleStatus(File nbLocation, String clusterName, String moduleName, boolean enable) { + LogManager.log(ErrorLevel.DEBUG, + ((enable) ? "... enabling" : "disabling") + + " module " + moduleName + + " in cluster " + clusterName + + " at " + nbLocation); + final File configFile = getConfigFile(nbLocation, clusterName, moduleName); + if (FileUtils.exists(configFile)) { + Document doc = null; + try { + doc = XMLUtils.loadXMLDocument(configFile); + } catch (XMLException e) { + LogManager.log("Cannot load config file", e); + } + if (doc != null) { + for (Element element : XMLUtils.getChildren(doc.getDocumentElement(), "param")) { + if (element.getAttribute("name").equals("enabled")) { + if (element.getTextContent().equals(Boolean.toString(!enable))) { + element.setTextContent(Boolean.toString(enable)); + try { + XMLUtils.saveXMLDocument(doc, configFile); + LogManager.log(ErrorLevel.MESSAGE, "... module status changed"); + return true; + } catch (XMLException e) { + LogManager.log("... Cannot save config file", e); + } + } else { + LogManager.log(ErrorLevel.MESSAGE, "... module is already set to requested status"); + return true; + } + break; + } + } + } + LogManager.log(ErrorLevel.MESSAGE,"... module status did not changed"); + } else { + LogManager.log(ErrorLevel.MESSAGE,"... module config file does not exist at " + configFile); + } + return false; + } + + public static Boolean getModuleStatus(File nbLocation, String clusterName, String moduleName) { + LogManager.log(ErrorLevel.DEBUG, + "... getting status of module " + moduleName + + " in cluster " + clusterName + + " at " + nbLocation); + final File configFile = getConfigFile(nbLocation, clusterName, moduleName); + + if (FileUtils.exists(configFile)) { + Document doc = null; + try { + doc = XMLUtils.loadXMLDocument(configFile); + } catch (XMLException e) { + LogManager.log("Cannot load config file", e); + } + if (doc != null) { + for (Element element : XMLUtils.getChildren(doc.getDocumentElement(), "param")) { + if (element.getAttribute("name").equals("enabled")) { + return Boolean.valueOf(element.getTextContent()); + } + } + } + LogManager.log(ErrorLevel.MESSAGE,"... cannot get module status"); + } else { + LogManager.log(ErrorLevel.MESSAGE,"... module config file does not exist"); + } + return null; + } + + private static File getConfigFile(File nbLocation, String clusterName, String moduleName) { + File cluster = new File (nbLocation, clusterName); + return new File(cluster, "config" + File.separator + "Modules" + File.separator + moduleName + ".xml"); + } + + // private ////////////////////////////////////////////////////////////////////// + private static long getJavaMemorySize(String string) { + String suffix = string.substring(string.length() - 1); + + if(!suffix.matches(DIGITS_PATTERN)) { + long value = Long.parseLong(string.substring(0, string.length() - 1)); + if(suffix.equalsIgnoreCase("k")) { + value *= K; + } else if(suffix.equalsIgnoreCase("m")) { + value *= M; + } else if(suffix.equalsIgnoreCase("g")) { + value *= G; + } else if(suffix.equalsIgnoreCase("t")) { + value *= T; + } + return value; + } else { + return new Long(string).longValue() * M; // default - megabytes + } + } + + private static String formatJavaMemoryString(long size) { + if((size > T) && (size % T == 0)) { + return StringUtils.EMPTY_STRING + (size/T) + "t"; + } else if((size > G) && (size % G == 0)) { + return StringUtils.EMPTY_STRING + (size/G) + "g"; + } else if((size > M) && (size % M == 0)) { + return StringUtils.EMPTY_STRING + (size/M) + "m"; + } else if((size > K) && (size % K == 0)) { + return StringUtils.EMPTY_STRING + (size/K) + "k"; + } else { + if(size > (10 * M)) { + // round up to the nearest M value + return StringUtils.EMPTY_STRING + (size/M + 1) + "m"; + } else { + // round up to the nearest K value + return StringUtils.EMPTY_STRING + (size/K + 1) + "k"; + } + } + } + public static String getNetBeansId() { + return BundleType.getType( + System.getProperty(NbWelcomePanel.WELCOME_PAGE_TYPE_PROPERTY)). + getNetBeansBundleId(); + } + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private NetBeansUtils() { + // does nothing + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String NETBEANS_CLUSTERS = + "netbeans/etc/netbeans.clusters"; // NOI18N + public static final String NETBEANS_CONF = + "netbeans/etc/netbeans.conf"; // NOI18N + public static final String PRODUCT_ID = + "config/productid"; // NOI18N + public static final String LICENSE_ACCEPTED = + "var/license_accepted"; // NOI18N + public static final String CORE_PROPERTIES = + "config/Preferences/org/netbeans/core.properties"; + public static final String USAGE_STATISTICS_ENABLED_PROPERTY = + "usageStatisticsEnabled";//NOI18N + public static final String DIGITS_PATTERN = + "[0-9]+"; // NOI18N + public static final String CLUSTER_NUMBER_PATTERN = + "(" + DIGITS_PATTERN + "(\\." + DIGITS_PATTERN + ")?)?"; // NOI18N + + public static final String NB_CLUSTER_PATTERN = + "nb" + CLUSTER_NUMBER_PATTERN + "$"; // NOI18N + public static final String NEW_LINE_PATTERN = + "[\r\n|\n|\r]"; // NOI18N + public static final String SPACES_PATTERN = + "\\ *"; // NOI18N + + public static final String NETBEANS_USERDIR = + "netbeans_default_userdir="; // NOI18N + public static final String NETBEANS_CACHEDIR = + "netbeans_default_cachedir="; // NOI18N + public static final String NETBEANS_JDKHOME = + "netbeans_jdkhome="; // NOI18N + public static final String NETBEANS_OPTIONS = + "netbeans_default_options="; // NOI18N + + public static final String NETBEANS_OPTIONS_PATTERN = + NETBEANS_OPTIONS + "\"(.*?)( ?)(-J{0}(?:{1}\\\\\\\"(.*?)\\\\\\\"|{1}(.*?)|())(?= |\"))( ?)(.*)?\""; + + public static final String LAST_MODIFIED_MARKER = + ".lastModified"; + public static final String UPDATE_TRACKING_DIR = + "update_tracking"; + public static final String NB_IDE_ID = + "NB"; // NOI18N + public static final String PACK_ID_SEPARATOR = + "_"; // NOI18N + public static final String MEMORY_XMX = + "-Xmx"; // NOI18N + public static final String MEMORY_XMS = + "-Xms"; // NOI18N + public static final String MEMORY_XSS = + "-Xss"; // NOI18N + public static final String USER_HOME_TOKEN = + "${HOME}"; // NOI18N + public static final String DEFAULT_USERDIR_ROOT = + "${DEFAULT_USERDIR_ROOT}"; // NOI18N + public static final String DEFAULT_CACHEDIR_ROOT = + "${DEFAULT_CACHEDIR_ROOT}"; // NOI18N + public static final String NETBEANS_HOME_TOKEN = + "${NETBEANS_HOME}"; // NOI18N + public static final String UPDATER_FRAMENAME = + "org.netbeans.updater.UpdaterFrame"; + public static final String UPDATER_CLASSNAME = + "org.netbeans.upgrade.AutoUpgrade"; + public static final String ERROR_BRANDING_CLUSTER_NOT_EXIS_STRING = + ResourceUtils.getString(NetBeansUtils.class, + "NU.error.branding.cluster.not.exists");//NOI18N + public static final String ERROR_CANNOT_GET_USERDIR_STRING = + ResourceUtils.getString(NetBeansUtils.class, + "NU.error.cannot.get.userdir");//NOI18N + public static final String ERROR_CANNOT_GET_JAVAHOME_STRING = + ResourceUtils.getString(NetBeansUtils.class, + "NU.error.cannot.get.javahome");//NOI18N + + public static final long K = + 1024; // NOMAGI + public static final long M = + K * K; + public static final long G = + M * K; + public static final long T = + G * K; + // one set for the whole installer + private static Set checkedAndRunning = new HashSet (); + + private static final String MEMORY_SUFFIX_PATTERN = + "[kKmMgGtT]?"; // NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/WebLogicUtils.java b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/WebLogicUtils.java new file mode 100644 index 000000000000..c16e038c6fc7 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/utils/applications/WebLogicUtils.java @@ -0,0 +1,388 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.utils.applications; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.StringReader; +import java.lang.String; +import java.util.ArrayList; +import java.util.List; +import org.netbeans.installer.utils.ErrorManager; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.helper.ExecutionResults; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.XMLUtils; +import org.netbeans.installer.utils.exceptions.XMLException; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +/** + * + + */ +public class WebLogicUtils { + // private static Map knownVersions = new HashMap(); + + private WebLogicUtils() { + // does nothing + } + + public static String configureEnvironment(File wlLocation, File jdkLocation) throws IOException { + String jdkPath = jdkLocation.getAbsolutePath(); + String wlPath = wlLocation.getAbsolutePath(); + if (SystemUtils.isWindows()) { + // must convert to short paths, the result is elimination of all spaces in path (wl installer cannot handle them) + jdkPath = convertPathNamesToShort(jdkPath); + wlPath = convertPathNamesToShort(wlPath); + wlLocation = new File(wlPath); + } + SystemUtils.getEnvironment().put(MW_HOME, wlPath); + SystemUtils.getEnvironment().put(JAVA_HOME, jdkPath); + //Setting an environment for WebLogic domain creation + final ExecutionResults configureResults = SystemUtils.executeCommand(wlLocation, getConfigureCommand(wlLocation)); + if(configureResults.getErrorCode() > 0) { + throw new DomainCreationException(ERROR_CONFIGURE_ERROR_STRING, configureResults.getErrorCode()); + } + if(configureResults.getStdOut().length() == 0) { + throw new DomainCreationException(ERROR_CONFIGURE_ENV_STRING); + } + return configureResults.getStdOut(); + } + + + public static void createDomain(File wlLocation, File jdkLocation, + File domainLocation, String domainName, String username, String adminPassword) throws IOException { + + LogManager.log(ErrorLevel.MESSAGE, "Creating domain " + domainName + "..."); + String configOutput = configureEnvironment(wlLocation, jdkLocation); + + ProcessBuilder domainBuilder = new ProcessBuilder(); + BufferedReader reader = new BufferedReader(new StringReader(configOutput)); + //parse CLASSPATH and PATH from the output. TODO: try to find another way to grab this vars + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + if(line.startsWith(CLASSPATH) || line.startsWith(PATH)) { + String[] keyvalue = line.split("="); + LogManager.log(ErrorLevel.MESSAGE, + "Setting environment variable " + keyvalue[0] + " to " + keyvalue[1]); + domainBuilder.environment().put(keyvalue[0], keyvalue[1]); + } + } + if(!domainBuilder.environment().containsKey(PATH) || + !domainBuilder.environment().containsKey(CLASSPATH)) { + throw new DomainCreationException(ERROR_CONFIGURE_ENV_STRING); + } + ////////////////// + List commands = new ArrayList (); + commands.add(getJavaExecutableCommand(jdkLocation)); + commands.add("-Xmx1024m"); + commands.add("-XX:MaxPermSize=128m"); + commands.add("-Dweblogic.Domain=" + domainName); + commands.add("-Dweblogic.management.GenerateDefaultConfig=true"); + commands.add("-Dweblogic.management.username=" + username); + commands.add("-Dweblogic.management.password=" + adminPassword); + commands.add("-Djava.endorsed.dirs=" + new File(wlLocation, "oracle_common" + File.separator + "modules" + File.separator + "endorsed").getAbsolutePath()); + commands.add("weblogic.Server"); +// %JAVA_HOME%\bin\java.exe +// -Xmx1024m -XX:MaxPermSize=128m -classpath=$CLASSPATH -Dweblogic.Domain=domainname -Dweblogic.management.GenerateDefaultConfig=true +// -Dweblogic.management.username=username -Dweblogic.management.password=password weblogic.Server + File domainDir = new File(domainLocation, domainName); + if(!domainDir.exists()) { + domainDir.mkdirs(); + } + domainBuilder.command(commands).directory(domainDir); + final ExecutionResults domainResults = + executeCommandWithDestroyTag(domainBuilder, SERVER_RUNNING_TAG, adminPassword); + if (domainResults.getErrorCode() == 0) { + throw new DomainCreationException(domainResults.getErrorCode()); + } + + } + + public static void stopDomains(File wlLocation) throws IOException{ + //figure out if we need to stop all the domains or just the default one to remove WL. + + LogManager.log(ErrorLevel.MESSAGE, "Stopping domains for WebLogic: " + wlLocation); + Document doc = null; + try { + doc = XMLUtils.loadXMLDocument(new File(wlLocation, DOMAIN_REGISTRY_XML)); + } catch (XMLException e) { + LogManager.log("Cannot load " + DOMAIN_REGISTRY_XML + " file", e); + } + if (doc != null) { + for (Element element : XMLUtils.getChildren(doc.getDocumentElement(), "domain")) { + File domainLocation = new File(element.getAttribute("location")); + stopDomain(wlLocation, domainLocation); + } + } + } + + public static boolean stopDomain(File wlLocation, File domainLocation) throws IOException{ + File stopWebLogicFile = getStopWebLogicFile(domainLocation); + + if(stopWebLogicFile.exists()) { + LogManager.log(ErrorLevel.MESSAGE, "Stopping domain at " + domainLocation); + SystemUtils.getEnvironment().put(MW_HOME, wlLocation.getAbsolutePath()); +// SystemUtils.getEnvironment().put(JAVA_HOME, +// new File(System.getProperty("java.home")).getAbsolutePath()); + + ExecutionResults results = SystemUtils.executeCommand( + wlLocation, + getStopWebLogicCommand(domainLocation)); + + return results.getErrorCode() != ExecutionResults.TIMEOUT_ERRORCODE; + } + LogManager.log(ErrorLevel.MESSAGE, "stopWebLogicFile doesn't exist for the domain: " + domainLocation); + return false; + } + + public static void unpackServerFiles (final File wlLocation, File javaHome, File installFile) throws IOException { + String wlPath = wlLocation.getAbsolutePath(); + if (SystemUtils.isWindows()) { + // must convert to short paths, the result is elimination of all spaces in path (wl installer cannot handle them) + wlPath = convertPathNamesToShort(wlPath); + } + //Setting an environment for WebLogic domain creation + List commands = new ArrayList (); + commands.add(getJavaExecutableCommand(javaHome)); + commands.add("-jar"); + commands.add(installFile.getAbsolutePath()); + commands.add("-novalidation"); + commands.add("ORACLE_HOME=" + wlPath); + final ExecutionResults configureResults = SystemUtils.executeCommand(wlLocation, commands.toArray(new String[commands.size()])); + if(configureResults.getErrorCode() > 0) { + throw new IOException(StringUtils.format(ERROR_UNPACKING_ERROR_STRING, configureResults.getErrorCode())); + } + } + + private static String[] getConfigureCommand(File wlLocation) { + String subPath = "wlserver/server/bin/".replace("/", File.separator); //NOI18N + String configure = new File(wlLocation, subPath + + (SystemUtils.isWindows() ? "setWLSEnv.cmd" : "setWLSEnv.sh")).getAbsolutePath(); + return SystemUtils.isWindows() ? new String[] {configure} : + new String[] {"/bin/bash", configure}; + } + + private static String[] getStopWebLogicCommand(File domainLocation) { + String stopWebLogic = getStopWebLogicFile(domainLocation).getAbsolutePath(); + return SystemUtils.isWindows() ? new String[] {stopWebLogic} : + new String[] {"/bin/bash", stopWebLogic}; + } + private static File getStopWebLogicFile(File domainLocation) { + return new File(domainLocation, "bin/" + + (SystemUtils.isWindows() ? "stopWebLogic.cmd" : "stopWebLogic.sh")); + } + + private static String getJavaExecutableCommand(File jdkLocation) { + return !SystemUtils.isWindows() ? jdkLocation.getAbsolutePath() + "/bin/java" : + convertPathNamesToShort(jdkLocation.getAbsolutePath()) + "\\bin\\java.exe"; + } + + private static String convertPathNamesToShort(String path){ + File pathConverter = new File(SystemUtils.getTempDirectory(), "pathConverter.cmd"); + String result = path; + List commands = new ArrayList (); + commands.add("@echo off"); + commands.add("set JPATH=" + path); + commands.add("for %%i in (\"%JPATH%\") do set JPATH=%%~fsi"); + commands.add("echo %JPATH%"); + try{ + FileUtils.writeStringList(pathConverter, commands); + ExecutionResults res=SystemUtils.executeCommand(pathConverter.getAbsolutePath()); + FileUtils.deleteFile(pathConverter); + result = res.getStdOut().trim(); + } catch(IOException ioe) { + LogManager.log(ErrorLevel.WARNING, + "Failed to convert " + path + " to a path with short names only." + + "\n Exception is thrown " + ioe); + } + return result; + } + + private static ExecutionResults executeCommandWithDestroyTag(ProcessBuilder builder, String processDestroyTag, String passwordToHide) throws IOException { + String commandString = StringUtils.asString(builder.command(), StringUtils.SPACE).replace(passwordToHide, "*****"); //NOI18N + LogManager.log(ErrorLevel.MESSAGE, + "executing command: " + commandString + + ", in directory: " + builder.directory()); + LogManager.indent(); + + StringBuilder processStdOut = new StringBuilder(); + StringBuilder processStdErr = new StringBuilder(); + int errorLevel = ExecutionResults.TIMEOUT_ERRORCODE; + + Process process = builder.start(); + + long startTime = System.currentTimeMillis(); + long endTime = startTime + MAX_EXECUTION_TIME; + boolean doRun = true; + boolean destroyTagReached = false; + long delay = INITIAL_DELAY; + while (doRun && (System.currentTimeMillis() < endTime)) { + try { + Thread.sleep(delay); + if(delay < MAX_DELAY) { + delay += DELTA_DELAY; + } + } catch (InterruptedException e) { + ErrorManager.notifyDebug("Interrupted", e); + } + try { + errorLevel = process.exitValue(); + doRun = false; + } catch (IllegalThreadStateException e) { + ; // do nothing - the process is still running + } + String string; + + string = StringUtils.readStream(process.getInputStream()); + if (string.length() > 0) { + BufferedReader reader = new BufferedReader(new StringReader(string)); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + LogManager.log(ErrorLevel.MESSAGE, "[stdout]: " + line); + if(line.contains(processDestroyTag)) { + try { + Thread.sleep(MAX_DELAY); + } catch(InterruptedException e) { + ErrorManager.notifyDebug("Interrupted", e); + } + LogManager.log(ErrorLevel.MESSAGE, + "processDestroyTag is reached, destroying the process"); + destroyTagReached = true; + break; + } + } + processStdOut.append(string); + } + + //temp solution - terminate the process when domain created + if(destroyTagReached) { + process.destroy(); + doRun = false; + errorLevel = 0; + break; + } + + string = StringUtils.readStream(process.getErrorStream()); + if (string.length() > 0) { + BufferedReader reader = new BufferedReader(new StringReader(string)); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + LogManager.log(ErrorLevel.MESSAGE, "[stderr]: " + line); + } + + processStdErr.append(string); + } + } + + LogManager.log(ErrorLevel.MESSAGE, + (doRun) ? + "[return]: killed by timeout" : + "[return]: " + errorLevel); + process.destroy(); + LogManager.unindent(); + LogManager.log(ErrorLevel.MESSAGE, "... command execution finished"); + + return new ExecutionResults(errorLevel, processStdOut.toString(), processStdErr.toString()); + } + + + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class DomainCreationException extends IOException { + private String message; + + public DomainCreationException() { + super(); + } + + public DomainCreationException(int errorCode) { + super(); + + if (errorCode != ExecutionResults.TIMEOUT_ERRORCODE) { + setMessage(StringUtils.format(ERROR_CREATE_DOMAIN_EXIT_CODE_STRING, errorCode)); + } else { + setMessage(ERROR_CREATE_DOMAIN_TIMEOUT_STRING); + } + } + public DomainCreationException(String msg, int errorCode) { + super(); + setMessage(StringUtils.format(msg, errorCode)); + } + public DomainCreationException(String msg) { + super(); + setMessage(msg); + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public String getMessage() { + return message; + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final long MAX_EXECUTION_TIME = 600000; + public static final int MAX_DELAY = 50; // NOMAGI + public static final int INITIAL_DELAY = 5; // NOMAGI + public static final int DELTA_DELAY = 5; // NOMAGI + + private static final String SERVER_RUNNING_TAG = + "The server started in RUNNING mode"; // NOI18N + private static final String MW_HOME = + "MW_HOME"; // NOI18N + private static final String JAVA_HOME = + "JAVA_HOME"; // NOI18N + private static final String CLASSPATH = + "CLASSPATH"; // NOI18N + private static final String PATH = + "PATH"; // NOI18N + private static final String DOMAIN_REGISTRY_XML = + "domain-registry.xml"; // NOI18N + + public static final String ERROR_CONFIGURE_ENV_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.configure.env"); + public static final String ERROR_CONFIGURE_ERROR_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.configure.errno"); + public static final String ERROR_UNPACKING_ERROR_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.unpacking.errno"); //NOI18N + public static final String ERROR_CREATE_DOMAIN_ERROR_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.create.domain.errno"); + public static final String ERROR_CREATE_DOMAIN_EXIT_CODE_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.create.domain.exitcode"); + public static final String ERROR_CREATE_DOMAIN_TIMEOUT_STRING = + ResourceUtils.getString(WebLogicUtils.class, + "WU.error.create.domain.timeout"); + + +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties new file mode 100644 index 000000000000..684da4fc74b2 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/Bundle.properties @@ -0,0 +1,33 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +############################################################################### +# NbInitializationAction.java +NIA.title=Configuring the Installer... +NIA.description=Please wait while NetBeans IDE installer initializes +NIA.progress.title=Configuring the Installer... + +############################################################################### +# NbServiceTagCreateAction.java + +#NOI18N +NSTCA.installer.source.name=NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jdk={0} and NetBeans IDE {display-version} Installer +#NOI18N +NSTCA.installer.source.name.jtb=Java EE 5 Tools Bundle {jtb-display-version} Installer diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbInitializationAction.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbInitializationAction.java new file mode 100644 index 000000000000..2935f1c2e963 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbInitializationAction.java @@ -0,0 +1,126 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.wizard.components.actions.netbeans; + +import java.util.List; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.applications.JavaUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.helper.ExecutionMode; +import org.netbeans.installer.utils.progress.CompositeProgress; +import org.netbeans.installer.utils.progress.Progress; +import org.netbeans.installer.wizard.components.WizardAction; +import org.netbeans.installer.wizard.components.WizardComponent; +import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction; +import org.netbeans.installer.wizard.components.actions.InitializeRegistryAction; +import org.netbeans.installer.wizard.components.actions.SearchForJavaAction; + +/** + * + + */ +public class NbInitializationAction extends WizardAction { + + private InitializeRegistryAction initReg; + private DownloadConfigurationLogicAction downloadLogic; + private SearchForJavaAction searchJava; + private WizardAction currentAction; + + public NbInitializationAction() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + initReg = new InitializeRegistryAction(); + downloadLogic = new DownloadConfigurationLogicAction(); + searchJava = new SearchForJavaAction(); + } + + public void execute() { + final CompositeProgress progress = new CompositeProgress(this.getWizardUi()); + progress.setTitle(getProperty(TITLE_PROPERTY)); + progress.setPercentage(10); + progress.synchronizeDetails(false); + if (initReg.canExecuteForward()) { + currentAction = initReg; + initReg.setWizard(getWizard()); + initReg.execute(); + } + + if (downloadLogic.canExecuteForward()) { + currentAction = downloadLogic; + downloadLogic.setWizard(getWizard()); + downloadLogic.execute(); + } + + if (searchJava.canExecuteForward() && + ExecutionMode.getCurrentExecutionMode() == ExecutionMode.NORMAL) { + boolean doSearch = false; + List toInstall = Registry.getInstance().getProductsToInstall(); + for (Product product : toInstall) { + try { + if(product.getUid().equals("jdk")) { + if(JavaUtils.findJDKHome(product.getVersion())==null) { + try { + if(!SystemUtils.isWindows() || SystemUtils.isCurrentUserAdmin()) { + doSearch = false; + break; + } + } catch (NativeException e) { + LogManager.log(e); + } + } + } else if (product.getUid().equals("jre-nested")) { + //SearchForJavaAction.addJavaLocation(product.getInstallationLocation()); + doSearch = false; + break; + } else { + for (WizardComponent component : product.getLogic().getWizardComponents()) { + if (component instanceof SearchForJavaAction) { + doSearch = true; + break; + } + } + } + } catch (InitializationException e) { + LogManager.log(e); + } + } + if (doSearch) { + currentAction = searchJava; + Progress javaSearchProgress = new Progress(); + progress.addChild(javaSearchProgress, 90); + searchJava.setWizard(getWizard()); + searchJava.execute(javaSearchProgress); + } + } + } + public static final String DEFAULT_TITLE = ResourceUtils.getString(NbInitializationAction.class, + "NIA.title"); // NOI18N + + public static final String DEFAULT_DESCRIPTION = ResourceUtils.getString(NbInitializationAction.class, + "NIA.description"); // NOI18N*/ + +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbMetricsAction.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbMetricsAction.java new file mode 100644 index 000000000000..537a1d5ef251 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbMetricsAction.java @@ -0,0 +1,74 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.wizard.components.actions.netbeans; + +import java.io.File; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.applications.NetBeansUtils; +import org.netbeans.installer.utils.helper.DetailedStatus; +import org.netbeans.installer.utils.helper.UiMode; +import org.netbeans.installer.wizard.components.WizardAction; + +/** + * + */ +public class NbMetricsAction extends WizardAction { + + public NbMetricsAction() { + } + + @Override + public void execute() { + final Registry registry = Registry.getInstance(); + final List products = new LinkedList(); + products.addAll(registry.getProducts(DetailedStatus.INSTALLED_SUCCESSFULLY)); + products.addAll(registry.getProducts(DetailedStatus.INSTALLED_WITH_WARNINGS)); + for (Product product : products) { + final String uid = product.getUid(); + if (uid.equals("nb-base") || uid.equals("nb-all")) { + File location = product.getInstallationLocation(); + try { + boolean metricsEnabled = Boolean.getBoolean(ENABLE_NETBEANS_METRICS_PROPERTY); + LogManager.log("Set usage statistics enabled of NetBeans at " + location + " to " + metricsEnabled); + NetBeansUtils.setUsageStatistics(location, metricsEnabled); + } catch (IOException e) { + LogManager.log(e); + } + break; + } + } + } + + @Override + public boolean canExecuteForward() { + return UiMode.getCurrentUiMode() != UiMode.SILENT; + } + + @Override + public WizardActionUi getWizardUi() { + return null; + } + public static final String ENABLE_NETBEANS_METRICS_PROPERTY = + "enable.netbeans.metrics"; +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbShowUninstallationSurveyAction.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbShowUninstallationSurveyAction.java new file mode 100644 index 000000000000..9dab5a1f01ab --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/actions/netbeans/NbShowUninstallationSurveyAction.java @@ -0,0 +1,107 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.wizard.components.actions.netbeans; + +import java.io.File; +import java.net.URI; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.*; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.UiMode; +import org.netbeans.installer.wizard.components.WizardAction; + +/** + * + + */ +public class NbShowUninstallationSurveyAction extends WizardAction { + + @Override + public void execute() { + try { + LogManager.logEntry("... execute show uninstallation survey action"); + for (Product product : Registry.getInstance().getProducts("nb-base")) { + if (product.getStatus() == Status.NOT_INSTALLED && product.hasStatusChanged()) { + String startTime = product.getProperty("installation.timestamp"); + String endTime = product.getProperty("uninstallation.timestamp"); + if (startTime != null && endTime != null) { + LogManager.log("... " + product.getLogic().getSystemDisplayName() + " was uninstalled"); + Long lifetime = new Long(endTime) - new Long(startTime); + LogManager.log("... lifetime (milliseconds) : " + lifetime); + if(lifetime < 0) { + LogManager.log("... time is less than zero (?), skipping the product"); + continue; + } + Long days = 1 + (lifetime / (1000L * 60L * 60L * 24L)); + LogManager.log("... lifetime (days, rounded up) : " + days); + final String version = + product.getVersion().getMajor() + + StringUtils.DOT + + product.getVersion().getMinor(); + + LogManager.log("... version : " + version); + final File superId = getSuperId(); + String id = ""; + if (FileUtils.exists(superId)) { + id = FileUtils.readStringList(superId).get(0); + } + + String url = StringUtils.format(UNINSTALLATION_SURVEY_URL, version, id, days.toString()); + LogManager.log("... URL : " + url); + if(BrowserUtils.isBrowseSupported()) { + BrowserUtils.openBrowser(new URI(url)); + } else { + LogManager.log("... browser is not supported"); + } + } + } + } + } catch (Exception ex) { + LogManager.log(ex); + } finally { + LogManager.logExit("... finished show uninstallation survey action"); + } + } + + private File getSuperId() { + // 1. check new OS specific place + File superId = new File(SystemUtils.getDefaultUserdirRoot() + File.separator + ".superId"); + // 2. if doesn't exist => use former place + if (! superId.exists()) { + superId = new File(SystemUtils.getUserHomeDirectory(), ".netbeans" + File.separator + ".superId"); + } + return superId; + } + + @Override + public boolean canExecuteForward() { + return UiMode.getCurrentUiMode() != UiMode.SILENT && Boolean.getBoolean(SHOW_UNINSTALLATION_SURVEY_PROPERTY); + } + + @Override + public WizardActionUi getWizardUi() { + return null; + } + public static final String UNINSTALLATION_SURVEY_URL = + "http://quality.netbeans.org/survey/uninstall?version={0}&id={1}&life={2}";//NOI18N + public static final String SHOW_UNINSTALLATION_SURVEY_PROPERTY = + "show.uninstallation.survey"; +} + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/Bundle.properties b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/Bundle.properties new file mode 100644 index 000000000000..48d9409d9112 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/Bundle.properties @@ -0,0 +1,267 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +################################################################################ +# NbPreInstallSummaryPanel.java +NPrISP.title=Summary +NPrISP.description=Click Install to start the installation. +NPrISP.description.uninstall=Click Uninstall to start the uninstallation. + +NPrISP.installation.folder={0} Installation Folder: +NPrISP.installation.folder.netbeans=NetBeans IDE Installation Folder: +NPrISP.uninstall.list.label.text=The following components will be uninstalled: +NPrISP.uninstall.list.netbeans.label.text=The following components of {0} will be uninstalled: +NPrISP.installation.size=Total Installation Size: +NPrISP.download.size=Total Download Size: +NPrISP.addons.gf.install.location.text={0} will be installed to the GlassFish folder. +NPrISP.addons.as.install.location.text={0} will be installed to the AppServer folder. +NPrISP.addons.nb.install.location.text={0} will be installed to the NetBeans IDE folder. +NPrISP.junit.present.text=JUnit library will be downloaded and installed during installation of NetBeans IDE. + +NPrISP.additional.runtimes.to.delete=
Runtimes to remove with {0}: +NPrISP.additional.folders.to.delete=
Delete the following folders during the uninstallation process: + +NPrISP.next.button.text=&Install +NPrISP.next.button.text.uninstall=&Uninstall + +NPrISP.error.not.enough.space=Insufficient disk space for proper installation. Additional {1} is required in {0}. +NPrISP.error.cannot.check.space=Cannot check the free disk space +NPrISP.error.logic.access=Could not access product's configuration logic +NPrISP.error.fsroots=Cannot get the list of file system roots +NPrISP.error.non.existent.root={0} is set up to be installed to {1} which does not belong to any of the file system roots. +NPrISP.error.cannot.write=The wizard does not have write access to {1}, the installation directory of {0}. Please correct the permissions before proceeding. +#NOI18N +NPrISP.remove.netbeans.userdir.link=https://netbeans.apache.org/wiki/DevFaqUserDir +NPrISP.remove.netbeans.userdir.text=\ +\ +The NetBeans user folder (userdir) contains the configuration data for the IDE.
\ +For more information about the NetBeans userdir, go to {1}. +NPrISP.remove.netbeans.installdir.text=\ +\ +The NetBeans installation folder might contain updates and plugins
\ +that were installed after the initial installation. The folder might also
\ +contain some user files or additional files added by a third party. +NPrISP.remove.netbeans.userdir.checkbox=&NetBeans userdir at {0} +NPrISP.remove.netbeans.installdir.checkbox=NetBeans &installation folder +NPrISP.check.for.updates.text=\ +\ +The NetBeans installer can automatically check for updates of installed plugins
\ +using your Internet connection. +NPrISP.check.for.updates.checkbox=Check for &Updates + +################################################################################ +# NbPostInstallSummaryPanel.java +NPoISP.title=Setup Complete +NPoISP.description=Click Finish to finish the NetBeans IDE setup. + +NPoISP.message.text.success=Installation completed successfully. +#NOI18N +NPoISP.message.content.type.success=text/html + +NPoISP.message.text.warnings=Installation completed successfully but some warnings were encountered during the installation of {1}.

For more details consult the installation log file:
{0}
+#NOI18N +NPoISP.message.content.type.warnings=text/html + +NPoISP.message.text.errors=Installation of {1} was not completed.

Try to run installer again or consult the installation log file for more details:
{0} +#NOI18N +NPoISP.message.content.type.errors=text/html + +NPoISP.message.restart.text=Please restart your computer to complete the configuration of JRE. +#NOI18N +NPoISP.message.restart.content.type=text/html + +NPoISP.message.netbeans.text.windows=To launch the IDE, use either the Start menu or the NetBeans desktop icon.\n\nTo change installed components and add NetBeans plugins, use Plugin Manager that is an integral part of NetBeans IDE. +NPoISP.message.netbeans.text.unix=To launch the IDE, use the NetBeans desktop icon.\n\nTo change installed components and add NetBeans plugins, use Plugin Manager that is an integral part of NetBeans IDE. +NPoISP.message.netbeans.text.macosx=To launch the IDE, use the NetBeans dock icon.\n\nTo change installed components and add NetBeans plugins, use Plugin Manager that is an integral part of NetBeans IDE. +#NOI18N +NPoISP.message.netbeans.content.type=text/plain + +#NOI18N +NPoISP.message.registration.netbeans=NetBeans IDE +#NOI18N +NPoISP.message.registration.glassfish=GlassFish +#NOI18N +NPoISP.message.registration.jdk=Java SE Development Kit +#NOI18N +NPoISP.message.registration.appserver=Sun GlassFish Enterprise Server +NPoISP.message.registration.concat={0} and {1} +NPoISP.message.registration.text=\ +       \ + Registration gives you the following benefits:\ +
    \ +
  • Special offers on Sun developer products, services and training
  • \ +
  • Ability to track and manage your registered products on the SunConnection Inventory site
  • \ +
\ +       \ + Registration is FREE. +NPoISP.message.registration.checkbox=&Register the {0} after finishing the installation +#NOI18N +NPoISP.message.registration.content.type=text/html + +NPoISP.message.metrics.checkbox=&Contribute to the NetBeans project by providing anonymous usage data +#NOI18N +NPoISP.message.metrics.list.content.type=text/html +NPoISP.message.metrics.list=\ +
    \ +
  • If you agree to participate, the IDE will keep track of the high-level features you use
  • \ +
  • The collected anonymous data will be submitted to a usage statistics database at netbeans.org server
  • \ +
+#NOI18N +NPoISP.message.metrics.text.content.type=text/html +NPoISP.message.metrics.text=\ + The usage statistics will help the development team to better understand user requirements and prioritize improvements in future releases. \ + We cannot and will not reverse-engineer that collected data to find specific details concerning your projects. \ + See more information. + +NPoISP.message.text.success.uninstall=Uninstallation completed successfully. +#NOI18N +NPoISP.message.content.type.success.uninstall=text/html + +NPoISP.message.text.warnings.uninstall=Uninstallation completed successfully but some warnings were encountered during uninstallation of {1}.

For more details consult the installation log file:
{0}
+#NOI18N +NPoISP.message.content.type.warnings.uninstall=text/html + +NPoISP.message.text.errors.uninstall=Uninstallation of {1} was not completed.

Try to run uninstaller again or consult the uninstallation log file for more details:
{0}
+#NOI18N +NPoISP.message.content.type.errors.uninstall=text/html + +NPoISP.message.files.remaining=

Some files could not be removed from the installation directories of the {0}. You may need to remove them manually. + +NPoISP.message.using.mysql.windows=MySQL Server has been installed as a standard system service. For instructions on how to start/stop MySQL Server from NetBeans, refer to NetBeans FAQ. +NPoISP.message.using.mysql.unix=MySQL Server has been installed to {0}.
For instructions on how to start/stop it from NetBeans, please refer to NetBeans FAQ. +#NOI18N +NPoISP.message.mysql.content.type=text/html + +NPoISP.next.button.text=&Finish + +################################################################################ +# NbWelcomePanel.java +NWP.title= +NWP.description= + +#NOI18N +NWP.text.pane.content.type=text/html + +NWP.welcome.text.header=

Welcome to the Apache NetBeans IDE {display-version} Installer

+NWP.welcome.text.header.jdk=

Welcome to the {0} and NetBeans IDE {display-version} Installer

+NWP.welcome.text.header.jtb=

Welcome to the Java Platform, Enterprise Edition 5 Tools Bundle {jtb-display-version} Installer

+NWP.welcome.text.header.nbgfmysql=

Welcome to the NetBeans IDE with GlassFish and MySQL Bundle Installer

+NWP.welcome.text.header.nbbundledproduct=

Welcome to the {0} and NetBeans IDE {display-version} Installer

+ +NWP.welcome.text.header.mysql=The installer will install the NetBeans IDE with the selected servers.

Select the servers to install with the IDE:

+NWP.welcome.text.header.java.tools=The installer will install the Java Platform, Enterprise Edition 5 SDK and NetBeans IDE.
+NWP.welcome.text.header.customize=The installer will install the NetBeans IDE with the following packs and runtimes.
Click Customize to select the packs and runtimes to install.

+NWP.welcome.text.header.java=The installer will install the NetBeans IDE with the following packs and runtimes.
Click Customize to select the packs and runtimes to install.

+NWP.welcome.text.header.nb-all=You will be guided through the steps to install IDE. +NWP.welcome.text.header.javame=The installer will install the NetBeans IDE with the Mobility pack.
+NWP.welcome.text.header.javase=The installer will install the NetBeans IDE with the Java SE pack.
+NWP.welcome.text.header.javaee=The installer will install the NetBeans IDE with the Java EE pack and selected application servers.

Select the application servers to install with the IDE:

+NWP.welcome.text.header.ruby=The installer will install the NetBeans IDE with the Ruby pack.

Select server to install with the IDE:

+NWP.welcome.text.header.html=The installer will install the NetBeans IDE with the HTML5/JavaScript pack.
+NWP.welcome.text.header.php=The installer will install the NetBeans IDE with the HTML5/JavaScript and PHP packs.
+NWP.welcome.text.header.cnd=The installer will install the NetBeans IDE with the C/C++ pack.
+NWP.welcome.text.header.javafx=The installer will install the NetBeans IDE with JavaFX.
+ +NWP.welcome.text.header.bundledproduct=The installer will install the {0} and NetBeans IDE.
+NWP.welcome.text.header.customize.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
Click Customize to select the packs and runtimes to install.

+NWP.welcome.text.header.javame.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
+NWP.welcome.text.header.javase.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
+NWP.welcome.text.header.javaee.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.

Select the application servers to install with the IDE:

+NWP.welcome.text.header.ruby.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
+NWP.welcome.text.header.cnd.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
+NWP.welcome.text.header.php.jdk=The installer will install the Java SE Development Kit (JDK) and NetBeans IDE.
+ +NWP.welcome.admin.warning.text=This account does not have sufficient privileges to install Java\u2122.
Please login to an account with administrative permissions. +NWP.jdk.installed.text={0} is already installed. Click next if you want to proceed with NetBeans IDE installation. +NWP.jdk.everything.installed.text=NetBeans IDE {display-version} and {0} are already installed.
Click Cancel to exit the installation. +NWP.jdk.everything.installed.admin.warning.text=This account does not have sufficient privileges to install Java\u2122.
Please login to an account with administrative permissions.
NetBeans IDE {display-version} is already installed.
Click Cancel to exit the installation. +NWP.jdk.netbeans.installed.text=NetBeans IDE {display-version} is already installed.
Click next if you want to proceed with JDK installation. + +NWP.bundledproduct.welcome.admin.warning.text=This account does not have sufficient privileges to install {0}.
Please login to an account with administrative permissions. +NWP.bundledproduct.installed.text={0} is already installed. Click next if you want to proceed with NetBeans IDE installation. +NWP.bundledproduct.everything.installed.text=NetBeans IDE {display-version} and {0} are already installed.
Click Cancel to exit the installation. +NWP.bundledproduct.everything.installed.admin.warning.text=This account does not have sufficient privileges to install {0}.
Please login to an account with administrative permissions.
NetBeans IDE {display-version} is already installed.
Click Cancel to exit the installation. +NWP.bundledproduct.netbeans.installed.text=NetBeans IDE {display-version} is already installed.
Click next if you want to proceed with {0} installation. +NWP.bundledproduct.not.installable.netbeans.installed.text=NetBeans IDE {display-version} is already installed and It is not possible to install {0} on this machine.
Click Cancel to exit the installation. +NWP.bundledproduct.not.installable.text=It is not possible to install {0} on this machine. Click next if you want to proceed with NetBeans IDE installation. + +NWP.additional.product.to.be.installed=
{0} will be installed following JDK installation. +NWP.additional.product.already.installed=
{0} is already installed. + +NWP.welcome.text.group.template=
{0}
+NWP.welcome.text.product.installed.template={0} (Already Installed)
+NWP.welcome.text.product.different.build.installed.template={0} (Different Build Already Installed - Need to uninstall first)
+NWP.welcome.text.product.not.installed.template={0}
+NWP.welcome.text.opentag= +NWP.welcome.text.footer= +NWP.customize.button.text=&Customize... +NWP.installation.size.label.text=Installation Size: {0} + + +NWP.customize.title=Customize Installation + +NWP.message.both=&Select packs and runtimes to install from the list below, unselect those you want to uninstall. +NWP.message.install=&Select packs and runtimes to install from the list below. +NWP.message.uninstall=Un&select packs and runtimes to uninstall from the list below. + +#NOI18N +NWP.component.description.text={0} +#NOI18N +NWP.component.description.content.type=text/plain +NWP.sizes.label.text=Installation size: {0} Download Size: {1} +NWP.sizes.label.text.no.download=Installation size: {0} + +NWP.default.installation.size=N/A +NWP.default.download.size=N/A +NWP.default.component.description=Select a component to see its description. + +NWP.ok.button.text=&OK +NWP.cancel.button.text=Cancel + +NWP.error.no.changes.both=You did not select anything to install or uninstall. Select at least one pack or runtime for installation or uninstallation. +NWP.error.no.changes.install=You did not select anything to install. Select at least one pack or runtime for installation. +NWP.error.no.runtimes.install=NetBeans IDE {display-version} is already installed. Select at least one runtime for installation. +NWP.error.no.changes.uninstall=You did not select anything to uninstall. Select at least one pack or runtime for uninstallation. +NWP.error.requirement.install={1} is required to install {0}. +NWP.error.conflict.install={0} conflicts with {1}. +NWP.error.requirement.uninstall={0} is required by {1}. +NWP.error.not.enough.space.to.download=Insufficient disk space for downloading the installation data. Additional {1} is required in {0}. +NWP.error.not.enough.space.to.extract=Insufficient disk space for extracting the installation data. Additional {1} is required in {0}. +NWP.error.everything.is.installed=All of the available components are already installed. Click Cancel to exit the installer. +NWP.warning.no.compatible.jdk.found=No compatible JDK was found. +NWP.warning.no.compatible.java.found=No compatible Java environment was found. +NWP.warning.no.compatible.jdk.found.dependent=Some of the selected packs require JDK to run. +################################################################################ +# NbCustomizeSelectionDialog.java +NCSD.feature.description.title=Description +NCSD.list.product.installed={0} (Already Installed) +NCSD.list.product.different.build.installed={0} (Already Installed Different Build) + +################################################################################ +# NbJUnitLicensePanel.java +NLP.title=JUnit License Agreement +NLP.description=Please read the following license agreement carefully. + +NLP.license.description=JUnit is a Java unit testing framework +NLP.accept.rbutton.text=I &accept the terms in the license agreement. Install JUnit +NLP.deny.rbutton.text=&Do not install JUnit +NLP.error.cannot.get.logic=Could not access configuration logic + +NLP.append.license.format=-------------------------------------------------\n{0}:\n\n{1}\n\n +#NOI18N +NLP.license.format={0} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbCustomizeSelectionDialog.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbCustomizeSelectionDialog.java new file mode 100644 index 000000000000..f049006cc038 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbCustomizeSelectionDialog.java @@ -0,0 +1,949 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.wizard.components.panels.netbeans; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import javax.accessibility.AccessibleContext; +import javax.swing.AbstractAction; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JList; +import javax.swing.JRootPane; +import javax.swing.KeyStroke; +import javax.swing.ListCellRenderer; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; +import javax.swing.UIManager; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.ListDataEvent; +import javax.swing.event.ListDataListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.RegistryNode; +import org.netbeans.installer.product.RegistryType; +import org.netbeans.installer.product.components.Group; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.product.components.StatusInterface; +import org.netbeans.installer.product.dependencies.Conflict; +import org.netbeans.installer.product.dependencies.Requirement; +import org.netbeans.installer.utils.ErrorManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.UiUtils; +import org.netbeans.installer.utils.helper.Dependency; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.swing.NbiButton; +import org.netbeans.installer.utils.helper.swing.NbiCheckBox; +import org.netbeans.installer.utils.helper.swing.NbiDialog; +import org.netbeans.installer.utils.helper.swing.NbiFrame; +import org.netbeans.installer.utils.helper.swing.NbiLabel; +import org.netbeans.installer.utils.helper.swing.NbiList; +import org.netbeans.installer.utils.helper.swing.NbiPanel; +import org.netbeans.installer.utils.helper.swing.NbiScrollPane; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import static org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi.EMPTY_ICON; +import static org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi.ERROR_ICON; +import static org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi.WARNING_ICON; + + +/** + * + + */ +public class NbCustomizeSelectionDialog extends NbiDialog { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private final NbWelcomePanel panel; + private final Runnable callback; + + private final List registryNodes; + + private NbiLabel messageLabel; + + private NbiList componentsList; + private NbiScrollPane componentsScrollPane; + + private NbiTextPane descriptionPane; + private NbiScrollPane descriptionScrollPane; + + private NbiPanel componentPanel; + + private NbiLabel sizesLabel; + + private NbiLabel errorLabel; + + private NbiButton okButton; + private NbiButton cancelButton; + + private NbiPanel buttonsPanel; + + private final Icon errorIcon; + private final Icon warningIcon; + private final Icon emptyIcon; + + public NbCustomizeSelectionDialog( + final NbiFrame parent, + final NbWelcomePanel panel, + final Runnable callback, + final List registryNodes) { + super(parent); + this.panel = panel; + this.callback = callback; + this.registryNodes = registryNodes; + + errorIcon = new ImageIcon( + getClass().getClassLoader().getResource(ERROR_ICON)); + warningIcon = new ImageIcon( + getClass().getClassLoader().getResource(WARNING_ICON)); + emptyIcon = new ImageIcon( + getClass().getClassLoader().getResource(EMPTY_ICON)); + + setDefaultMinimumSize(); + initComponents(); + } + + private void setDefaultMinimumSize(){ + switch (UiUtils.getLAF()) { + case WINDOWS_CLASSIC : + case WINDOWS_XP : + setMinimumSize(new Dimension(560, 420 + EXTRA_SIZE)); + break; + case GTK: + setMinimumSize(new Dimension(660, 500 + EXTRA_SIZE)); + break; + case AQUA: + setMinimumSize(new Dimension(550,410 + EXTRA_SIZE)); + break; + case MOTIF: + case METAL: + setMinimumSize(new Dimension(620,460 + EXTRA_SIZE)); + break; + default: + setMinimumSize(new Dimension(560,420 + EXTRA_SIZE)); + break; + } + } + + @Override + public void setVisible(boolean visible) { + if (visible) { + initialize(); + } + + super.setVisible(visible); + } + + // private ////////////////////////////////////////////////////////////////////// + private void initComponents() { + //workaround with minimum size for JDK5 + addComponentListener(new ComponentAdapter() { + @Override + public void componentResized(ComponentEvent e) { + setSize(Math.max(getSize().width, getMinimumSize().width), + Math.max(getSize().height, getMinimumSize().height)); + } + }); + // messageLabel ///////////////////////////////////////////////////////////// + messageLabel = new NbiLabel(); + + // componentsTree /////////////////////////////////////////////////////////// + componentsList = new NbiList(); + componentsList.setCellRenderer( + new ComponentsListCellRenderer()); + componentsList.setBorder( + new EmptyBorder(5, 5, 5, 5)); + componentsList.getSelectionModel().setSelectionMode( + ListSelectionModel.SINGLE_SELECTION); + componentsList.getSelectionModel().addListSelectionListener( + new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent event) { + updateDescription(); + } + }); + componentsList.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent event) { + int index = componentsList.locationToIndex(event.getPoint()); + if (index != -1) { + final MouseEvent newEvent = new MouseEvent( + (Component) event.getSource(), + event.getID(), + event.getWhen(), + event.getModifiers(), + event.getX() - componentsList.indexToLocation(index).x, + event.getY() - componentsList.indexToLocation(index).y, + event.getClickCount(), + event.isPopupTrigger(), + event.getButton()); + + componentsList.getCellRenderer().getListCellRendererComponent( + componentsList, + componentsList.getModel().getElementAt(index), + index, + true, + true).dispatchEvent(newEvent); + } + } + }); + componentsList.getActionMap().put( + KEYBOARD_TOGGLE_ACTION_NAME, + new AbstractAction(KEYBOARD_TOGGLE_ACTION_NAME) { + @Override + public void actionPerformed(ActionEvent event) { + ComponentsListModel model = + (ComponentsListModel) componentsList.getModel(); + + model.toggleSelection(componentsList.getSelectedIndex()); + } + }); + componentsList.getInputMap().put( + KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, false), + KEYBOARD_TOGGLE_ACTION_NAME); + + // componentsScrollPane ///////////////////////////////////////////////////// + componentsScrollPane = new NbiScrollPane(componentsList); + componentsScrollPane.setVerticalScrollBarPolicy( + NbiScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + + messageLabel.setLabelFor(componentsScrollPane); + + // descriptionPane ////////////////////////////////////////////////////////// + descriptionPane = new NbiTextPane(); + descriptionPane.setBorder( + new EmptyBorder(5, 5, 5, 5)); + + // descriptionScrollPane //////////////////////////////////////////////////// + descriptionScrollPane = new NbiScrollPane(descriptionPane); + descriptionScrollPane.setVerticalScrollBarPolicy( + NbiScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + descriptionScrollPane.setBorder( + new TitledBorder(FEATURE_DESCRIPTION_TITLE)); + descriptionScrollPane.setPreferredSize(new Dimension(200, 10)); + + // componentPanel /////////////////////////////////////////////////////////// + componentPanel = new NbiPanel(); + componentPanel.setLayout(new BorderLayout(6, 0)); + componentPanel.add(componentsScrollPane, BorderLayout.CENTER); + componentPanel.add(descriptionScrollPane, BorderLayout.EAST); + + // sizesLabel /////////////////////////////////////////////////////////////// + sizesLabel = new NbiLabel(); + //sizesLabel.setFocusable(true); + + // errorMessageLabel //////////////////////////////////////////////////////// + errorLabel = new NbiLabel(); + + // okButton ///////////////////////////////////////////////////////////////// + okButton = new NbiButton(); + okButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent event) { + okButtonPressed(); + } + }); + + // cancelButton ///////////////////////////////////////////////////////////// + cancelButton = new NbiButton(); + cancelButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent event) { + cancelButtonPressed(); + } + }); + + // buttonsPanel ///////////////////////////////////////////////////////////// + buttonsPanel = new NbiPanel(); + buttonsPanel.add(okButton, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_END, // anchor + GridBagConstraints.NONE, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ???) + buttonsPanel.add(cancelButton, new GridBagConstraints( + 1, 0, // x, y + 1, 1, // width, height + 0.0, 0.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.NONE, // fill + new Insets(0, 6, 0, 0), // padding + 0, 0)); // padx, pady - ???) + + // getContentPane() ///////////////////////////////////////////////////////// + getContentPane().add(messageLabel, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.BOTH, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + getContentPane().add(componentPanel, new GridBagConstraints( + 0, 1, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(6, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + getContentPane().add(sizesLabel, new GridBagConstraints( + 0, 2, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(6, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + getContentPane().add(errorLabel, new GridBagConstraints( + 0, 3, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + getContentPane().add(buttonsPanel, new GridBagConstraints( + 0, 4, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(11, 11, 11, 11), // padding + 0, 0)); // padx, pady - ??? + + // this ///////////////////////////////////////////////////////////////////// + setTitle(panel.getProperty(NbWelcomePanel.CUSTOMIZE_TITLE_PROPERTY)); + setModal(true); + setDefaultCloseOperation(NbiDialog.DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + cancelButtonPressed(); + } + }); + getRootPane().setDefaultButton(okButton); + getRootPane().getInputMap(JRootPane.WHEN_IN_FOCUSED_WINDOW).put( + KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true), + CANCEL_ACTION_NAME); + getRootPane().getActionMap().put(CANCEL_ACTION_NAME, new AbstractAction(){ + @Override + public void actionPerformed(ActionEvent e) { + cancelButtonPressed(); + } + }); + + // l&f-specific tweaks ////////////////////////////////////////////////////// + if (UIManager.getLookAndFeel().getID().equals("GTK")) { + descriptionPane.setOpaque(true); + } + } + + private void initialize() { + if (!isThereAnythingVisibleToInstall()) { + messageLabel.setText(panel.getProperty(NbWelcomePanel.MESSAGE_UNINSTALL_PROPERTY)); + } else if (!isThereAnythingVisibleToUninstall()) { + messageLabel.setText(panel.getProperty(NbWelcomePanel.MESSAGE_INSTALL_PROPERTY)); + } else { + messageLabel.setText(panel.getProperty(NbWelcomePanel.MESSAGE_INSTALL_PROPERTY)); + } + + componentsList.setModel( + new ComponentsListModel(registryNodes)); + + descriptionPane.setContentType( + panel.getProperty(NbWelcomePanel.COMPONENT_DESCRIPTION_CONTENT_TYPE_PROPERTY)); + + if (!isThereAnythingVisibleToInstall()) { + sizesLabel.setVisible(false); + } + + updateDescription(); + updateSizes(); + updateErrorMessage(); + + okButton.setText(panel.getProperty(NbWelcomePanel.OK_BUTTON_TEXT_PROPERTY)); + cancelButton.setText(panel.getProperty(NbWelcomePanel.CANCEL_BUTTON_TEXT_PROPERTY)); + + componentsList.setVisibleRowCount(componentsList.getModel().getSize()); + componentsList.getUI().getPreferredSize(componentsList); + componentsScrollPane.getViewport().setPreferredSize( + componentsList.getPreferredScrollableViewportSize()); + pack(); + final Dimension currentSize = getSize(); + final Dimension minimumSize = getMinimumSize(); + setPreferredSize(new Dimension( + (minimumSize.width > currentSize.width? + minimumSize.width : currentSize.width), + (minimumSize.height > currentSize.height? + minimumSize.height : currentSize.height))); + pack(); + } + + private void updateDescription() { + final RegistryNode node = (RegistryNode) componentsList.getSelectedValue(); + + if (node != null) { + descriptionPane.setText(node.getDescription()); + } else { + descriptionPane.setText(panel.getProperty( + NbWelcomePanel.DEFAULT_COMPONENT_DESCRIPTION_PROPERTY)); + } + + descriptionPane.setCaretPosition(0); + } + + private void updateSizes() { + final Registry registry = Registry.getInstance(); + + long installationSize = 0; + long downloadSize = 0; + for (Product product: registry.getProductsToInstall()) { + installationSize += product.getRequiredDiskSpace(); + downloadSize += product.getDownloadSize(); + } + + String template = panel.getProperty(NbWelcomePanel.SIZES_LABEL_TEXT_NO_DOWNLOAD_PROPERTY); + for (RegistryNode remoteNode: registry.getNodes(RegistryType.REMOTE)) { + if (remoteNode.isVisible()) { + template = panel.getProperty(NbWelcomePanel.SIZES_LABEL_TEXT_PROPERTY); + } + } + + if (installationSize == 0) { + sizesLabel.setText(StringUtils.format( + template, + panel.getProperty(NbWelcomePanel.DEFAULT_INSTALLATION_SIZE_PROPERTY), + panel.getProperty(NbWelcomePanel.DEFAULT_DOWNLOAD_SIZE_PROPERTY))); + } else { + sizesLabel.setText(StringUtils.format( + template, + StringUtils.formatSize(installationSize), + StringUtils.formatSize(downloadSize))); + } + } + + private String validateInput() { + final Registry registry = Registry.getInstance(); + + final List toInstall = + registry.getProducts(Status.TO_BE_INSTALLED); + final List toUninstall = + registry.getProducts(Status.TO_BE_UNINSTALLED); + + if ((toInstall.isEmpty()) && (toUninstall.isEmpty())) { + if (isThereAnythingVisibleToInstall() && + Boolean.getBoolean(Registry.SUGGEST_INSTALL_PROPERTY)) { + return isVisibleNetBeansInstalled()? + panel.getProperty(NbWelcomePanel.ERROR_NO_RUNTIMES_INSTALL_ONLY_PROPERTY): + panel.getProperty(NbWelcomePanel.ERROR_NO_CHANGES_INSTALL_ONLY_PROPERTY); + } + if (isThereAnythingVisibleToUninstall() && + Boolean.getBoolean(Registry.SUGGEST_UNINSTALL_PROPERTY)) { + return panel.getProperty(NbWelcomePanel.ERROR_NO_CHANGES_UNINSTALL_ONLY_PROPERTY); + } + return panel.getProperty(NbWelcomePanel.ERROR_NO_CHANGES_INSTALL_ONLY_PROPERTY); + } + + for (Product product: toInstall) { + for (Dependency requirement: product.getDependencies(Requirement.class)) { + List requirees = registry.getProducts(requirement); + + boolean satisfied = false; + + for (Product requiree: requirees) { + if ((requiree.getStatus() == Status.TO_BE_INSTALLED) || + (requiree.getStatus() == Status.INSTALLED)) { + satisfied = true; + break; + } + } + + if (!satisfied) { + return StringUtils.format( + panel.getProperty(NbWelcomePanel.ERROR_REQUIREMENT_INSTALL_PROPERTY), + getProductNameByGroup(product), + getProductNameByGroup(requirees.get(0))); + } + } + + for (Dependency conflict: product.getDependencies(Conflict.class)) { + List conflictees = registry.getProducts(conflict); + + boolean satisfied = true; + Product unsatisfiedConflict = null; + + for (Product conflictee: conflictees) { + if ((conflictee.getStatus() == Status.TO_BE_INSTALLED) || + (conflictee.getStatus() == Status.INSTALLED)) { + satisfied = false; + unsatisfiedConflict = conflictee; + break; + } + } + + if (!satisfied) { + return StringUtils.format( + panel.getProperty(NbWelcomePanel.ERROR_CONFLICT_INSTALL_PROPERTY), + getProductNameByGroup(product), + getProductNameByGroup(unsatisfiedConflict)); + } + } + } + + for (Product product: toUninstall) { + for (Product dependent: registry.getProducts()) { + if ((dependent.getStatus() == Status.TO_BE_UNINSTALLED) || + (dependent.getStatus() == Status.NOT_INSTALLED)) { + continue; + } + + for (Dependency requirement: dependent.getDependencies(Requirement.class)) { + final List requirees = registry.getProducts(requirement); + + if (requirees.contains(product)) { + boolean satisfied = false; + for (Product requiree: requirees) { + if (requiree.getStatus() == Status.INSTALLED) { + satisfied = true; + break; + } + } + + if (!satisfied) { + return StringUtils.format( + panel.getProperty(NbWelcomePanel.ERROR_REQUIREMENT_UNINSTALL_PROPERTY), + product.getDisplayName(), + dependent.getDisplayName()); + } + } + } + } + } + + return null; + } + private String getProductNameByGroup(Product product) { + return (product.getParent().getUid().equals(NB_IDE_GROUP_UID))? + product.getParent().getDisplayName() : product.getDisplayName(); + } + + private void updateErrorMessage() { + final String errorMessage = validateInput(); + + if (errorMessage == null) { + final String warningMessage = panel.getWarningMessage(); + if(warningMessage!=null) { + errorLabel.setIcon(warningIcon); + errorLabel.setText(warningMessage); + } else { + errorLabel.setIcon(emptyIcon); + errorLabel.clearText(); + } + okButton.setEnabled(true); + } else { + errorLabel.setIcon(errorIcon); + errorLabel.setText(errorMessage); + okButton.setEnabled(false); + } + } + + private void okButtonPressed() { + final String errorMessage = validateInput(); + + if (errorMessage != null) { + ErrorManager.notifyError(errorMessage); + } else { + setVisible(false); + callback.run(); + } + } + + private void cancelButtonPressed() { + final ComponentsListModel model = + (ComponentsListModel) componentsList.getModel(); + + model.cancelChanges(); + setVisible(false); + } + + private boolean isThereAnythingVisibleToInstall() { + final Registry registry = Registry.getInstance(); + + final List toInstall = new LinkedList(); + toInstall.addAll(registry.getProducts(Status.NOT_INSTALLED)); + toInstall.addAll(registry.getProducts(Status.TO_BE_INSTALLED)); + + for (Product product: toInstall) { + if (product.isVisible()) { + return true; + } + } + + return false; + } + + private boolean isThereAnythingVisibleToUninstall() { + final Registry registry = Registry.getInstance(); + + final List toUninstall = new LinkedList(); + toUninstall.addAll(registry.getProducts(Status.INSTALLED)); + toUninstall.addAll(registry.getProducts(Status.TO_BE_UNINSTALLED)); + + for (Product product: toUninstall) { + if (product.isVisible()) { + return true; + } + } + + return false; + } + + private boolean isVisibleNetBeansInstalled() { + final Registry registry = Registry.getInstance(); + + final List toInstall = new LinkedList(); + toInstall.addAll(registry.getProducts(Status.NOT_INSTALLED)); + toInstall.addAll(registry.getProducts(Status.TO_BE_INSTALLED)); + + for (Product product: toInstall) { + if (product.getUid().startsWith("nb-") && product.isVisible()) { + return false; + } + } + return true; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public class ComponentsListModel implements ListModel { + private final List registryNodes; + private final Map initialStatuses; + private final List listeners; + + public ComponentsListModel(List registryNodes) { + this.registryNodes = registryNodes; + + initialStatuses = new HashMap(); + listeners = new LinkedList(); + + for (RegistryNode node: registryNodes) { + if (node instanceof Product) { + final Product product = (Product) node; + + initialStatuses.put(product, product.getStatus()); + } + } + } + + @Override + public int getSize() { + return registryNodes.size(); + } + + @Override + public Object getElementAt(int index) { + return registryNodes.get(index); + } + + @Override + public void addListDataListener(ListDataListener listener) { + synchronized (listeners) { + listeners.add(listener); + } + } + + @Override + public void removeListDataListener(ListDataListener listener) { + synchronized (listeners) { + listeners.remove(listener); + } + } + + public void toggleSelection(int index) { + if ((index < 0) || (index >= registryNodes.size())) { + // just return - do not generate an error as this situation can + // easily arise under valid circumstances + return; + } + RegistryNode node = registryNodes.get(index); + if (node instanceof StatusInterface) { + StatusInterface product = (StatusInterface) node; + switch (product.getStatus()) { + case INSTALLED: + break; + case TO_BE_UNINSTALLED: + break; + case NOT_INSTALLED: + product.setStatus(Status.TO_BE_INSTALLED); + break; + case TO_BE_INSTALLED: + product.setStatus(Status.NOT_INSTALLED); + break; + } + + fireRowChanged(index); + updateSizes(); + updateErrorMessage(); + } + } + + private void fireRowChanged(int index) { + final ListDataListener[] clone; + synchronized (listeners) { + clone = listeners.toArray(new ListDataListener[listeners.size()]); + } + + final ListDataEvent event = new ListDataEvent( + this, + ListDataEvent.CONTENTS_CHANGED, + index, + index); + + for (ListDataListener listener: clone) { + listener.contentsChanged(event); + } + } + + public void cancelChanges() { + for (RegistryNode node: registryNodes) { + if (node instanceof Product) { + final Product product = (Product) node; + + product.setStatus(initialStatuses.get(product)); + } + } + } + } + + public class ComponentsListCellRenderer implements ListCellRenderer { + private RegistryNodePanel panel; + private NbiCheckBox checkBox; + private NbiLabel titleLabel; + + private int currentIndex = -1; + + public ComponentsListCellRenderer() { + initComponents(); + } + + @Override + public Component getListCellRendererComponent( + JList list, + Object value, + int index, + boolean selected, + boolean focus) { + currentIndex = index; + + if (selected) { + titleLabel.setOpaque(true); + + titleLabel.setForeground(list.getSelectionForeground()); + titleLabel.setBackground(list.getSelectionBackground()); + } else { + titleLabel.setOpaque(false); + + titleLabel.setForeground(list.getForeground()); + titleLabel.setBackground(list.getBackground()); + } + + if (value instanceof RegistryNode) { + final RegistryNode node = (RegistryNode) value; + + final String title = + " " + node.getDisplayName() + " "; + final String tooltip = title; + titleLabel.setText(title); + titleLabel.setToolTipText(tooltip); + + if((node instanceof Product) || + (node.getUid().equals(NB_IDE_GROUP_UID))) { + titleLabel.setFont(titleLabel.getFont().deriveFont(Font.PLAIN)); + checkBox.setVisible(true); + checkBox.setToolTipText(tooltip); + switch (((StatusInterface)value).getStatus()) { + case INSTALLED: + titleLabel.setText(StringUtils.format( + LIST_INSTALLED_PRODUCT_TEXT, titleLabel.getText())); + checkBox.setSelected(true); + checkBox.setEnabled(false); + break; + case INSTALLED_DIFFERENT_BUILD: + titleLabel.setText(StringUtils.format( + LIST_INSTALLED_DIFFERENT_BUILD_PRODUCT_TEXT, titleLabel.getText())); + checkBox.setSelected(false); + checkBox.setEnabled(false); + break; + case TO_BE_INSTALLED: + checkBox.setSelected(true); + checkBox.setEnabled(true); + break; + default: + checkBox.setSelected(false); + checkBox.setEnabled(true); + } + } else if (node instanceof Group) { + titleLabel.setText(title); + titleLabel.setToolTipText(tooltip); + titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD)); + checkBox.setVisible(false); + } + } + + titleLabel.setPreferredSize(titleLabel.getMinimumSize()); + + // l&f-specific tweaks + if (UIManager.getLookAndFeel().getID().equals("GTK")) { + panel.setOpaque(false); + } + + return panel; + } + + // private ////////////////////////////////////////////////////////////////// + private void initComponents() { + // panel //////////////////////////////////////////////////////////////// + panel = new RegistryNodePanel(); + panel.setLayout(new GridBagLayout()); + panel.setOpaque(false); + panel.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent event) { + if (checkBox.isVisible() && + checkBox.getBounds().contains(event.getPoint())) { + ComponentsListModel model = + (ComponentsListModel) componentsList.getModel(); + + model.toggleSelection(currentIndex); + } + } + + }); + + // checkBox ///////////////////////////////////////////////////////////// + checkBox = new NbiCheckBox(); + checkBox.setOpaque(false); + + final Dimension preferredSize = checkBox.getPreferredSize(); + preferredSize.height = preferredSize.height - 2; + preferredSize.width = preferredSize.width - 2; + + checkBox.setPreferredSize(preferredSize); + + // titleLabel /////////////////////////////////////////////////////////// + titleLabel = new NbiLabel(); + titleLabel.setFocusable(false); + titleLabel.setPreferredSize(preferredSize); + + panel.setCheckBox(checkBox); + panel.setTitleLabel(titleLabel); + + // panel //////////////////////////////////////////////////////////////// + panel.add(checkBox, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 0.0, 0.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ???); + panel.add(titleLabel, new GridBagConstraints( + 1, 0, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ???); + } + } + + private class RegistryNodePanel extends NbiPanel { + + private NbiCheckBox checkBox; + private NbiLabel titleLabel; + + public void setCheckBox(NbiCheckBox checkBox) { + this.checkBox = checkBox; + } + + public void setTitleLabel(NbiLabel titleLabel) { + this.titleLabel = titleLabel; + } + + @Override + public AccessibleContext getAccessibleContext() { + if (checkBox != null && checkBox.isVisible()) { + return checkBox.getAccessibleContext(); + } else if (titleLabel != null) { + return titleLabel.getAccessibleContext(); + } else { + return super.getAccessibleContext(); + } + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String KEYBOARD_TOGGLE_ACTION_NAME = + "checkbox.update"; // NOI18N + + public static final String FEATURE_DESCRIPTION_TITLE = + ResourceUtils.getString(NbCustomizeSelectionDialog.class, + "NCSD.feature.description.title"); // NOI18N + public static final String CUSTOMIZE_DIALOG_WIDTH_PROPERTY = + "NCSD.dialog.width"; + public static final String CUSTOMIZE_DIALOG_HEIGHT_PROPERTY = + "NCSD.dialog.height"; + public static final String LIST_INSTALLED_PRODUCT_TEXT = + ResourceUtils.getString(NbCustomizeSelectionDialog.class, + "NCSD.list.product.installed");//NOI18N + public static final String LIST_INSTALLED_DIFFERENT_BUILD_PRODUCT_TEXT = + ResourceUtils.getString(NbCustomizeSelectionDialog.class, + "NCSD.list.product.different.build.installed");//NOI18N + private static final String CANCEL_ACTION_NAME = + "evaluate.cancel"; // NOI18N + private static final String NB_IDE_GROUP_UID = + "nb-ide-group";//NOI18N + private static final int EXTRA_SIZE = 15; +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbJUnitLicensePanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbJUnitLicensePanel.java new file mode 100644 index 000000000000..f1c9b7ba6544 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbJUnitLicensePanel.java @@ -0,0 +1,369 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.wizard.components.panels.netbeans; + +import java.awt.Color; +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.util.List; +import javax.swing.BoundedRangeModel; +import javax.swing.ButtonGroup; +import javax.swing.JComponent; +import javax.swing.JScrollBar; +import javax.swing.border.EmptyBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.helper.swing.NbiScrollPane; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.helper.swing.NbiRadioButton; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; +import org.netbeans.installer.wizard.components.WizardPanel; +import org.netbeans.installer.wizard.components.WizardPanel.WizardPanelSwingUi; +import org.netbeans.installer.wizard.components.WizardPanel.WizardPanelUi; +import org.netbeans.installer.wizard.containers.SwingContainer; + +public class NbJUnitLicensePanel extends WizardPanel { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + + public NbJUnitLicensePanel() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + setProperty(LICENSE_DESCRIPTION_PROPERTY, + DEFAULT_LICENSE_DESCRIPTION); + setProperty(ACCEPT_RBUTTON_TEXT_PROPERTY, + DEFAULT_ACCEPT_RBUTTON_TEXT); + setProperty(DENY_RBUTTON_TEXT_PROPERTY, + DEFAULT_DENY_RBUTTON_TEXT); + setProperty(ERROR_CANNOT_GET_LOGIC_PROPERTY, + DEFAULT_ERROR_CANNOT_GET_LOGIC); + setProperty(LICENSE_FORMAT_PROPERTY, + DEFAULT_LICENSE_FORMAT); + } + + @Override + public boolean canExecuteForward() { + if(System.getProperty(JUNIT_LICENSE_RESOURCE_PROPERTY)!= null) { + List products = Registry.getInstance().getProductsToInstall(); + for (Product p : products) { + if(p.getUid().equals(NB_JAVASE_UID)) { + return true; + } + } + } + return false; + } + + @Override + public boolean canExecuteBackward() { + return canExecuteForward(); + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new LicensesPanelUi(this); + } + + return wizardUi; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class LicensesPanelUi extends WizardPanelUi { + protected NbJUnitLicensePanel component; + + public LicensesPanelUi(NbJUnitLicensePanel component) { + super(component); + + this.component = component; + } + + @Override + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new LicensesPanelSwingUi(component, container); + } + + return super.getSwingUi(container); + } + } + + public static class LicensesPanelSwingUi extends WizardPanelSwingUi { + + private NbiTextPane licensePane; + private NbiScrollPane licenseScrollPane; + private NbiTextPane descriptionPane; + + private NbiRadioButton acceptRButton; + private NbiRadioButton denyRButton; + + private Product javaseProduct; + + public LicensesPanelSwingUi( + final NbJUnitLicensePanel component, + final SwingContainer container) { + super(component, container); + + this.component = component; + + initComponents(); + } + + @Override + public JComponent getDefaultFocusOwner() { + return acceptRButton; + } + + // protected //////////////////////////////////////////////////////////////// + @Override + protected void initialize() { + acceptRButton.setText( + component.getProperty(ACCEPT_RBUTTON_TEXT_PROPERTY)); + + denyRButton.setText( + component.getProperty(DENY_RBUTTON_TEXT_PROPERTY)); + descriptionPane.setText(component.getProperty(LICENSE_DESCRIPTION_PROPERTY)); + + final StringBuilder text = new StringBuilder(); + + if(System.getProperty(JUNIT_LICENSE_RESOURCE_PROPERTY)!=null) { + + final String licenseValue = SystemUtils.resolveString( + System.getProperty(JUNIT_LICENSE_RESOURCE_PROPERTY)); + final String license = SystemUtils.resolveString("$R{" + licenseValue + ";" + StringUtils.ENCODING_UTF8 + "}"); + final String format = component.getProperty(LICENSE_FORMAT_PROPERTY); + if(license!=null) { + text.append(StringUtils.format(format, license)); + } + } + if(System.getProperty(JUNIT_LICENSE_CONTENT_TYPE_PROPERTY)!=null) { + licensePane.setContentType(System.getProperty( + JUNIT_LICENSE_CONTENT_TYPE_PROPERTY)); + } + + licensePane.setText(text); + licensePane.setCaretPosition(0); + licensePane.requestFocus(); + + licensePane.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + final int code = e.getKeyCode(); + if (code == KeyEvent.VK_SPACE || code == KeyEvent.VK_ENTER) { + BoundedRangeModel brm = licenseScrollPane.getVerticalScrollBar().getModel(); + brm.setValue(brm.getValue() + brm.getExtent()); + } else if (code == KeyEvent.VK_Q) { + container.getCancelButton().doClick(); + } else if (code == KeyEvent.VK_N ) { + if (denyRButton.isEnabled()) { + denyRButton.setSelected(true); + denyRButtonToggled(); + } + } else if (code == KeyEvent.VK_A || code == KeyEvent.VK_Y) { + if (acceptRButton.isEnabled()) { + acceptRButton.setSelected(true); + acceptRButtonToggled(); + } + } + } + }); + + if (System.getProperty(JUNIT_LICENSE_SCROLLING_REQUIRED) != null) { + licenseScrollPane.getVerticalScrollBar().getModel().addChangeListener(new ChangeListener() { + + public void stateChanged(ChangeEvent e) { + JScrollBar vsb = licenseScrollPane.getVerticalScrollBar(); + if (vsb.getValue() >= vsb.getMaximum() - vsb.getModel().getExtent()) { + acceptRButton.setEnabled(true); + } + } + }); + acceptRButton.setEnabled(false); + } + if(!acceptRButton.isSelected() && !denyRButton.isSelected()) { + container.getNextButton().setEnabled(false); + } + } + + // private ////////////////////////////////////////////////////////////////// + private void initComponents() { + List products = Registry.getInstance().getProductsToInstall(); + for (Product p : products) { + if(p.getUid().equals(NB_JAVASE_UID) ) { + javaseProduct = p; + } + } + + // licensePane ////////////////////////////////////////////////////////// + licensePane = new NbiTextPane(); + licensePane.setOpaque(true); + licensePane.setBackground(Color.WHITE); + licensePane.setBorder(new EmptyBorder(new Insets(5, 5, 5, 5))); + licensePane.setFocusable(true); + + //descriptionPane /////////////////// + descriptionPane = new NbiTextPane(); + + // licenseScrollPane //////////////////////////////////////////////////// + licenseScrollPane = new NbiScrollPane(licensePane); + + ActionListener rbuttonListener = new ActionListener() { + public void actionPerformed(ActionEvent event) { + if(event.getActionCommand().equals("accept")) { + acceptRButtonToggled(); + } else + if (event.getActionCommand().equals("deny")) { + denyRButtonToggled(); + } + } + }; + // acceptRButton /////////////////////////////////////////////////////// + acceptRButton = new NbiRadioButton(); + acceptRButton.setSelected(false); + acceptRButton.setFocusable(true); + acceptRButton.setActionCommand("accept"); + acceptRButton.addActionListener(rbuttonListener); + + // denyRButton /////////////////////////////////////////////////////// + denyRButton = new NbiRadioButton(); + denyRButton.setSelected(false); + denyRButton.setActionCommand("deny"); + denyRButton.addActionListener(rbuttonListener); + + ButtonGroup rbuttonGroup = new ButtonGroup(); + rbuttonGroup.add(acceptRButton); + rbuttonGroup.add(denyRButton); + + + // this ///////////////////////////////////////////////////////////////// + add(licenseScrollPane, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.BOTH, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + add(descriptionPane, new GridBagConstraints( + 0, 2, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(7, 11, 2, 11), // padding + 0, 0)); + add(acceptRButton, new GridBagConstraints( + 0, 3, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(2, 11, 2, 11), // padding + 0, 0)); // padx, pady - ??? + add(denyRButton, new GridBagConstraints( + 0, 4, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(2, 11, 11, 11), // padding + 0, 0)); // padx, pady - ??? + } + + private void acceptRButtonToggled() { + if (acceptRButton.isSelected()) { + setJUnitAcceptedProperty(true); + container.getNextButton().setEnabled(true); + } + } + private void denyRButtonToggled() { + if (denyRButton.isSelected()) { + setJUnitAcceptedProperty(false); + container.getNextButton().setEnabled(true); + } + } + private void setJUnitAcceptedProperty(boolean value) { + javaseProduct.setProperty(JUNIT_ACCEPTED_PROPERTY, Boolean.toString(value)); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String ACCEPT_RBUTTON_TEXT_PROPERTY = + "accept.rbutton.text"; // NOI18N + public static final String DENY_RBUTTON_TEXT_PROPERTY = + "deny.rbutton.text"; // NOI18N + public static final String LICENSE_DESCRIPTION_PROPERTY = + "license.description"; // NOI18N + public static final String ERROR_CANNOT_GET_LOGIC_PROPERTY = + "error.cannot.get.logic";//NOI18N + public static final String JUNIT_LICENSE_RESOURCE_PROPERTY = + "nbi.junit.license.resource";//NOI18N + public static final String JUNIT_LICENSE_CONTENT_TYPE_PROPERTY = + "nbi.junit.license.content.type";//NOI18N + public static final String LICENSE_FORMAT_PROPERTY = + "license.format";//NOI18N + public static final String JUNIT_ACCEPTED_PROPERTY = + "junit.accepted";//NOI18N + private static final String JUNIT_LICENSE_SCROLLING_REQUIRED = + "nbi.junit.license.scrolling.required"; + public static final String DEFAULT_TITLE = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.description"); // NOI18N + public static final String DEFAULT_LICENSE_FORMAT = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.license.format"); // NOI18N + public static final String DEFAULT_APPEND_LICENSE_FORMAT = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.append.license.format"); // NOI18N + public static final String DEFAULT_LICENSE_DESCRIPTION = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.license.description"); // NOI18N + public static final String DEFAULT_ACCEPT_RBUTTON_TEXT = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.accept.rbutton.text"); // NOI18N + public static final String DEFAULT_DENY_RBUTTON_TEXT = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.deny.rbutton.text"); // NOI18N + public static final String DEFAULT_ERROR_CANNOT_GET_LOGIC = + ResourceUtils.getString(NbJUnitLicensePanel.class, + "NLP.error.cannot.get.logic"); // NOI18N + public static final String JUNIT_UID = + "junit"; // NOI18N + public static final String NB_JAVASE_UID = + "nb-javase"; // NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPostInstallSummaryPanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPostInstallSummaryPanel.java new file mode 100644 index 000000000000..b6fa654b4751 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPostInstallSummaryPanel.java @@ -0,0 +1,732 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.wizard.components.panels.netbeans; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.text.MessageFormat; +import java.util.LinkedList; +import java.util.List; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.BrowserUtils; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.helper.swing.NbiCheckBox; +import org.netbeans.installer.utils.helper.swing.NbiPanel; +import org.netbeans.installer.utils.helper.swing.NbiSeparator; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import org.netbeans.installer.wizard.components.WizardPanel; +import org.netbeans.installer.wizard.containers.SwingContainer; +import org.netbeans.installer.wizard.containers.SwingFrameContainer; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; +import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_SUCCESSFULLY; +import static org.netbeans.installer.utils.helper.DetailedStatus.INSTALLED_WITH_WARNINGS; +import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_INSTALL; +import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_SUCCESSFULLY; +import static org.netbeans.installer.utils.helper.DetailedStatus.UNINSTALLED_WITH_WARNINGS; +import static org.netbeans.installer.utils.helper.DetailedStatus.FAILED_TO_UNINSTALL; + +/** + * + */ +public class NbPostInstallSummaryPanel extends WizardPanel { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + public NbPostInstallSummaryPanel() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + setProperty(MESSAGE_TEXT_SUCCESS_PROPERTY, + DEFAULT_MESSAGE_TEXT_SUCCESS); + setProperty(MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS); + setProperty(MESSAGE_TEXT_WARNINGS_PROPERTY, + DEFAULT_MESSAGE_TEXT_WARNINGS); + setProperty(MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS); + setProperty(MESSAGE_TEXT_ERRORS_PROPERTY, + DEFAULT_MESSAGE_TEXT_ERRORS); + setProperty(MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS); + + setProperty(MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_TEXT_SUCCESS_UNINSTALL); + setProperty(MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL); + setProperty(MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_TEXT_WARNINGS_UNINSTALL); + setProperty(MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL); + setProperty(MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_TEXT_ERRORS_UNINSTALL); + setProperty(MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL); + setProperty(MESSAGE_FILES_REMAINING_PROPERTY, + DEFAULT_MESSAGE_FILES_REMAINING); + + setProperty(NEXT_BUTTON_TEXT_PROPERTY, + DEFAULT_NEXT_BUTTON_TEXT); + } + + @Override + public boolean isPointOfNoReturn() { + return true; + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new NbPostInstallSummaryPanelUi(this); + } + + return wizardUi; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class NbPostInstallSummaryPanelUi extends WizardPanelUi { + protected NbPostInstallSummaryPanel component; + + public NbPostInstallSummaryPanelUi(NbPostInstallSummaryPanel component) { + super(component); + + this.component = component; + } + + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new NbPostInstallSummaryPanelSwingUi(component, container); + } + + return super.getSwingUi(container); + } + } + + public static class NbPostInstallSummaryPanelSwingUi extends WizardPanelSwingUi { + protected NbPostInstallSummaryPanel component; + + private NbiTextPane messagePaneInstall; + private NbiTextPane messagePaneUninstall; + private NbiTextPane messagePaneRestart; + private NbiTextPane messagePaneNetBeans; + private NbiTextPane messagePaneRegistration; + private NbiCheckBox checkBoxRegistration; + private NbiPanel registrationPanel; + private NbiPanel spacer; + private NbiTextPane messagePaneMySQL; + + private NbiCheckBox metricsCheckbox; + private NbiTextPane metricsInfo; + private NbiTextPane metricsList; + private NbiPanel metricsPanel; + private NbiSeparator separator; + + public NbPostInstallSummaryPanelSwingUi( + final NbPostInstallSummaryPanel component, + final SwingContainer container) { + super(component, container); + + this.component = component; + + initComponents(); + } + + protected void initializeContainer() { + super.initializeContainer(); + + // set up the back button + container.getBackButton().setVisible(false); + container.getBackButton().setEnabled(false); + + // set up the next (or finish) button + container.getNextButton().setVisible(true); + container.getNextButton().setEnabled(true); + + container.getNextButton().setText( + component.getProperty(NEXT_BUTTON_TEXT_PROPERTY)); + + // set up the cancel button + container.getCancelButton().setVisible(false); + container.getCancelButton().setEnabled(false); + } + + @Override + public void evaluateNextButtonClick() { + container.getNextButton().setEnabled(false); + super.evaluateNextButtonClick(); + } + + protected void initialize() { + final Registry registry = Registry.getInstance(); + final List successfulInstall = registry.getProducts(INSTALLED_SUCCESSFULLY); + final List warningInstall = registry.getProducts(INSTALLED_WITH_WARNINGS); + final List errorInstall = registry.getProducts(FAILED_TO_INSTALL); + + final List successfulUninstall = registry.getProducts(UNINSTALLED_SUCCESSFULLY); + final List warningUninstall = registry.getProducts(UNINSTALLED_WITH_WARNINGS); + final List errorUninstall = registry.getProducts(FAILED_TO_UNINSTALL); + + if (errorInstall.size() > 0) { + messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY)); + messagePaneInstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_ERRORS_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(errorInstall))); + } else if (warningInstall.size() > 0) { + messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY)); + messagePaneInstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_WARNINGS_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(warningInstall))); + } else if (successfulInstall.size() > 0) { + messagePaneInstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY)); + messagePaneInstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_SUCCESS_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(successfulInstall))); + } else { + messagePaneInstall.setVisible(false); + } + + if (errorUninstall.size() > 0) { + messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY)); + messagePaneUninstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(errorUninstall))); + } else if (warningUninstall.size() > 0) { + messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY)); + messagePaneUninstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(warningUninstall))); + } else if (successfulUninstall.size() > 0) { + messagePaneUninstall.setContentType(component.getProperty(MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY)); + messagePaneUninstall.setText(StringUtils.format( + component.getProperty(MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY), + LogManager.getLogFile(), + StringUtils.asString(successfulUninstall))); + } else { + messagePaneUninstall.setVisible(false); + } + + final List products = new LinkedList(); + + products.addAll(successfulInstall); + products.addAll(warningInstall); + + messagePaneMySQL.setContentType(DEFAULT_MESSAGE_MYSQL_CONTENT_TYPE); + messagePaneMySQL.setText(""); + messagePaneMySQL.setVisible(false); + for (Product product : products) { + if (product.getUid().equals("mysql")) { + messagePaneMySQL.setText( + StringUtils.format(SystemUtils.isWindows() ? + DEFAULT_MYSQL_MESSAGE_WINDOWS : + DEFAULT_MYSQL_MESSAGE_UNIX, + product.getInstallationLocation())); + messagePaneMySQL.setVisible(true); + messagePaneMySQL.addHyperlinkListener(BrowserUtils.createHyperlinkListener()); + break; + } + } + + messagePaneRestart.setContentType(DEFAULT_MESSAGE_RESTART_CONTENT_TYPE); + messagePaneRestart.setText(""); + messagePaneRestart.setVisible(false); + for (Product product : products) { + if (product.getUid().equals("jdk")) { + final String restartRequired = product.getProperty(RESTART_IS_REQUIRED_PROPERTY); + LogManager.log("... restart is required property: " + restartRequired); + if(Boolean.parseBoolean(restartRequired)) { + messagePaneRestart.setText(DEFAULT_MESSAGE_RESTART_TEXT); + messagePaneRestart.setVisible(true); + } + break; + } + } + + messagePaneNetBeans.setContentType(DEFAULT_MESSAGE_NETBEANS_CONTENT_TYPE); + messagePaneNetBeans.setText(""); + boolean nbInstalled = false; + for (Product product: products) { + if (product.getUid().equals("nb-base") || product.getUid().equals("nb-all")) { + String platformSpecificSummary; + if (SystemUtils.isWindows()) { + platformSpecificSummary = DEFAULT_MESSAGE_NETBEANS_TEXT_WINDOWS; + } else if (SystemUtils.isMacOS()) { + platformSpecificSummary = DEFAULT_MESSAGE_NETBEANS_TEXT_MACOSX; + } else { + platformSpecificSummary = DEFAULT_MESSAGE_NETBEANS_TEXT_UNIX; + } + String netbeansSummary = product.getProperty(NETBEANS_SUMMARY_MESSAGE_TEXT_PROPERTY); + if (netbeansSummary == null) { + netbeansSummary = ""; + } + messagePaneNetBeans.setText(MessageFormat.format("{0}{1}", netbeansSummary, platformSpecificSummary)); // NOI18N + nbInstalled = true; + break; + } + } + // initialize registration components + List toRegister = new LinkedList(); + for (Product product : products) { + final String uid = product.getUid(); + if (uid.equals("nb-base") || uid.equals("jdk") || uid.equals("glassfish") || uid.equals("sjsas") || uid.equals("nb-all")) { + toRegister.add(product); + } + } + boolean registrationEnabled = + nbInstalled && // if NetBeans is among installed products + !toRegister.isEmpty() && // if anything to register + !SystemUtils.isMacOS() && // no support on mac + Boolean.getBoolean(ALLOW_SERVICETAG_REGISTRATION_PROPERTY) && //system property is defined + BrowserUtils.isBrowseSupported(); + + if (!registrationEnabled) { + //separator.setVisible(false); + //messagePaneRegistration.setVisible(false); + //checkBoxRegistration.setVisible(false); + //spacer.setVisible(false); + registrationPanel.setVisible(false); + checkBoxRegistration.setSelected(false); + System.setProperty(ALLOW_SERVICETAG_REGISTRATION_PROPERTY, "" + false); + } else { + String productsString = StringUtils.EMPTY_STRING; + for (Product product : toRegister) { + final String uid = product.getUid(); + String name = StringUtils.EMPTY_STRING; + if (uid.equals("nb-base") || uid.equals("nb-all")) { + name = DEFAULT_MESSAGE_REGISTRATION_NETBEANS; + } else if (uid.equals("jdk")) { + name = DEFAULT_MESSAGE_REGISTRATION_JDK; + } else if (uid.equals("glassfish")) { + name = DEFAULT_MESSAGE_REGISTRATION_GLASSFISH; + } else if (uid.equals("sjsas")) { + name = DEFAULT_MESSAGE_REGISTRATION_APPSERVER; + } + if (productsString.equals(StringUtils.EMPTY_STRING)) { + productsString = name; + } else { + productsString = StringUtils.format(DEFAULT_MESSAGE_REGISTRATION_CONCAT, productsString, name); + } + } + messagePaneRegistration.setContentType(DEFAULT_MESSAGE_REGISTRATION_CONTENT_TYPE); + messagePaneRegistration.setText(StringUtils.format(DEFAULT_MESSAGE_REGISTRATION_TEXT, productsString)); + checkBoxRegistration.setText(StringUtils.format(DEFAULT_MESSAGE_REGISTRATION_CHECKBOX, productsString)); + // be default - it is checked + checkBoxRegistration.doClick(); + // do not show message about starting the IDE and plugin manager in case of registration + messagePaneNetBeans.setVisible(false); + } + + /*if(nbInstalled) { + metricsList.setContentType(DEFAULT_MESSAGE_METRICS_LIST_CONTENT_TYPE); + metricsList.setText(DEFAULT_MESSAGE_METRICS_LIST); + metricsInfo.setContentType(DEFAULT_MESSAGE_METRICS_TEXT_CONTENT_TYPE); + metricsInfo.setText(DEFAULT_MESSAGE_METRICS_TEXT); + metricsCheckbox.setText(DEFAULT_MESSAGE_METRICS_CHECKBOX); + metricsCheckbox.doClick(); + } else {*/ + metricsPanel.setVisible(false); + //} + products.clear(); + + products.addAll(successfulUninstall); + products.addAll(warningUninstall); + + final List notCompletelyRemoved = new LinkedList(); + for (Product product: products) { + if (!FileUtils.isEmpty(product.getInstallationLocation())) { + notCompletelyRemoved.add(product); + } + } + + if (notCompletelyRemoved.size() > 0) { + final String text = messagePaneUninstall.getText(); + messagePaneUninstall.setText(text + StringUtils.format( + panel.getProperty(MESSAGE_FILES_REMAINING_PROPERTY), + StringUtils.asString(notCompletelyRemoved))); + } + } + + private void initComponents() { + // messagePaneInstall /////////////////////////////////////////////////// + messagePaneInstall = new NbiTextPane(); + + // messagePaneUninstall ///////////////////////////////////////////////// + messagePaneUninstall = new NbiTextPane(); + + // messagePaneRestart /////////////////////////////////////////////////// + messagePaneRestart = new NbiTextPane(); + + // messagePaneNetBeans /////////////////////////////////////////////////// + messagePaneNetBeans = new NbiTextPane(); + + + metricsPanel = new NbiPanel(); + + metricsCheckbox = new NbiCheckBox(); + + metricsList = new NbiTextPane(); + + metricsInfo = new NbiTextPane(); + + metricsCheckbox.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + System.setProperty(ENABLE_NETBEANS_METRICS_PROPERTY, + "" + metricsCheckbox.isSelected()); + } + }); + metricsInfo.addHyperlinkListener(BrowserUtils.createHyperlinkListener()); + + metricsPanel.add(metricsCheckbox, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + metricsPanel.add(metricsList, new GridBagConstraints( + 0, 1, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 7, 0, 11), // padding + 0, 0)); // padx, pady - ??? + metricsPanel.add(metricsInfo, new GridBagConstraints( + 0, 2, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 29, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + // messagePaneRegistration + messagePaneRegistration = new NbiTextPane(); + + //checkBoxRegistration + checkBoxRegistration = new NbiCheckBox(); + checkBoxRegistration.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) { + System.setProperty(ALLOW_SERVICETAG_REGISTRATION_PROPERTY, + "" + checkBoxRegistration.isSelected()); + } + }); + separator = new NbiSeparator(); + + registrationPanel = new NbiPanel(); + + registrationPanel.add(separator, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + registrationPanel.add(checkBoxRegistration, new GridBagConstraints( + 0, 1, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + registrationPanel.add(messagePaneRegistration, new GridBagConstraints( + 0, 2, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + // spacer + spacer = new NbiPanel(); + + messagePaneMySQL = new NbiTextPane(); + // this ///////////////////////////////////////////////////////////////// + add(messagePaneInstall, new GridBagConstraints( + 0, 0, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(messagePaneUninstall, new GridBagConstraints( + 0, 1, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.BOTH, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(messagePaneMySQL, new GridBagConstraints( + 0, 2, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + add(messagePaneRestart, new GridBagConstraints( + 0, 3, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + add(messagePaneNetBeans, new GridBagConstraints( + 0, 4, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + add(metricsPanel, new GridBagConstraints( + 0, 5, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 0, 0, 0), // padding + 0, 0)); + + + add(registrationPanel, new GridBagConstraints( + 0, 6, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 0, 0, 0), // padding + 0, 0)); + + add(spacer, new GridBagConstraints( + 0, 7, // x, y + 1, 1, // width, height + 1.0, 10.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ??? + + if (container instanceof SwingFrameContainer) { + final SwingFrameContainer sfc = (SwingFrameContainer) container; + sfc.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent event) { + SwingUi currentUi = component.getWizardUi().getSwingUi(container); + if (currentUi != null) { + if (!container.getCancelButton().isEnabled() && // cancel button is disabled + !container.getCancelButton().isVisible() && // no cancel button at this panel + !container.getBackButton().isVisible() && // no back button at this panel + container.getNextButton().isVisible() && // next button is visible + container.getNextButton().isEnabled()) { // and enabled + currentUi.evaluateNextButtonClick(); + sfc.removeWindowListener(this); + } + } + } + }); + } + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String MESSAGE_TEXT_SUCCESS_PROPERTY = + "message.text.success"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_SUCCESS_PROPERTY = + "message.content.type.success"; // NOI18N + public static final String MESSAGE_TEXT_WARNINGS_PROPERTY = + "message.text.warnings"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_WARNINGS_PROPERTY = + "message.content.type.warnings"; // NOI18N + public static final String MESSAGE_TEXT_ERRORS_PROPERTY = + "message.text.errors"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_ERRORS_PROPERTY = + "message.content.type.errors"; // NOI18N + public static final String MESSAGE_TEXT_SUCCESS_UNINSTALL_PROPERTY = + "message.text.success.uninstall"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL_PROPERTY = + "message.content.type.success.uninstall"; // NOI18N + public static final String MESSAGE_TEXT_WARNINGS_UNINSTALL_PROPERTY = + "message.text.warnings.uninstall"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL_PROPERTY = + "message.content.type.warnings.uninstall"; // NOI18N + public static final String MESSAGE_TEXT_ERRORS_UNINSTALL_PROPERTY = + "message.text.errors.uninstall"; // NOI18N + public static final String MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL_PROPERTY = + "message.content.type.errors.uninstall"; // NOI18N + public static final String MESSAGE_FILES_REMAINING_PROPERTY = + "message.files.remaining"; // NOI18N + public static final String RESTART_IS_REQUIRED_PROPERTY = + "restart.required";//NOI18N + public static final String NETBEANS_SUMMARY_MESSAGE_TEXT_PROPERTY = + "netbeans.summary.message.text"; // NOI18N + + public static final String DEFAULT_MESSAGE_TEXT_SUCCESS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.success"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.success"); // NOI18N + public static final String DEFAULT_MESSAGE_TEXT_WARNINGS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.warnings"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.warnings"); // NOI18N + public static final String DEFAULT_MESSAGE_TEXT_ERRORS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.errors"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.errors"); // NOI18N + public static final String DEFAULT_MESSAGE_TEXT_SUCCESS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.success.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_SUCCESS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.success.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_TEXT_WARNINGS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.warnings.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_WARNINGS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.warnings.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_TEXT_ERRORS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.text.errors.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_CONTENT_TYPE_ERRORS_UNINSTALL = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.content.type.errors.uninstall"); // NOI18N + public static final String DEFAULT_MESSAGE_FILES_REMAINING = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.files.remaining"); // NOI18N + + public static final String DEFAULT_MESSAGE_RESTART_TEXT = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.restart.text"); // NOI18N + public static final String DEFAULT_MESSAGE_RESTART_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.restart.content.type"); // NOI18N + public static final String DEFAULT_MESSAGE_NETBEANS_TEXT_WINDOWS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.netbeans.text.windows"); // NOI18N + public static final String DEFAULT_MESSAGE_NETBEANS_TEXT_UNIX = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.netbeans.text.unix"); // NOI18N + public static final String DEFAULT_MESSAGE_NETBEANS_TEXT_MACOSX = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.netbeans.text.macosx"); // NOI18N + public static final String DEFAULT_MESSAGE_NETBEANS_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.netbeans.content.type"); // NOI18N + public static final String DEFAULT_MESSAGE_MYSQL_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.mysql.content.type"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_TEXT = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.text"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_NETBEANS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.netbeans"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_GLASSFISH = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.glassfish"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_APPSERVER = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.appserver"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_JDK = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.jdk"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_CONCAT = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.concat");//NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_CHECKBOX = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.checkbox"); // NOI18N + public static final String DEFAULT_MESSAGE_REGISTRATION_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.registration.content.type");//NOI18N + public static final String DEFAULT_MESSAGE_METRICS_TEXT_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.metrics.text.content.type");//NOI18N + public static final String DEFAULT_MESSAGE_METRICS_LIST_CONTENT_TYPE = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.metrics.list.content.type");//NOI18N + public static final String DEFAULT_MESSAGE_METRICS_TEXT = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.metrics.text");//NOI18N + public static final String DEFAULT_MESSAGE_METRICS_LIST = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.metrics.list");//NOI18N + public static final String DEFAULT_MESSAGE_METRICS_CHECKBOX = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.metrics.checkbox");//NOI18N + public static final String ALLOW_SERVICETAG_REGISTRATION_PROPERTY = + "servicetag.allow.register"; + public static final String ENABLE_NETBEANS_METRICS_PROPERTY = + "enable.netbeans.metrics"; + public static final String DEFAULT_MYSQL_MESSAGE_WINDOWS = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.using.mysql.windows"); + public static final String DEFAULT_MYSQL_MESSAGE_UNIX = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.message.using.mysql.unix"); + + public static final String DEFAULT_TITLE = ResourceUtils.getString( + NbPostInstallSummaryPanel.class, + "NPoISP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.description"); // NOI18N + + public static final String DEFAULT_NEXT_BUTTON_TEXT = + ResourceUtils.getString(NbPostInstallSummaryPanel.class, + "NPoISP.next.button.text"); // NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java new file mode 100644 index 000000000000..2725fe2af63e --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbPreInstallSummaryPanel.java @@ -0,0 +1,1250 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.wizard.components.panels.netbeans; + +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.swing.SwingUtilities; +import javax.swing.border.EmptyBorder; +import org.netbeans.installer.Installer; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.RegistryNode; +import org.netbeans.installer.product.RegistryType; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.product.filters.OrFilter; +import org.netbeans.installer.product.filters.ProductFilter; +import org.netbeans.installer.utils.BrowserUtils; +import org.netbeans.installer.utils.ErrorManager; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.UninstallUtils; +import org.netbeans.installer.utils.applications.NetBeansUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.exceptions.XMLException; +import org.netbeans.installer.utils.helper.Dependency; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.netbeans.installer.utils.helper.FilesList; +import org.netbeans.installer.utils.helper.Pair; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.swing.NbiCheckBox; +import org.netbeans.installer.utils.helper.swing.NbiLabel; +import org.netbeans.installer.utils.helper.swing.NbiPanel; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelUi; +import org.netbeans.installer.wizard.containers.SwingContainer; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; + +/** + * + */ +public class NbPreInstallSummaryPanel extends ErrorMessagePanel { + private boolean removeNBInstallationLocation = false; + private boolean removeNBUserDir = false; + private File userDir; + ///////////////////////////////////////////////////////////////////////////////// + // Instance + public NbPreInstallSummaryPanel() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + setProperty(INSTALLATION_FOLDER_PROPERTY, + DEFAULT_INSTALLATION_FOLDER); + setProperty(INSTALLATION_FOLDER_NETBEANS_PROPERTY, + DEFAULT_INSTALLATION_FOLDER_NETBEANS); + setProperty(UNINSTALL_LIST_LABEL_TEXT_PROPERTY, + DEFAULT_UNINSTALL_LIST_LABEL_TEXT); + setProperty(UNINSTALL_LIST_NETBEANS_LABEL_TEXT_PROPERTY, + DEFAULT_UNINSTALL_LIST_NETBEANS_LABEL_TEXT); + + setProperty(INSTALLATION_SIZE_PROPERTY, + DEFAULT_INSTALLATION_SIZE); + setProperty(DOWNLOAD_SIZE_PROPERTY, + DEFAULT_DOWNLOAD_SIZE); + setProperty(NB_ADDONS_LOCATION_TEXT_PROPERTY, + DEFAULT_NB_ADDONS_LOCATION_TEXT); + setProperty(GF_ADDONS_LOCATION_TEXT_PROPERTY, + DEFAULT_GF_ADDONS_LOCATION_TEXT); + setProperty(AS_ADDONS_LOCATION_TEXT_PROPERTY, + DEFAULT_AS_ADDONS_LOCATION_TEXT); + setProperty(JUNIT_PRESENT_TEXT_PROPERTY, + DEFAULT_JUNIT_PRESENT_TEXT_PROPERTY); + + setProperty(NEXT_BUTTON_TEXT_PROPERTY, + DEFAULT_NEXT_BUTTON_TEXT); + + setProperty(ERROR_NOT_ENOUGH_SPACE_PROPERTY, + DEFAULT_ERROR_NOT_ENOUGH_SPACE); + setProperty(ERROR_CANNOT_CHECK_SPACE_PROPERTY, + DEFAULT_ERROR_CANNOT_CHECK_SPACE); + setProperty(ERROR_LOGIC_ACCESS_PROPERTY, + DEFAULT_ERROR_LOGIC_ACCESS); + setProperty(ERROR_FSROOTS_PROPERTY, + DEFAULT_ERROR_FSROOTS); + setProperty(ERROR_NON_EXISTENT_ROOT_PROPERTY, + DEFAULT_ERROR_NON_EXISTENT_ROOT); + setProperty(ERROR_CANNOT_WRITE_PROPERTY, + DEFAULT_ERROR_CANNOT_WRITE); + setProperty(REMOVE_NETBEANS_USERDIR_TEXT_PROPERTY, + DEFAULT_REMOVE_NETBEANS_USERDIR_TEXT); + setProperty(REMOVE_NETBEANS_INSTALLDIR_TEXT_PROPERTY, + DEFAULT_REMOVE_NETBEANS_INSTALLDIR_TEXT); + setProperty(REMOVE_NETBEANS_USERDIR_CHECKBOX_PROPERTY, + DEFAULT_REMOVE_NETBEANS_USERDIR_CHECKBOX); + setProperty(REMOVE_NETBEANS_USERDIR_LINK_PROPERTY, + DEFAULT_REMOVE_NETBEANS_USERDIR_LINK); + setProperty(REMOVE_NETBEANS_INSTALLDIR_CHECKBOX_PROPERTY, + DEFAULT_REMOVE_NETBEANS_INSTALLDIR_CHECKBOX); + setProperty(CHECK_FOR_UPDATES_TEXT_PROPERTY, + DEFAULT_CHECK_FOR_UPDATES_TEXT); + setProperty(CHECK_FOR_UPDATES_CHECKBOX_PROPERTY, + DEFAULT_CHECK_FOR_UPDATES_CHECKBOX); + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new NbPreInstallSummaryPanelUi(this); + } + + return wizardUi; + } + + @Override + public void initialize() { + assert ! SwingUtilities.isEventDispatchThread() : "Cannot run initialize() in EQ!"; + final List toInstall = + Registry.getInstance().getProductsToInstall(); + final List toUnInstall = + Registry.getInstance().getProductsToUninstall(); + + if (toInstall.size() > 0) { + setProperty(NEXT_BUTTON_TEXT_PROPERTY, DEFAULT_NEXT_BUTTON_TEXT); + setProperty(DESCRIPTION_PROPERTY, DEFAULT_DESCRIPTION); + } else { + setProperty(NEXT_BUTTON_TEXT_PROPERTY, DEFAULT_NEXT_BUTTON_TEXT_UNINSTALL); + setProperty(DESCRIPTION_PROPERTY, DEFAULT_DESCRIPTION_UNINSTALL); + } + + for (Product product : toUnInstall) { + if (product.getUid().equals(NB_BASE_UID)) { + File installLocation = product.getInstallationLocation(); + try { + removeNBInstallationLocation = FileUtils.canWrite(installLocation) && + areThereNewFiles(installLocation); + userDir = NetBeansUtils.getNetBeansUserDirFile(installLocation); + removeNBUserDir = (FileUtils.exists(userDir) && FileUtils.canWrite(userDir)); + }catch (IOException ioe) { + LogManager.log(ioe); + } + } + } + } + + private boolean doRemoveNBInstallationLocation() { + return removeNBInstallationLocation; + } + + private boolean doRemoveNBUserDir() { + return removeNBUserDir; + } + + private boolean areThereNewFiles(final File installLocation) throws IOException { + LogManager.log("areThereNewFiles: location " + installLocation); + Set installedFiles = new HashSet(); + Set existentFilesList = FileUtils.getRecursiveFileSet(installLocation); + + for (Product product : Registry.getInstance().getProductsToUninstall()) { + LogManager.log("Taking product " + product.getUid()); + if(product.getUid().startsWith("nb-")) { + // load the installed files list for this product + try { + File installedFilesList = product.getInstalledFilesList(); + if(installedFilesList.exists()) { + FilesList list = new FilesList().loadXmlGz(installedFilesList); + LogManager.log("loading files list for " + product.getUid()); + installedFiles.addAll(list.toList()); + } + } catch (XMLException e) { + LogManager.log(ErrorLevel.WARNING, + "Error loading file list for " + product.getUid()); + return false; + } + } + } + + //add all updated files and downloaded plugins + installedFiles.addAll(UninstallUtils.getFilesToDeteleAfterUninstallation()); + + existentFilesList.removeAll(installedFiles); + + //remove folders - there still might be some empty folders + Iterator eflIterator = existentFilesList.iterator(); + while (eflIterator.hasNext()) { + if (eflIterator.next().isDirectory()) { + eflIterator.remove(); + } + } + + boolean result = !existentFilesList.isEmpty(); + LogManager.log(ErrorLevel.DEBUG, "installedFiles " + Arrays.toString(installedFiles.toArray())); + LogManager.log(ErrorLevel.DEBUG, "existentFilesList after removal " + Arrays.toString(existentFilesList.toArray())); + LogManager.log("areThereNewFiles returned " + result); + return result; + } + + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class NbPreInstallSummaryPanelUi extends ErrorMessagePanelUi { + @SuppressWarnings("FieldNameHidesFieldInSuperclass") + protected NbPreInstallSummaryPanel component; + + public NbPreInstallSummaryPanelUi(NbPreInstallSummaryPanel component) { + super(component); + + this.component = component; + } + + @Override + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new NbPreInstallSummaryPanelSwingUi(component, container); + } + + return super.getSwingUi(container); + } + } + + public static class NbPreInstallSummaryPanelSwingUi extends ErrorMessagePanelSwingUi { + @SuppressWarnings("FieldNameHidesFieldInSuperclass") + protected NbPreInstallSummaryPanel component; + + private NbiTextPane locationsPane; + + private NbiLabel uninstallListLabel; + private NbiTextPane uninstallListPane; + + private NbiLabel installationSizeLabel; + private NbiLabel installationSizeValue; + + private NbiLabel downloadSizeLabel; + private NbiLabel downloadSizeValue; + + private NbiCheckBox removeUserdirCheckbox; + private NbiCheckBox removeInstalldirCheckbox; + private NbiTextPane removeUserdirPane; + private NbiTextPane removeInstalldirPane; + private NbiLabel foldersToRemove; + private NbiPanel spacer; + private NbiCheckBox checkForUpdatesCheckbox; + private NbiTextPane checkForUpdatesPane; + + private List > productCheckboxList; + private int gridy = 0 ; + + + public NbPreInstallSummaryPanelSwingUi( + final NbPreInstallSummaryPanel component, + final SwingContainer container) { + super(component, container); + + this.component = component; + initComponents(); + } + + // protected //////////////////////////////////////////////////////////////// + @Override + protected void initializeContainer() { + super.initializeContainer(); + + container.getNextButton().setText( + panel.getProperty(NEXT_BUTTON_TEXT_PROPERTY)); + } + + @Override + protected void initialize() { + final Registry registry = Registry.getInstance(); + + final StringBuilder text = new StringBuilder(); + long installationSize = 0; + long downloadSize = 0; + + final List dependentOnNb = new LinkedList(); + final List dependentOnGf = new LinkedList(); + final List dependentOnAs = new LinkedList(); + boolean nbBasePresent = false; + + for (Product product: registry.getProductsToInstall()) { + installationSize += product.getRequiredDiskSpace(); + downloadSize += product.getDownloadSize(); + try { + if (product.getLogic().registerInSystem() || product.getUid().equals("jdk") + || product.getUid().equals("mysql") || product.getUid().equals("javafxsdk")) { + nbBasePresent = product.getUid().equals(NB_BASE_UID) ? true : nbBasePresent; + } else { + if (product.getUid().startsWith("nb-")) { + dependentOnNb.add(product); + } else { + if(product.getDependencyByUid("glassfish").size()>0) { + dependentOnGf.add(product); + } else if(product.getDependencyByUid("sjsas").size()>0) { + dependentOnAs.add(product); + } + } + } + } catch (InitializationException e) { + ErrorManager.notifyError( + panel.getProperty(ERROR_LOGIC_ACCESS_PROPERTY),e); + } + } + + + File nbLocation = null; + Product base; + // If there are several packs to be installed but Base is already installed + // then search it and the corresponding record to text + if (dependentOnNb.size() > 0 && !nbBasePresent) { + for(Product product : dependentOnNb) { + List bases = product.getDependencyByUid(NB_BASE_UID); + if(!bases.isEmpty()) { + // dependency is already resolved at this point + base = Registry.getInstance().getProducts(bases.get(0)).get(0); + + if(base!=null) { + nbLocation = base.getInstallationLocation(); + try { + if(base.getLogic().wrapForMacOs() && SystemUtils.isMacOS()) { + final File app = nbLocation.getParentFile().getParentFile().getParentFile(); + nbLocation = app; + } + } catch (InitializationException e){ + LogManager.log(".. cannot get logic for " + base.getDisplayName() + " (" + base.getVersion() + ")", e); + } catch (NullPointerException e){ + LogManager.log(".. cannot get app directory for " + nbLocation); + } + if(nbLocation!=null) { + text.append(StringUtils.LF); + text.append(StringUtils.format( + panel.getProperty(INSTALLATION_FOLDER_NETBEANS_PROPERTY), + base.getDisplayName())); + text.append(StringUtils.LF); + text.append(" "); + text.append(nbLocation); + text.append(StringUtils.LF); + } + break; + } + } + } + } + + // add top-level components like nb-base, glassfish, tomcat, jdk + for (Product product: registry.getProductsToInstall()) { + try { + if (product.getLogic().registerInSystem() || + product.getUid().equals("jdk") || + product.getUid().equals("mysql") || + product.getUid().equals("javafxsdk")) { + String property = panel.getProperty( + product.getUid().equals(NB_BASE_UID) ? + INSTALLATION_FOLDER_NETBEANS_PROPERTY : + INSTALLATION_FOLDER_PROPERTY); + text.append(StringUtils.LF); + text.append(StringUtils.format(property, + product.getDisplayName())); + text.append(StringUtils.LF); + text.append(" ").append(product.getInstallationLocation()); + text.append(StringUtils.LF); + } + } catch (InitializationException e) { + ErrorManager.notifyError( + panel.getProperty(ERROR_LOGIC_ACCESS_PROPERTY),e); + } + } + // if we could not find nb-base location (very rare case) just mention all the packs to be installed + if(!nbBasePresent && nbLocation == null && dependentOnNb.size() > 0) { + text.append(StringUtils.LF); + text.append(StringUtils.format( + panel.getProperty(NB_ADDONS_LOCATION_TEXT_PROPERTY), + StringUtils.asString(dependentOnNb))); + text.append(StringUtils.LF); + } + // at the end add glassfish components record + if (dependentOnGf.size() > 0) { + text.append(StringUtils.LF); + text.append(StringUtils.format( + panel.getProperty(GF_ADDONS_LOCATION_TEXT_PROPERTY), + StringUtils.asString(dependentOnGf))); + text.append(StringUtils.LF); + } + if (dependentOnAs.size() > 0) { + text.append(StringUtils.LF); + text.append(StringUtils.format( + panel.getProperty(AS_ADDONS_LOCATION_TEXT_PROPERTY), + StringUtils.asString(dependentOnAs))); + text.append(StringUtils.LF); + } + locationsPane.setText(text); + + List toUninstallVisible = new ArrayList(); + Product nbProduct = null; + for(Product p : registry.getProductsToUninstall()) { + String uid = p.getUid(); + if(uid.equals(NB_BASE_UID)) { + nbProduct = p; + } else if(!uid.startsWith("nb-")) { + nbProduct = null; + break; + } + } + for(Product p : registry.getProductsToUninstall()) { + if (! Boolean.FALSE.toString().equals(p.getProperty("show-in-wizard"))) { + toUninstallVisible.add(p); + } + } + String uninstallLabelText; + if(nbProduct!=null) { + String nbName = nbProduct.getDisplayName(); + try { + nbName = nbProduct.getLogic().getSystemDisplayName(); + } catch (InitializationException e) { + } + uninstallLabelText = StringUtils.format(panel.getProperty(UNINSTALL_LIST_NETBEANS_LABEL_TEXT_PROPERTY), nbName); + } else { + uninstallLabelText = StringUtils.format(panel.getProperty(UNINSTALL_LIST_LABEL_TEXT_PROPERTY)); + } + uninstallListLabel.setText(uninstallLabelText); + + uninstallListPane.setText( + StringUtils.asString(toUninstallVisible)); + + installationSizeLabel.setText( + panel.getProperty(INSTALLATION_SIZE_PROPERTY)); + installationSizeValue.setText(StringUtils.formatSize( + installationSize)); + + downloadSizeLabel.setText( + panel.getProperty(DOWNLOAD_SIZE_PROPERTY)); + downloadSizeValue.setText(StringUtils.formatSize( + downloadSize)); + + if (registry.getProductsToInstall().isEmpty()) { + locationsPane.setVisible(false); + installationSizeLabel.setVisible(false); + installationSizeValue.setVisible(false); + } else { + locationsPane.setVisible(true); + installationSizeLabel.setVisible(true); + installationSizeValue.setVisible(true); + } + + if (registry.getProductsToUninstall().isEmpty()) { + uninstallListLabel.setVisible(false); + uninstallListPane.setVisible(false); + } else { + uninstallListLabel.setVisible(true); + uninstallListPane.setVisible(true); + } + + downloadSizeLabel.setVisible(false); + downloadSizeValue.setVisible(false); + for (RegistryNode remoteNode: registry.getNodes(RegistryType.REMOTE)) { + if (remoteNode.isVisible()) { + downloadSizeLabel.setVisible(true); + downloadSizeValue.setVisible(true); + } + } + + if(Boolean.getBoolean(REMOVE_NETBEANS_USERDIR_PROPERTY)) { + removeUserdirCheckbox.doClick(); + } + + if (nbBasePresent) { + checkForUpdatesCheckbox.setSelected(true); + System.setProperty(CHECK_FOR_UPDATES_CHECKBOX_PROPERTY, Boolean.TRUE.toString()); + + checkForUpdatesCheckbox.setText( + panel.getProperty(CHECK_FOR_UPDATES_CHECKBOX_PROPERTY)); + checkForUpdatesCheckbox.setBorder(new EmptyBorder(0, 0, 0, 0)); + checkForUpdatesCheckbox.setVisible(true); + + checkForUpdatesPane.setVisible(true); + checkForUpdatesPane.setContentType("text/html"); + //checkForUpdatesPane.addHyperlinkListener(BrowserUtils.createHyperlinkListener()); + + checkForUpdatesPane.setText( + StringUtils.format( + panel.getProperty(CHECK_FOR_UPDATES_TEXT_PROPERTY) + )); + } else { + checkForUpdatesCheckbox.setVisible(false); + checkForUpdatesPane.setVisible(false); + } + + foldersToRemove.setText(ADDITIONAL_FOLDERS_TO_DELETE); + foldersToRemove.setVisible(false); + + removeUserdirCheckbox.setVisible(false); + removeUserdirPane.setVisible(false); + + if(Boolean.getBoolean(REMOVE_NETBEANS_INSTALLDIR_PROPERTY)) { + removeInstalldirCheckbox.doClick(); + } + removeInstalldirCheckbox.setVisible(false); + removeInstalldirPane.setVisible(false); + + for (Product product : Registry.getInstance().getProductsToUninstall()) { + if (product.getUid().equals(NB_BASE_UID)) { + File installLocation = product.getInstallationLocation(); + if(component.doRemoveNBInstallationLocation()) { + foldersToRemove.setVisible(true); + removeInstalldirCheckbox.setText( + StringUtils.format( + panel.getProperty(REMOVE_NETBEANS_INSTALLDIR_CHECKBOX_PROPERTY), + installLocation.getAbsolutePath())); + removeInstalldirCheckbox.setBorder(new EmptyBorder(0, 0, 0, 0)); + removeInstalldirCheckbox.setVisible(true); + + removeInstalldirPane.setVisible(true); + removeInstalldirPane.setContentType("text/html"); + removeInstalldirPane.setText( + panel.getProperty(REMOVE_NETBEANS_INSTALLDIR_TEXT_PROPERTY)); + } + + if (component.doRemoveNBUserDir()) { + foldersToRemove.setVisible(true); + removeUserdirCheckbox.setText( + StringUtils.format( + panel.getProperty(REMOVE_NETBEANS_USERDIR_CHECKBOX_PROPERTY), + component.userDir.getAbsolutePath())); + removeUserdirCheckbox.setBorder(new EmptyBorder(0, 0, 0, 0)); + removeUserdirCheckbox.setVisible(true); + + removeUserdirPane.setVisible(true); + removeUserdirPane.setContentType("text/html"); + removeUserdirPane.addHyperlinkListener(BrowserUtils.createHyperlinkListener()); + + String name = product.getDisplayName(); + try { + name = product.getLogic().getSystemDisplayName(); + } catch (InitializationException e) { + } + removeUserdirPane.setText( + StringUtils.format( + panel.getProperty(REMOVE_NETBEANS_USERDIR_TEXT_PROPERTY), + name, panel.getProperty(REMOVE_NETBEANS_USERDIR_LINK_PROPERTY))); + + } + break; + } + } + + //if(productCheckboxList!=null) { + // for(Pair pair : productCheckboxList) { + // pair.getSecond().doClick(); + // } + //} + super.initialize(); + } + + @Override + protected String validateInput() { + try { + if(!Boolean.getBoolean(SystemUtils.NO_SPACE_CHECK_PROPERTY)) { + final List toInstall = Registry.getInstance().getProductsToInstall(); + final Map spaceMap = new HashMap(); + final File downloadDataDir = Installer.getInstance().getLocalDirectory(); + + // only roots for appropriate files + final String[] installFiles = new String[toInstall.size() + 1]; + for (int i = 0; i < toInstall.size(); i++) { + installFiles[i] = toInstall.get(i).getInstallationLocation().getAbsolutePath(); + } + installFiles[installFiles.length - 1] = downloadDataDir.getAbsolutePath(); + final List roots = SystemUtils.getFileSystemRoots(installFiles); + + LogManager.log("Roots : " + StringUtils.asString(roots)); + + File downloadDataDirRoot = FileUtils.getRoot(downloadDataDir, roots); + long downloadSize = 0; + for (Product product: toInstall) { + downloadSize+=product.getDownloadSize(); + } + // the critical check point - we download all the data + spaceMap.put(downloadDataDirRoot, new Long(downloadSize)); + long lastDataSize = 0; + for (Product product: toInstall) { + final File installLocation = product.getInstallationLocation(); + final File root = FileUtils.getRoot(installLocation, roots); + final long productSize = product.getRequiredDiskSpace(); + + LogManager.log(" [" + root + "] <- " + installLocation); + + if ( root != null ) { + Long ddSize = spaceMap.get(downloadDataDirRoot); + // remove space that was freed after the remove of previos product data + spaceMap.put(downloadDataDirRoot, + Long.valueOf(ddSize - lastDataSize)); + + // add space required for next product installation + Long size = spaceMap.get(root); + size = Long.valueOf( + (size != null ? size.longValue() : 0L) + + productSize); + spaceMap.put(root, size); + lastDataSize = product.getDownloadSize(); + } else { + return StringUtils.format( + panel.getProperty(ERROR_NON_EXISTENT_ROOT_PROPERTY), + product, installLocation); + } + } + + for (File root: spaceMap.keySet()) { + try { + final long availableSpace = + SystemUtils.getFreeSpace(root); + final long requiredSpace = + spaceMap.get(root) + REQUIRED_SPACE_ADDITION; + + if (availableSpace < requiredSpace) { + return StringUtils.format( + panel.getProperty(ERROR_NOT_ENOUGH_SPACE_PROPERTY), + root, + StringUtils.formatSize(requiredSpace - availableSpace)); + } + } catch (NativeException e) { + ErrorManager.notifyError( + panel.getProperty(ERROR_CANNOT_CHECK_SPACE_PROPERTY), + e); + } + } + } + + final List toUninstall = + Registry.getInstance().getProductsToUninstall(); + for (Product product: toUninstall) { + if (!FileUtils.canWrite(product.getInstallationLocation())) { + return StringUtils.format( + panel.getProperty(ERROR_CANNOT_WRITE_PROPERTY), + product, + product.getInstallationLocation()); + } + } + + } catch (IOException e) { + ErrorManager.notifyError( + panel.getProperty(ERROR_FSROOTS_PROPERTY), e); + } + + return null; + } + + private void addProductCheckBox(List products, List locations) { + for (final Product product : products) { + if (product.getStatus() == Status.INSTALLED) { + for(String location: locations) { + if(new File(location).equals(product.getInstallationLocation())) { + final NbiCheckBox checkbox = new NbiCheckBox(); + final Pair pair = new Pair(product, checkbox); + productCheckboxList.add(pair); + checkbox.setText(pair.getFirst().getDisplayName()); + checkbox.setBorder(new EmptyBorder(0, 0, 0, 0)); + checkbox.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (pair.getSecond().isSelected()) { + pair.getFirst().setStatus(Status.TO_BE_UNINSTALLED); + } else { + pair.getFirst().setStatus(Status.INSTALLED); + } + } + }); + + add(checkbox, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + break; + } + } + } + } + } + private List getRegisteredGlassFishLocations(File nbLocation) throws IOException{ + //temporary solution + List result = new ArrayList(); + for(String nbattrs : new String[] {"nb/config/GlassFishEE6WC/Instances/.nbattrs", "nb/config/GlassFishEE6/Instances/.nbattrs"}) { + File f = new File(nbLocation, nbattrs); + if (f.exists()) { + try { + List list = FileUtils.readStringList(f, "utf-8"); + for(String s : list) { + String prefix = " getRegisteredTomcatLocations(File nbLocation) throws IOException { + //temporary solution + File f = new File(nbLocation, "nb/config/J2EE/InstalledServers/.nbattrs"); + List result = new ArrayList(); + if (f.exists()) { + try { + List list = FileUtils.readStringList(f, "utf-8"); + for (String s : list) { + String prefix = " getRegisteredGlassFishV2Locations(File nbLocation) throws IOException{ + String s = NetBeansUtils.getJvmOption(nbLocation, GLASSFISH_JVM_OPTION_NAME); + List result = new ArrayList(); + if (s!=null) { + result.add(s); + } + return result; + } + private List getRegisteredWebLogicLocations(File nbLocation) throws IOException { + //temporary solution + File f = new File(nbLocation, "nb/config/J2EE/InstalledServers/.nbattrs"); + List result = new ArrayList(); + if (f.exists()) { + try { + List list = FileUtils.readStringList(f, "utf-8"); + for (String s : list) { + String prefix = ">(); + // locationsPane //////////////////////////////////////////////////////// + locationsPane = new NbiTextPane(); + + // uninstallListPane //////////////////////////////////////////////////// + uninstallListPane = new NbiTextPane(); + + // uninstallListLabel /////////////////////////////////////////////////// + uninstallListLabel = new NbiLabel(); + uninstallListLabel.setLabelFor(uninstallListPane); + + // installationSizeValue //////////////////////////////////////////////// + installationSizeValue = new NbiLabel(); + //installationSizeValue.setFocusable(true); + + // installationSizeLabel //////////////////////////////////////////////// + installationSizeLabel = new NbiLabel(); + installationSizeLabel.setLabelFor(installationSizeValue); + + // downloadSizeValue //////////////////////////////////////////////////// + downloadSizeValue = new NbiLabel(); + //downloadSizeValue.setFocusable(true); + + // downloadSizeLabel //////////////////////////////////////////////////// + downloadSizeLabel = new NbiLabel(); + downloadSizeLabel.setLabelFor(downloadSizeValue); + + // spacer /////////////////////////////////////////////////////////////// + spacer = new NbiPanel(); + + // this ///////////////////////////////////////////////////////////////// + add(locationsPane, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(uninstallListLabel, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(uninstallListPane, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + int gridy0 = gridy; + gridy++; + for (Product product : Registry.getInstance().getProductsToUninstall()) { + if (product.getUid().equals(NB_BASE_UID) || product.getUid().equals(NB_ALL_UID)) { + try { + File installLocation = product.getInstallationLocation(); + + List gfLocations = getRegisteredGlassFishV2Locations(installLocation); + if (!gfLocations.isEmpty()) { + List glassfishesAppservers = Registry.getInstance().queryProducts( + new OrFilter( + new ProductFilter("glassfish", + SystemUtils.getCurrentPlatform()))); + addProductCheckBox(glassfishesAppservers, gfLocations); + } + List gfModLocations = getRegisteredGlassFishLocations(installLocation); + if (!gfModLocations.isEmpty()) { + List glassfishservers = Registry.getInstance().queryProducts( + new OrFilter( + new ProductFilter("glassfish-mod", + SystemUtils.getCurrentPlatform()))); + + addProductCheckBox(glassfishservers, gfModLocations); + } + + + List tomcatLocations = getRegisteredTomcatLocations(installLocation); + if (!tomcatLocations.isEmpty()) { + addProductCheckBox(Registry.getInstance().getProducts("tomcat"), tomcatLocations); + } + List weblogicLocations = getRegisteredWebLogicLocations(installLocation); + if (!weblogicLocations.isEmpty()) { + addProductCheckBox(Registry.getInstance().getProducts("weblogic"), weblogicLocations); + } + addProductCheckBox(Registry.getInstance().getProducts("mysql"), null); + + if (!productCheckboxList.isEmpty()) { + String productName; + try { + productName = product.getLogic().getSystemDisplayName(); + } catch (InitializationException e) { + productName = product.getDisplayName(); + LogManager.log(e); + } + NbiLabel runtimesToRemove = new NbiLabel(); + runtimesToRemove.setText(StringUtils.format(ADDITIONAL_RUNTIMES_TO_DELETE, + productName)); + add(runtimesToRemove, new GridBagConstraints( + 0, gridy0, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 11, 3, 11), // padding + 0, 0)); // padx, pady - ??? + } + } catch (IOException e) { + LogManager.log(e); + } + } + } + + foldersToRemove = new NbiLabel(); + add(foldersToRemove, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 11, 3, 11), // padding + 0, 0)); // padx, pady - ??? + + + removeInstalldirCheckbox = new NbiCheckBox(); + add(removeInstalldirCheckbox, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + removeInstalldirPane = new NbiTextPane(); + add(removeInstalldirPane, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + removeInstalldirCheckbox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + System.setProperty(REMOVE_NETBEANS_INSTALLDIR_PROPERTY, + "" + removeInstalldirCheckbox.isSelected()); + } + }); + + removeUserdirCheckbox = new NbiCheckBox(); + add(removeUserdirCheckbox, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + + removeUserdirPane = new NbiTextPane(); + add(removeUserdirPane, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + + removeUserdirCheckbox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + System.setProperty(REMOVE_NETBEANS_USERDIR_PROPERTY, + "" + removeUserdirCheckbox.isSelected()); + } + }); + + checkForUpdatesCheckbox = new NbiCheckBox(); + add(checkForUpdatesCheckbox, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(11, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + + checkForUpdatesPane = new NbiTextPane(); + add(checkForUpdatesPane, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.PAGE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 20, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + checkForUpdatesCheckbox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + System.setProperty(CHECK_FOR_UPDATES_CHECKBOX_PROPERTY, + "" + checkForUpdatesCheckbox.isSelected()); + } + }); + + add(installationSizeLabel, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(22, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(installationSizeValue, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 22, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(downloadSizeLabel, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(downloadSizeValue, new GridBagConstraints( + 0, gridy++, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 22, 0, 11), // padding + 0, 0)); // padx, pady - ??? + add(spacer, new GridBagConstraints( + 0, gridy + 10, // x, y + 1, 1, // width, height + 1.0, 1.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + } + + @Override + public void evaluateNextButtonClick() { + if (productCheckboxList != null) { + for (Pair pair : productCheckboxList) { + Product product = pair.getFirst(); + if (product != null && + product.getStatus() == Status.TO_BE_UNINSTALLED) { + product.setStatus(Status.INSTALLED); + List others = Registry.getInstance().getInavoidableDependents(product); + for (Product pr : others) { + pr.setStatus(Status.TO_BE_UNINSTALLED); + } + product.setStatus(Status.TO_BE_UNINSTALLED); + } + } + } + super.evaluateNextButtonClick(); + } + } + +///////////////////////////////////////////////////////////////////////////////// +// Constants + + public static final String INSTALLATION_FOLDER_PROPERTY = + "installation.folder"; // NOI18N + public static final String INSTALLATION_FOLDER_NETBEANS_PROPERTY = + "installation.folder.netbeans"; // NOI18N + public static final String UNINSTALL_LIST_LABEL_TEXT_PROPERTY = + "uninstall.list.label.text"; // NOI18N + public static final String UNINSTALL_LIST_NETBEANS_LABEL_TEXT_PROPERTY = + "uninstall.list.netbeans.label.text"; // NOI18N + + public static final String INSTALLATION_SIZE_PROPERTY = + "installation.size"; // NOI18N + public static final String DOWNLOAD_SIZE_PROPERTY = + "download.size"; // NOI18N + public static final String NB_ADDONS_LOCATION_TEXT_PROPERTY = + "addons.nb.install.location.text"; // NOI18N + public static final String GF_ADDONS_LOCATION_TEXT_PROPERTY = + "addons.gf.install.location.text"; // NOI18N + public static final String AS_ADDONS_LOCATION_TEXT_PROPERTY = + "addons.as.install.location.text"; // NOI18N + public static final String JUNIT_PRESENT_TEXT_PROPERTY = + "junit.present.text"; // NOI18N + public static final String JUNIT_ACCEPTED_PROPERTY = + "junit.accepted"; // NOI18N + + public static final String ERROR_NOT_ENOUGH_SPACE_PROPERTY = + "error.not.enough.space"; // NOI18N + public static final String ERROR_CANNOT_CHECK_SPACE_PROPERTY = + "error.cannot.check.space"; // NOI18N + public static final String ERROR_LOGIC_ACCESS_PROPERTY = + "error.logic.access"; // NOI18N + public static final String ERROR_FSROOTS_PROPERTY = + "error.fsroots"; // NOI18N + public static final String ERROR_NON_EXISTENT_ROOT_PROPERTY = + "error.non.existent.root"; // NOI18N + public static final String ERROR_CANNOT_WRITE_PROPERTY = + "error.cannot.write"; // NOI18N + public static final String REMOVE_NETBEANS_USERDIR_PROPERTY = + "remove.netbeans.userdir"; + public static final String REMOVE_NETBEANS_INSTALLDIR_PROPERTY = + "remove.netbeans.installdir"; + public static final String REMOVE_NETBEANS_USERDIR_TEXT_PROPERTY = + "remove.netbeans.userdir.text"; + public static final String REMOVE_NETBEANS_INSTALLDIR_TEXT_PROPERTY = + "remove.netbeans.installdir.text"; + public static final String REMOVE_NETBEANS_USERDIR_LINK_PROPERTY = + "remove.netbeans.userdir.link"; + public static final String REMOVE_NETBEANS_USERDIR_CHECKBOX_PROPERTY = + "remove.netbeans.userdir.checkbox"; + public static final String REMOVE_NETBEANS_INSTALLDIR_CHECKBOX_PROPERTY = + "remove.netbeans.installdir.checkbox"; + public static final String CHECK_FOR_UPDATES_PROPERTY = + "check.for.updates"; + public static final String CHECK_FOR_UPDATES_TEXT_PROPERTY = + "check.for.updates.text"; + public static final String CHECK_FOR_UPDATES_CHECKBOX_PROPERTY = + "check.for.updates.checkbox"; + + public static final String DEFAULT_TITLE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.description"); // NOI18N + public static final String DEFAULT_DESCRIPTION_UNINSTALL = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.description.uninstall"); // NOI18N + + public static final String DEFAULT_INSTALLATION_FOLDER = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.installation.folder"); // NOI18N + public static final String DEFAULT_INSTALLATION_FOLDERS = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.installation.folders"); // NOI18N + public static final String DEFAULT_INSTALLATION_FOLDER_NETBEANS = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.installation.folder.netbeans"); // NOI18N + public static final String DEFAULT_UNINSTALL_LIST_LABEL_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.uninstall.list.label.text"); // NOI18N + public static final String DEFAULT_UNINSTALL_LIST_NETBEANS_LABEL_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.uninstall.list.netbeans.label.text"); // NOI18N + + public static final String DEFAULT_INSTALLATION_SIZE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.installation.size"); // NOI18N + public static final String DEFAULT_DOWNLOAD_SIZE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.download.size"); // NOI18N + public static final String DEFAULT_GF_ADDONS_LOCATION_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.addons.gf.install.location.text"); // NOI18N + public static final String DEFAULT_AS_ADDONS_LOCATION_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.addons.as.install.location.text"); // NOI18N + public static final String DEFAULT_NB_ADDONS_LOCATION_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.addons.nb.install.location.text"); // NOI18N + public static final String DEFAULT_JUNIT_PRESENT_TEXT_PROPERTY = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.junit.present.text"); // NOI18N + + public static final String DEFAULT_NEXT_BUTTON_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.next.button.text"); // NOI18N + public static final String DEFAULT_NEXT_BUTTON_TEXT_UNINSTALL = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.next.button.text.uninstall"); // NOI18N + public static final String ADDITIONAL_RUNTIMES_TO_DELETE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.additional.runtimes.to.delete");//NOI18N + public static final String ADDITIONAL_FOLDERS_TO_DELETE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.additional.folders.to.delete");//NOI18N + public static final String DEFAULT_ERROR_NOT_ENOUGH_SPACE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.not.enough.space"); // NOI18N + public static final String DEFAULT_ERROR_CANNOT_CHECK_SPACE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.cannot.check.space");// NOI18N + public static final String DEFAULT_ERROR_LOGIC_ACCESS = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.logic.access");// NOI18N + public static final String DEFAULT_ERROR_FSROOTS = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.fsroots"); // NOI18N + public static final String DEFAULT_ERROR_NON_EXISTENT_ROOT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.non.existent.root"); // NOI18N + public static final String DEFAULT_ERROR_CANNOT_WRITE = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.error.cannot.write"); // NOI18N + public static final String DEFAULT_REMOVE_NETBEANS_USERDIR_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.remove.netbeans.userdir.text"); // NOI18N + public static final String DEFAULT_REMOVE_NETBEANS_INSTALLDIR_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.remove.netbeans.installdir.text"); // NOI18N + public static final String DEFAULT_REMOVE_NETBEANS_USERDIR_LINK = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.remove.netbeans.userdir.link"); // NOI18N + public static final String DEFAULT_REMOVE_NETBEANS_USERDIR_CHECKBOX = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.remove.netbeans.userdir.checkbox"); // NOI18N + public static final String DEFAULT_REMOVE_NETBEANS_INSTALLDIR_CHECKBOX = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.remove.netbeans.installdir.checkbox"); // NOI18N + public static final String DEFAULT_CHECK_FOR_UPDATES_TEXT = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.check.for.updates.text"); // NOI18N + public static final String DEFAULT_CHECK_FOR_UPDATES_CHECKBOX = + ResourceUtils.getString(NbPreInstallSummaryPanel.class, + "NPrISP.check.for.updates.checkbox"); // NOI18N + + public static final String NB_BASE_UID = + "nb-base";//NOI18N + public static final String NB_ALL_UID = + "nb-all";//NOI18N + public static final String NB_JAVASE_UID = + "nb-javase";//NOI18N + public static final String JUNIT_UID = + "junit";//NOI18N + public static final long REQUIRED_SPACE_ADDITION = + 10L * 1024L * 1024L; // 10MB + public static final String GLASSFISH_JVM_OPTION_NAME = + "-Dcom.sun.aas.installRoot"; // NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbWelcomePanel.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbWelcomePanel.java new file mode 100644 index 000000000000..be99c486d008 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/NbWelcomePanel.java @@ -0,0 +1,1488 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.wizard.components.panels.netbeans; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import javax.swing.ImageIcon; +import javax.swing.JScrollPane; +import javax.swing.border.EmptyBorder; +import org.netbeans.installer.Installer; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.RegistryNode; +import org.netbeans.installer.product.RegistryType; +import org.netbeans.installer.product.components.Group; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.product.filters.AndFilter; +import org.netbeans.installer.product.filters.OrFilter; +import org.netbeans.installer.product.filters.ProductFilter; +import org.netbeans.installer.product.filters.RegistryFilter; +import org.netbeans.installer.utils.ErrorManager; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.StringUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.applications.JavaFXUtils; +import org.netbeans.installer.utils.applications.JavaUtils; +import org.netbeans.installer.utils.applications.NetBeansUtils; +import org.netbeans.installer.utils.exceptions.InitializationException; +import org.netbeans.installer.utils.exceptions.NativeException; +import org.netbeans.installer.utils.helper.Dependency; +import org.netbeans.installer.utils.helper.ErrorLevel; +import org.netbeans.installer.utils.helper.ExecutionMode; +import org.netbeans.installer.utils.helper.Status; +import org.netbeans.installer.utils.helper.swing.NbiButton; +import org.netbeans.installer.utils.helper.swing.NbiCheckBox; +import org.netbeans.installer.utils.helper.swing.NbiFrame; +import org.netbeans.installer.utils.helper.swing.NbiLabel; +import org.netbeans.installer.utils.helper.swing.NbiPanel; +import org.netbeans.installer.utils.helper.swing.NbiScrollPane; +import org.netbeans.installer.utils.helper.swing.NbiTextPane; +import org.netbeans.installer.wizard.Wizard; +import org.netbeans.installer.wizard.components.WizardComponent; +import org.netbeans.installer.wizard.components.actions.SearchForJavaAction; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelSwingUi; +import org.netbeans.installer.wizard.components.panels.ErrorMessagePanel.ErrorMessagePanelUi; +import org.netbeans.installer.wizard.components.panels.JdkLocationPanel; +import org.netbeans.installer.wizard.containers.SwingContainer; +import org.netbeans.installer.wizard.containers.SwingFrameContainer; +import org.netbeans.installer.wizard.ui.SwingUi; +import org.netbeans.installer.wizard.ui.WizardUi; + +/** + * + */ +public class NbWelcomePanel extends ErrorMessagePanel { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + private Registry bundledRegistry; + private Registry defaultRegistry; + + private boolean registriesFiltered; + private static BundleType type; + private List lastChosenProducts; + private String lastWarningMessage; + private static String bundledproduct_name; + + public NbWelcomePanel() { + setProperty(TITLE_PROPERTY, + DEFAULT_TITLE); + setProperty(DESCRIPTION_PROPERTY, + DEFAULT_DESCRIPTION); + + setProperty(TEXT_PANE_CONTENT_TYPE_PROPERTY, + DEFAULT_TEXT_PANE_CONTENT_TYPE); + type = BundleType.getType( + System.getProperty(WELCOME_PAGE_TYPE_PROPERTY)); + + if(type.equals(BundleType.BUNDLEDPRODUCT)) { + bundledproduct_name = System.getProperty(WELCOME_PAGE_BUNDLEDPRODUCT_NAME_PROPERTY); + } + + setProperty(WELCOME_TEXT_HEADER_PROPERTY, + (type.equals(BundleType.JAVA_TOOLS) ? + DEFAULT_WELCOME_TEXT_HEADER_JTB : + (type.equals(BundleType.MYSQL) ? + DEFAULT_WELCOME_TEXT_HEADER_MYSQL : + (type.equals(BundleType.BUNDLEDPRODUCT)) ? + DEFAULT_WELCOME_TEXT_HEADER_BUNDLEDPRODUCT : + DEFAULT_WELCOME_TEXT_HEADER ))); + + setProperty(WELCOME_TEXT_DETAILS_PROPERTY, + ResourceUtils.getString(NbWelcomePanel.class, + WELCOME_TEXT_HEADER_APPENDING_PROPERTY + "." + type )); + + setProperty(WELCOME_TEXT_GROUP_TEMPLATE_PROPERTY, + DEFAULT_WELCOME_TEXT_GROUP_TEMPLATE); + setProperty(WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE_PROPERTY, + DEFAULT_WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE); + setProperty(WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE_PROPERTY, + DEFAULT_WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE); + setProperty(WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE_PROPERTY, + DEFAULT_WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE); + setProperty(WELCOME_TEXT_OPENTAG_PROPERTY, + DEFAULT_WELCOME_TEXT_OPENTAG); + setProperty(WELCOME_TEXT_FOOTER_PROPERTY, + DEFAULT_WELCOME_TEXT_FOOTER); + setProperty(CUSTOMIZE_BUTTON_TEXT_PROPERTY, + DEFAULT_CUSTOMIZE_BUTTON_TEXT); + setProperty(INSTALLATION_SIZE_LABEL_TEXT_PROPERTY, + DEFAULT_INSTALLATION_SIZE_LABEL_TEXT); + + setProperty(CUSTOMIZE_TITLE_PROPERTY, + DEFAULT_CUSTOMIZE_TITLE); + + setProperty(MESSAGE_PROPERTY, + DEFAULT_MESSAGE); + setProperty(MESSAGE_INSTALL_PROPERTY, + DEFAULT_MESSAGE_INSTALL); + setProperty(MESSAGE_UNINSTALL_PROPERTY, + DEFAULT_MESSAGE_UNINSTALL); + setProperty(COMPONENT_DESCRIPTION_TEXT_PROPERTY, + DEFAULT_COMPONENT_DESCRIPTION_TEXT); + setProperty(COMPONENT_DESCRIPTION_CONTENT_TYPE_PROPERTY, + DEFAULT_COMPONENT_DESCRIPTION_CONTENT_TYPE); + setProperty(SIZES_LABEL_TEXT_PROPERTY, + DEFAULT_SIZES_LABEL_TEXT); + setProperty(SIZES_LABEL_TEXT_NO_DOWNLOAD_PROPERTY, + DEFAULT_SIZES_LABEL_TEXT_NO_DOWNLOAD); + setProperty(DEFAULT_INSTALLATION_SIZE_PROPERTY, + DEFAULT_INSTALLATION_SIZE); + setProperty(DEFAULT_DOWNLOAD_SIZE_PROPERTY, + DEFAULT_DOWNLOAD_SIZE); + setProperty(OK_BUTTON_TEXT_PROPERTY, + DEFAULT_OK_BUTTON_TEXT); + setProperty(CANCEL_BUTTON_TEXT_PROPERTY, + DEFAULT_CANCEL_BUTTON_TEXT); + setProperty(DEFAULT_COMPONENT_DESCRIPTION_PROPERTY, + DEFAULT_DEFAULT_COMPONENT_DESCRIPTION); + + setProperty(ERROR_NO_CHANGES_PROPERTY, + DEFAULT_ERROR_NO_CHANGES); + setProperty(ERROR_NO_CHANGES_INSTALL_ONLY_PROPERTY, + DEFAULT_ERROR_NO_CHANGES_INSTALL_ONLY); + setProperty(ERROR_NO_RUNTIMES_INSTALL_ONLY_PROPERTY, + DEFAULT_ERROR_NO_RUNTIMES_INSTALL_ONLY); + setProperty(ERROR_NO_CHANGES_UNINSTALL_ONLY_PROPERTY, + DEFAULT_ERROR_NO_CHANGES_UNINSTALL_ONLY); + setProperty(ERROR_REQUIREMENT_INSTALL_PROPERTY, + DEFAULT_ERROR_REQUIREMENT_INSTALL); + setProperty(ERROR_CONFLICT_INSTALL_PROPERTY, + DEFAULT_ERROR_CONFLICT_INSTALL); + setProperty(ERROR_REQUIREMENT_UNINSTALL_PROPERTY, + DEFAULT_ERROR_REQUIREMENT_UNINSTALL); + setProperty(ERROR_NO_ENOUGH_SPACE_TO_DOWNLOAD_PROPERTY, + DEFAULT_ERROR_NO_ENOUGH_SPACE_TO_DOWNLOAD); + setProperty(ERROR_NO_ENOUGH_SPACE_TO_EXTRACT_PROPERTY, + DEFAULT_ERROR_NO_ENOUGH_SPACE_TO_EXTRACT); + setProperty(ERROR_EVERYTHING_IS_INSTALLED_PROPERTY, + DEFAULT_ERROR_EVERYTHING_IS_INSTALLED); + + setProperty(WARNING_NO_COMPATIBLE_JDK_FOUND, + DEFAULT_WARNING_NO_COMPATIBLE_JDK_FOUND); + setProperty(WARNING_NO_COMPATIBLE_JAVA_FOUND, + DEFAULT_WARNING_NO_COMPATIBLE_JAVA_FOUND); + setProperty(WARNING_NO_COMPATIBLE_JDK_FOUND_DEPENDENT, + DEFAULT_WARNING_NO_COMPATIBLE_JDK_FOUND_DEPENDENT); + + // initialize the registries used on the panel - see the initialize() and + // canExecute() method + try { + defaultRegistry = Registry.getInstance(); + bundledRegistry = new Registry(); + + final String bundledRegistryUri = System.getProperty( + Registry.BUNDLED_PRODUCT_REGISTRY_URI_PROPERTY); + if (bundledRegistryUri != null) { + bundledRegistry.loadProductRegistry(bundledRegistryUri); + } else { + bundledRegistry.loadProductRegistry( + Registry.DEFAULT_BUNDLED_PRODUCT_REGISTRY_URI); + } + } catch (InitializationException e) { + ErrorManager.notifyError("Cannot load bundled registry", e); + } + } + + @Override + public WizardUi getWizardUi() { + if (wizardUi == null) { + wizardUi = new NbWelcomePanelUi(this); + } + + return wizardUi; + } + + @Override + public boolean canExecuteForward() { + return canExecute(); + } + + @Override + public boolean canExecuteBackward() { + return canExecute(); + } + + @Override + public void initialize() { + super.initialize(); + + if (registriesFiltered) { + return; + } + + // we need to apply additional filters to the components tree - filter out + // the components which are not present in the bundled registry; if the + // bundled registry contains only one element - registry root, this means + // that we're running without any bundle, hence not filtering is required; + // additionally, we should not be suggesting to install tomcat by default, + // thus we should correct it's initial status + Product bundledProductSkip = null; + Product bundledProductToInstall = null; + if (bundledRegistry.getNodes().size() > 1) { + for (Product product: defaultRegistry.getProducts()) { + if (bundledRegistry.getProduct( + product.getUid(), + product.getVersion()) == null) { + product.setVisible(false); + + if (product.getStatus() == Status.TO_BE_INSTALLED) { + product.setStatus(Status.NOT_INSTALLED); + } + } else if (product.getUid().equals("tomcat") && + (product.getStatus() == Status.TO_BE_INSTALLED)) { + boolean stateFileUsed = System.getProperty( + Registry.SOURCE_STATE_FILE_PATH_PROPERTY) != null; + boolean sysPropInstallLocation = System.getProperty(product.getUid() + + StringUtils.DOT + + Product.INSTALLATION_LOCATION_PROPERTY) == null; + if(!stateFileUsed && sysPropInstallLocation) { + product.setStatus(Status.NOT_INSTALLED); + } + } else if(type.equals(BundleType.BUNDLEDPRODUCT) && product.getUid().equals(bundledproduct_name)) { + // current checking product in global registry is "bundledproduct_name", i.e jdk, javafxsdk, weblogic + if(product.getStatus() == Status.TO_BE_INSTALLED && + ExecutionMode.getCurrentExecutionMode() == ExecutionMode.NORMAL) { + // check if bundledproduct is already installed (i.e from another installer) + if(bundledProductAlreadyInstalled(product)) { + product.setStatus(Status.NOT_INSTALLED); + product.setVisible(false); + setProperty(BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_INSTALLED_TEXT, product.getDisplayName())); + bundledProductSkip = product; + } else { + // do not allow installation under non-admin user on windows + try { + if(doesBundledProductNeedPermissions(product) && + SystemUtils.isWindows() && !SystemUtils.isCurrentUserAdmin()) { + product.setStatus(Status.NOT_INSTALLED); + product.setVisible(false); + setProperty(BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_TEXT,product.getDisplayName())); + bundledProductSkip = product; + } + } catch (NativeException e){ + LogManager.log(e); + } + } + } else if(product.getStatus() == Status.INSTALLED && //have been installed by NBI installer + bundledRegistry.getProduct( + product.getUid(),product.getVersion())!=null){ //and it is the same product + setProperty(BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_INSTALLED_TEXT, + product.getDisplayName())); + bundledProductSkip = product; + } else if(product.getStatus() == Status.NOT_INSTALLED && //product filtered out by platform (for win 86/64) + bundledRegistry.getProduct( + product.getUid(),product.getVersion())!=null && + !SystemUtils.getCurrentPlatform().isCompatibleWith(product.getPlatforms().get(0))) { + setProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY, + product.getDisplayName())); + bundledProductSkip = product; + } + bundledProductToInstall = (bundledProductSkip == null)? product : null; + } else if (product.getUid().equals("javafxsdk")) { + if(product.getStatus() == Status.TO_BE_INSTALLED && + ExecutionMode.getCurrentExecutionMode() == ExecutionMode.NORMAL && + bundledProductAlreadyInstalled(product)) { // check if javafxsdk is already installed (i.e from another installer) + LogManager.log("... Changing javafxsdk status to NOT_INSTALLED"); + product.setStatus(Status.NOT_INSTALLED); + product.setVisible(false); + } + } + } + } + LogManager.log("... bundledProductSkip = " + bundledProductSkip); + LogManager.log("... bundledProductToInstall = " + bundledProductToInstall); + + if (bundledProductSkip != null) { //do not install bundledproduct + final Product javafxsdk = getJavaFXSDKProduct(); + if(type.isJDKBundle() && javafxsdk != null) { //do not install javafxsdk as well + // dont't install JavaFX if JDK is already installed or there is no permissions for its installation + javafxsdk.setStatus(bundledProductSkip.getStatus()); + javafxsdk.setVisible(bundledProductSkip.isVisible()); + LogManager.log("... Skipping JavaFX installation"); + } + + if (defaultRegistry.getProductsToInstall().isEmpty()) { + if (getProperty(BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY) != null) { + setProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT, + bundledProductSkip.getDisplayName())); + } else if (getProperty(BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_PROPERTY) != null) { + setProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT, + bundledProductSkip.getDisplayName())); + } else if (getProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY) != null) { + setProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY, + bundledProductSkip.getDisplayName())); + } + } + } + + final List toInstall = defaultRegistry.getProductsToInstall(); + + if(bundledProductToInstall != null) { // bundled product will be installed + boolean nbToInstall = false; + for(Product productToInstall : toInstall) { + if(productToInstall.getUid().equals("nb-base") || productToInstall.getUid().equals("nb-all")) { + nbToInstall = true; + break; + } + } + if(!nbToInstall) {//install only bundledproduct, NetBeans is already installed + LogManager.log("... NetBeans is already installed, install only bundled product"); + setProperty(BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT, + bundledProductToInstall.getDisplayName())); + } + } + /*if(toInstall.size()==1 && toInstall.get(0).getUid().equals(bundledproduct_name)) { // install only bundledproduct + setProperty(BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT_PROPERTY, + StringUtils.format(DEFAULT_BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT, + toInstall.get(0).getDisplayName())); + }*/ + registriesFiltered = true; + } + + // private ////////////////////////////////////////////////////////////////////// + private boolean canExecute() { + return bundledRegistry.getNodes().size() > 1; + } + + // package access + String getWarningMessage() { + List list = Registry.getInstance().getProductsToInstall(); + if (lastChosenProducts != null) { + if (list.containsAll(lastChosenProducts) && + list.size() == lastChosenProducts.size()) { + return lastWarningMessage; + } + } + lastChosenProducts = list; + lastWarningMessage = null; + + List jdkDependentProducts = new ArrayList (); + for (Product product : lastChosenProducts) { + final List dependencies = product.getDependencyByUid("nb-base"); + if (dependencies.size() > 0 && product.getUid().startsWith("nb-")) { + final List sources = + Registry.getInstance().getProducts(dependencies.get(0)); + if (sources.size() > 0) { + final Product nbProduct = sources.get(0); + if(nbProduct.getStatus() != Status.INSTALLED) { + continue; + } + List dependents = Registry.getInstance().getInavoidableDependents(nbProduct); + boolean requiresJDK = false; + for (Product pr : dependents) { + if (pr.getStatus().equals(Status.INSTALLED) && + "false".equals(pr.getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY))) { + // e.g. base and javase is installed and we install uml + requiresJDK = true; + } + } + requiresJDK = requiresJDK || "false".equals(product.getProperty(JdkLocationPanel.JRE_ALLOWED_PROPERTY)); + if (requiresJDK) { + final File nbLocation = nbProduct.getInstallationLocation(); + try { + final File javaHome = new File(NetBeansUtils.getJavaHome(nbLocation)); + if (JavaUtils.isJavaHome(javaHome) && !JavaUtils.isJdk(javaHome)) { + jdkDependentProducts.add(product); + continue; + } + } catch (IOException e) { + LogManager.log(ErrorLevel.DEBUG, e); + } + } + } + } + } + if (jdkDependentProducts.size() > 0) { + lastWarningMessage = StringUtils.format( + getProperty(WARNING_NO_COMPATIBLE_JDK_FOUND_DEPENDENT), + StringUtils.asString(jdkDependentProducts)); + LogManager.log(lastWarningMessage); + return lastWarningMessage; + } + + boolean hasNestedJre = false; + for (Product product : lastChosenProducts) { + if (product.getUid().equals("jre-nested")) { + hasNestedJre = true; + break; + } + } + + for (Product product : lastChosenProducts) { + for (WizardComponent c : product.getWizardComponents()) { + if (c.getClass().getName().equals(SearchForJavaAction.class.getName())) { + for (WizardComponent wc : product.getWizardComponents()) { + try { + Method m = wc.getClass().getMethod("getJdkLocationPanel"); + Wizard wizard = new Wizard(null, product.getWizardComponents(), -1, product, product.getClassLoader()); + wc.setWizard(wizard); + wc.getWizard().getContext().put(product); + wc.initialize(); + JdkLocationPanel jdkLocationPanel = (JdkLocationPanel) m.invoke(wc); + if (jdkLocationPanel.getSelectedLocation().equals(new File(StringUtils.EMPTY_STRING)) && !hasNestedJre) { + final String jreAllowed = jdkLocationPanel.getProperty( + JdkLocationPanel.JRE_ALLOWED_PROPERTY); + lastWarningMessage = StringUtils.format( + getProperty("false".equals(jreAllowed) ? + WARNING_NO_COMPATIBLE_JDK_FOUND : + WARNING_NO_COMPATIBLE_JAVA_FOUND)); + + LogManager.log(lastWarningMessage); + return lastWarningMessage; + } + } catch (NoSuchMethodException e) { + } catch (IllegalAccessException e) { + } catch (IllegalArgumentException e) { + } catch (InvocationTargetException e) { + } + } + } + } + } + return null; + } + ///////////////////////////////////////////////////////////////////////////////// + // Inner Classes + public static class NbWelcomePanelUi extends ErrorMessagePanelUi { + protected NbWelcomePanel component; + + public NbWelcomePanelUi(NbWelcomePanel component) { + super(component); + + this.component = component; + } + + @Override + public SwingUi getSwingUi(SwingContainer container) { + if (swingUi == null) { + swingUi = new NbWelcomePanelSwingUi(component, container); + } + + return super.getSwingUi(container); + } + } + + public static class NbWelcomePanelSwingUi extends ErrorMessagePanelSwingUi { + protected NbWelcomePanel panel; + + private NbiTextPane textPane; + private NbiTextPane detailsTextPane; + private NbiLabel detailsWarningIconLabel; + private NbiTextPane textScrollPane; + private NbiScrollPane scrollPane; + private NbiButton customizeButton; + private NbiLabel installationSizeLabel; + + private NbCustomizeSelectionDialog customizeDialog; + private NbiPanel leftImagePanel; + + private List registryNodes; + + private boolean everythingIsInstalled; + private boolean netBeansIsInstalled; + + ValidatingThread validatingThread; + + public NbWelcomePanelSwingUi( + final NbWelcomePanel component, + final SwingContainer container) { + super(component, container); + + this.panel = component; + + registryNodes = new LinkedList(); + populateList( + registryNodes, + Registry.getInstance().getRegistryRoot()); + + initComponents(); + } + + @Override + public String getTitle() { + return null; // the welcome page does not have a title + } + + // protected //////////////////////////////////////////////////////////////// + @Override + protected void initializeContainer() { + super.initializeContainer(); + + container.getBackButton().setVisible(false); + } + + @Override + protected void initialize() { + StringBuilder welcomeText = new StringBuilder(); + String header = StringUtils.format(panel.getProperty(WELCOME_TEXT_HEADER_PROPERTY)); + + if(type.equals(BundleType.BUNDLEDPRODUCT)) { + for(Product product : panel.getBundledRegistry().getProducts(bundledproduct_name)) { + header = StringUtils.format(header, product.getDisplayName()); + panel.setProperty(WELCOME_TEXT_DETAILS_PROPERTY, + StringUtils.format(panel.getProperty(WELCOME_TEXT_DETAILS_PROPERTY), + product.getDisplayName())); + break; + } + } + + welcomeText.append(header); + welcomeText.append(panel.getProperty(WELCOME_TEXT_FOOTER_PROPERTY)); + textPane.setContentType( + panel.getProperty(TEXT_PANE_CONTENT_TYPE_PROPERTY)); + textPane.setText(welcomeText); + StringBuilder detailsText = new StringBuilder( + panel.getProperty(WELCOME_TEXT_OPENTAG_PROPERTY)); + boolean warningIcon = false; + boolean installFXSDKMessage = false; + if(panel.getProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY)); + warningIcon = true; + } else if(panel.getProperty(BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT_PROPERTY)!=null) { + detailsText.append(panel.getProperty(BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT_PROPERTY)); + warningIcon = true; + installFXSDKMessage = true; + } else { + detailsText.append(panel.getProperty(WELCOME_TEXT_DETAILS_PROPERTY)); + installFXSDKMessage = true; + } + + //For JDK and JavaFX SDK bundle + final Product javafxsdk = panel.getJavaFXSDKProduct(); + if(type.isJDKBundle() && javafxsdk != null && installFXSDKMessage) { + if(javafxsdk.getStatus().equals(Status.TO_BE_INSTALLED)) { //install jdk && javafxsdk + LogManager.log("... JavaFX SDK will be installed"); + detailsText.append(StringUtils.format(DEFAULT_ADDITIONAL_PRODUCT_TO_BE_INSTALLED_TEXT_PROPERTY, + javafxsdk.getDisplayName())); + } else { //install jdk but do not install javafxsdk + LogManager.log("... JavaFX SDK is already installed; status is " + javafxsdk.getStatus()); + detailsText.append(StringUtils.format(DEFAULT_ADDITIONAL_PRODUCT_ALREADY_INSTALLED_TEXT_PROPERTY, + javafxsdk.getDisplayName())); + } + } + ///////////////////////////////// + detailsTextPane.setContentType( + panel.getProperty(TEXT_PANE_CONTENT_TYPE_PROPERTY)); + + detailsTextPane.setText(detailsText.toString()); + if(warningIcon) { + detailsWarningIconLabel.setIcon(new ImageIcon( + getClass().getClassLoader().getResource(WARNING_ICON))); + } else { + detailsWarningIconLabel.setVisible(false); + } + + + everythingIsInstalled = true; + netBeansIsInstalled = true; + welcomeText = new StringBuilder( + panel.getProperty(WELCOME_TEXT_OPENTAG_PROPERTY)); + for (RegistryNode node: registryNodes) { + if (node instanceof Product) { + final Product product = (Product) node; + final String productUid = product.getUid(); + if (product.getUid().equals("glassfish") + || product.getUid().equals("glassfish-mod") + || product.getUid().equals("glassfish-mod-sun") + || product.getUid().equals("tomcat") + || product.getUid().equals("mysql")) { + + List otherRuntimes = Registry.getInstance().queryProducts( + new ProductFilter( + product.getUid(), + null, //product.getVersion(), + product.getPlatforms())); + + for (Product other : otherRuntimes) { + if (other.getStatus().equals(Status.INSTALLED)) { + if (product.getVersion().getMajor() == other.getVersion().getMajor() + && product.getVersion().getMicro() == other.getVersion().getMicro() + && product.getVersion().getMinor() == other.getVersion().getMinor() + && ((product.getVersion().getUpdate() != other.getVersion().getUpdate()) + || (product.getVersion().getBuild() != other.getVersion().getBuild()))) { + product.setStatus(Status.INSTALLED_DIFFERENT_BUILD); + } + } + } + } + if (product.getStatus() == Status.INSTALLED) { + if(type.equals(BundleType.CUSTOMIZE) || type.equals(BundleType.JAVA)) { + welcomeText.append(StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + } + } else if (product.getStatus() == Status.INSTALLED_DIFFERENT_BUILD) { + if(type.equals(BundleType.CUSTOMIZE) || type.equals(BundleType.JAVA)) { + welcomeText.append(StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + } + } else if (product.getStatus() == Status.TO_BE_INSTALLED) { + if(type.equals(BundleType.CUSTOMIZE) || type.equals(BundleType.JAVA)) { + welcomeText.append(StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + } + if(productUid.startsWith("nb-")) { + netBeansIsInstalled = false; + } + everythingIsInstalled = false; + } else if ((product.getStatus() == Status.NOT_INSTALLED)) { + if(productUid.startsWith("nb-")) { + netBeansIsInstalled = false; + } + everythingIsInstalled = false; + } else { + continue; + } + } else if (node instanceof Group) { + final RegistryFilter filter = new AndFilter( + new ProductFilter(true), + new OrFilter( + new ProductFilter(Status.TO_BE_INSTALLED), + new ProductFilter(Status.INSTALLED))); + + if (node.hasChildren(filter)) { + if(type.equals(BundleType.CUSTOMIZE) || type.equals(BundleType.JAVA)) { + welcomeText.append(StringUtils.format( + panel.getProperty(WELCOME_TEXT_GROUP_TEMPLATE_PROPERTY), + node.getDisplayName())); + } + } + } + } + + welcomeText.append(panel.getProperty(WELCOME_TEXT_FOOTER_PROPERTY)); + + textScrollPane.setContentType( + panel.getProperty(TEXT_PANE_CONTENT_TYPE_PROPERTY)); + textScrollPane.setText(welcomeText); + textScrollPane.setCaretPosition(0); + customizeButton.setText( + panel.getProperty(CUSTOMIZE_BUTTON_TEXT_PROPERTY)); + + scrollPane.getViewport().setMinimumSize( + textScrollPane.getPreferredScrollableViewportSize()); + updateSizes(); + super.initialize(); + } + + private void updateSizes() { + long installationSize = 0; + for (Product product: Registry.getInstance().getProductsToInstall()) { + installationSize += product.getRequiredDiskSpace(); + } + + if (installationSize == 0) { + installationSizeLabel.setText(StringUtils.EMPTY_STRING); + } else { + installationSizeLabel.setText(StringUtils.format( + panel.getProperty(INSTALLATION_SIZE_LABEL_TEXT_PROPERTY), + StringUtils.formatSize(installationSize))); + } + } + + @Override + protected String getWarningMessage() { + String message = super.getWarningMessage(); + return (message!=null) ? message: panel.getWarningMessage(); + } + + @Override + protected String validateInput() { + if (everythingIsInstalled) { + customizeButton.setEnabled(false); + installationSizeLabel.setVisible(false); + + return panel.getProperty(ERROR_EVERYTHING_IS_INSTALLED_PROPERTY); + } else { + customizeButton.setEnabled(true); + installationSizeLabel.setVisible(true); + } + + final List products = + Registry.getInstance().getProductsToInstall(); + + if (products.isEmpty()) { + // if (!everythingIsInstalled) && (netBeansIsInstalled) + // => there are runtimes to install => show ERROR_NO_RUNTIMES_INSTALL_ONLY_PROPERTY + return netBeansIsInstalled ? + panel.getProperty(ERROR_NO_RUNTIMES_INSTALL_ONLY_PROPERTY): + panel.getProperty(ERROR_NO_CHANGES_INSTALL_ONLY_PROPERTY); + } + + String template = panel.getProperty( + ERROR_NO_ENOUGH_SPACE_TO_EXTRACT_PROPERTY); + for (Product product: products) { + if (product.getRegistryType() == RegistryType.REMOTE) { + template = panel.getProperty( + ERROR_NO_ENOUGH_SPACE_TO_DOWNLOAD_PROPERTY); + break; + } + } + + try { + if(!Boolean.getBoolean(SystemUtils.NO_SPACE_CHECK_PROPERTY)) { + final long availableSize = SystemUtils.getFreeSpace( + Installer.getInstance().getLocalDirectory()); + + long requiredSize = 0; + for (Product product: products) { + requiredSize += product.getDownloadSize(); + } + requiredSize += REQUIRED_SPACE_ADDITION; + + if (availableSize < requiredSize) { + return StringUtils.format( + template, + Installer.getInstance().getLocalDirectory(), + StringUtils.formatSize(requiredSize - availableSize)); + } + } + } catch (NativeException e) { + ErrorManager.notifyError( + "Cannot check the free disk space", + e); + } + + return null; + } + + // private ////////////////////////////////////////////////////////////////// + private void initComponents() { + // textPane ///////////////////////////////////////////////////////////// + textPane = new NbiTextPane(); + + // textScrollPane ///////////////////////////////////////////////////////////// + textScrollPane = new NbiTextPane(); + textScrollPane.setOpaque(true); + textScrollPane.setBackground(Color.WHITE); + + detailsTextPane = new NbiTextPane(); + detailsTextPane.setOpaque(true); + detailsTextPane.setBackground(Color.WHITE); + + // scrollPane //////////////////////////////////////////////////// + scrollPane = new NbiScrollPane(textScrollPane); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scrollPane.setViewportBorder(new EmptyBorder(new Insets(0, 0, 0, 0))); + scrollPane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0))); + + // customizeButton ////////////////////////////////////////////////////// + customizeButton = new NbiButton(); + customizeButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + customizeButtonPressed(); + } + }); + + // installationSizeLabel //////////////////////////////////////////////// + installationSizeLabel = new NbiLabel(); + + + leftImagePanel = new NbiPanel(); + int width = 0; + int height = 0; + final String topLeftImage = SystemUtils.resolveString( + System.getProperty( + WELCOME_PAGE_LEFT_TOP_IMAGE_PROPERTY)); + final String bottomLeftImage = SystemUtils.resolveString( + System.getProperty( + WELCOME_PAGE_LEFT_BOTTOM_IMAGE_PROPERTY)); + final String backgroundImage = SystemUtils.resolveString( + System.getProperty( + WELCOME_PAGE_BACKGROUND_IMAGE_PROPERTY)); + + /* For Sun's JDK branding + int bottomAnchor = NbiPanel.ANCHOR_BOTTOM_LEFT; + if(type.isJDKBundle() || type.equals(BundleType.JAVA_TOOLS)) { + bottomAnchor = NbiPanel.ANCHOR_FULL; + }*/ + + if(backgroundImage!=null) { + leftImagePanel.setBackgroundImage(backgroundImage, NbiPanel.ANCHOR_FULL); + } + if(topLeftImage!=null) { + leftImagePanel.setBackgroundImage(topLeftImage,NbiPanel.ANCHOR_TOP_LEFT); + width = leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_TOP_LEFT).getIconWidth(); + height += leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_TOP_LEFT).getIconHeight(); + } + if(bottomLeftImage!=null) { + leftImagePanel.setBackgroundImage(bottomLeftImage, NbiPanel.ANCHOR_BOTTOM_LEFT); + width = leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_BOTTOM_LEFT).getIconWidth(); + height += leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_BOTTOM_LEFT).getIconHeight(); + } + if(backgroundImage != null) { + width = leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_FULL).getIconWidth(); + height = leftImagePanel.getBackgroundImage(NbiPanel.ANCHOR_FULL).getIconHeight(); + } + + leftImagePanel.setPreferredSize(new Dimension(width,height)); + leftImagePanel.setMaximumSize(new Dimension(width,height)); + leftImagePanel.setMinimumSize(new Dimension(width,0)); + leftImagePanel.setSize(new Dimension(width,height)); + + leftImagePanel.setOpaque(false); + // this ///////////////////////////////////////////////////////////////// + int dy = 0; + add(leftImagePanel, new GridBagConstraints( + 0, 0, // x, y + 1, 100, // width, height + 0.0, 1.0, // weight-x, weight-y + GridBagConstraints.WEST, // anchor + GridBagConstraints.VERTICAL, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ??? + add(textPane, new GridBagConstraints( + 1, dy++, // x, y + 4, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(10, 11, 11, 11), // padding + 0, 0)); // padx, pady - ??? + detailsWarningIconLabel = new NbiLabel(); + add(detailsWarningIconLabel, new GridBagConstraints( + 1, dy, // x, y + 1, 1, // width, height + 0.0, 0.0, // weight-x, weight-y + GridBagConstraints.NORTHWEST, // anchor + GridBagConstraints.NONE, // fill + new Insets(2, 11, 0, 0), // padding + 0, 0)); // padx, pady - ??? + add(detailsTextPane, new GridBagConstraints( + 2, dy++, // x, y + 3, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.WEST, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(2, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + NbiTextPane separatorPane = new NbiTextPane(); + BundleType type = BundleType.getType( + System.getProperty(WELCOME_PAGE_TYPE_PROPERTY)); + if(!type.equals(BundleType.JAVAEE) && !type.equals(BundleType.RUBY) && + !type.equals(BundleType.JAVA_TOOLS) && !type.equals(BundleType.MYSQL)) { + add(scrollPane, new GridBagConstraints( + 1, dy++, // x, y + 4, 1, // width, height + 1.0, 10.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + }else { + for (RegistryNode node: registryNodes) { + if (node instanceof Product) { + final Product product = (Product) node; + if(product.getUid().equals("glassfish") || + product.getUid().equals("glassfish-mod") || + product.getUid().equals("glassfish-mod-sun") || + product.getUid().equals("tomcat") || + product.getUid().equals("mysql")) { + final NbiCheckBox chBox; + if (product.getStatus() == Status.INSTALLED) { + chBox = new NbiCheckBox(); + chBox.setText( "" + + StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + chBox.setSelected(true); + chBox.setEnabled(false); + } else if (product.getStatus() == Status.INSTALLED_DIFFERENT_BUILD) { + chBox = new NbiCheckBox(); + chBox.setText("" + + StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + chBox.setSelected(false); + chBox.setEnabled(false); + } else if (product.getStatus() == Status.TO_BE_INSTALLED) { + chBox = new NbiCheckBox(); + chBox.setText("" + + StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + chBox.setSelected(true); + chBox.setEnabled(true); + } else if (product.getStatus() == Status.NOT_INSTALLED) { + chBox = new NbiCheckBox(); + chBox.setText("" + + StringUtils.format( + panel.getProperty(WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE_PROPERTY), + node.getDisplayName())); + chBox.setSelected(false); + chBox.setEnabled(true); + } else { + chBox = null; + } + if(chBox != null) { + chBox.setOpaque(false); + + //chBox.setPreferredSize(new Dimension(chBox.getPreferredSize().width, + // chBox.getPreferredSize().height-2)); + chBox.setBorder(new EmptyBorder(0,0,0,0)); + add(chBox,new GridBagConstraints( + 1, dy++, // x, y + 4, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(0, 11, 0, 0), // padding + 0, 0)); + chBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if(chBox.isSelected()) { + product.setStatus(Status.TO_BE_INSTALLED); + } else { + product.setStatus(Status.NOT_INSTALLED); + } + updateErrorMessage(); + updateSizes(); + } + }); + + } + } + } + } + add(separatorPane , new GridBagConstraints( + 1, dy++, // x, y + 4, 1, // width, height + 1.0, 2.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ??? + } + add(customizeButton, new GridBagConstraints( + 1, dy, // x, y + 2, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.LINE_START, // anchor + GridBagConstraints.NONE, // fill + new Insets(10, 11, 0, 0), // padding + 0, 0)); // padx, pady - ??? + separatorPane = new NbiTextPane(); + add(separatorPane , new GridBagConstraints( + 3, dy, // x, y + 1, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.BOTH, // fill + new Insets(0, 0, 0, 0), // padding + 0, 0)); // padx, pady - ??? + + add(installationSizeLabel, new GridBagConstraints( + 4, dy, // x, y + 1, 1, // width, height + 0.0, 0.0, // weight-x, weight-y + GridBagConstraints.EAST, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(10, 11, 0, 11), // padding + 0, 0)); // padx, pady - ??? + + // move error label after the left welcome image + Component errorLabel = getComponent(0); + getLayout().removeLayoutComponent(errorLabel); + add(errorLabel, new GridBagConstraints( + 1, 99, // x, y + 99, 1, // width, height + 1.0, 0.0, // weight-x, weight-y + GridBagConstraints.CENTER, // anchor + GridBagConstraints.HORIZONTAL, // fill + new Insets(4, 11, 4, 0), // padding + 0, 0)); // ??? (padx, pady) + + // platform-specific tweak ////////////////////////////////////////////// + if (SystemUtils.isMacOS()) { + customizeButton.setOpaque(false); + } + + if(type.equals(BundleType.CUSTOMIZE) || type.equals(BundleType.JAVA) || + type.equals(BundleType.JAVA_TOOLS)) { + customizeButton.setVisible(true); + } else { + customizeButton.setVisible(false); + } + } + + private void customizeButtonPressed() { + if (customizeDialog == null) { + final Runnable callback = new Runnable() { + public void run() { + initialize(); + } + }; + NbiFrame owner = null; + if(container instanceof SwingFrameContainer) { + owner = (SwingFrameContainer) container; + } + customizeDialog = new NbCustomizeSelectionDialog( + owner, + panel, + callback, + registryNodes); + } + + customizeDialog.setVisible(true); + customizeDialog.requestFocus(); + } + + private void populateList( + final List list, + final RegistryNode parent) { + final List groups = new LinkedList(); + for (RegistryNode node: parent.getChildren()) { + if (!node.isVisible() || Boolean.FALSE.toString().equals(node.getProperty("show-in-wizard"))) { + continue; + } + + if (node instanceof Product) { + if (!SystemUtils.getCurrentPlatform().isCompatibleWith( + ((Product) node).getPlatforms())) { + continue; + } + list.add(node); + } + + if (node instanceof Group) { + if (node.hasChildren(new ProductFilter(true))) { + groups.add(node); + } + } + } + + for (RegistryNode node: groups) { + list.add(node); + if(!node.getUid().equals("nb-ide-group")) { + populateList(list, node); + } + } + } + } + + public Registry getBundledRegistry() { + return bundledRegistry; + } + + + public enum BundleType { + JAVASE("javase"), + JAVAEE("javaee"), + JAVA("java"), + JAVAME("javame"), + RUBY("ruby"), + HTML("html"), + PHP("php"), + CND("cnd"), + JAVAFX("javafx"), + CUSTOMIZE("customize"), + JAVA_TOOLS("java.tools"), + MYSQL("mysql"), + BUNDLEDPRODUCT("bundledproduct"), + NBALL("nb-all"); + + private String name; + private BundleType(String s) { + this.name = s; + } + public static BundleType getType(String s) { + if(s!=null) { + for(BundleType type : BundleType.values()) + if(type.toString().equals(s)) { + return type; + } + } + return CUSTOMIZE; + } + @Override + public String toString() { + return name; + } + public boolean isJDKBundle() { + return (name.equals("bundledproduct") && bundledproduct_name.contains("jdk")) + || name.endsWith(".jdk"); + } + + public boolean isWebLogicBundle() { + return (name.equals("bundledproduct") && bundledproduct_name.contains("weblogic")); + } + public String getNetBeansBundleId() { + if(isJDKBundle()) { + return "NBJDK"; + } else if(this.equals(JAVA_TOOLS)) { + return "NBEETOOLS"; + } else if(this.equals(MYSQL)) { + return "NBMYSQL"; + } else if(isWebLogicBundle()) { + return "NBWEBLOGIC"; + } else if(this.equals(JAVAFX)) { + return "NB"; + } else { + return "NB"; + } + } + } + + private boolean bundledProductAlreadyInstalled(Product product) { + if(product.getUid().equals("jdk")) { + return JavaUtils.findJDKHome(product.getVersion())!= null; + } else if(product.getUid().equals("javafxsdk")) { + return JavaFXUtils.getJavaFXSDKInstallationPath(product.getPlatforms().get(0)) != null; + } else if(product.getUid().equals("weblogic")) { + return false; // research if it is possible to know if WL is already installed by standalone installer + } + return false; + } + + private boolean doesBundledProductNeedPermissions(Product product) { + if(product.getUid().equals("weblogic")) { + return true; + } else if(product.getUid().equals("jdk")) { + return true; + } + return false; + } + + private Product getJavaFXSDKProduct() { + final List products = defaultRegistry.getProducts("javafxsdk"); + Product javafxsdk = null; + for(Product product : products) { + if(bundledRegistry.getProduct(product.getUid(),product.getVersion()) != null) { + javafxsdk = product; + break; + } + } + if(javafxsdk != null) { + LogManager.log("... javafxsdk product is found: " + javafxsdk.getDisplayName() + + " with the status: " + javafxsdk.getStatus()); + } + return javafxsdk; + } + + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String DEFAULT_TITLE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.title"); // NOI18N + public static final String DEFAULT_DESCRIPTION = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.description"); // NOI18N + + public static final String TEXT_PANE_CONTENT_TYPE_PROPERTY = + "text.pane.content.type"; // NOI18N + public static final String WELCOME_TEXT_HEADER_PROPERTY = + "welcome.text.header"; // NOI18N + public static final String WELCOME_TEXT_DETAILS_PROPERTY = + "welcome.text.details"; // NOI18N + public static final String WELCOME_TEXT_GROUP_TEMPLATE_PROPERTY = + "welcome.text.group.template"; // NOI18N + public static final String WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE_PROPERTY = + "welcome.text.product.installed.template"; // NOI18N + public static final String WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE_PROPERTY = + "welcome.text.product.different.build.installed.template"; // NOI18N + public static final String WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE_PROPERTY = + "welcome.text.product.not.installed.template"; // NOI18N + public static final String WELCOME_TEXT_OPENTAG_PROPERTY = + "welcome.text.opentag"; // NOI18N + public static final String WELCOME_TEXT_FOOTER_PROPERTY = + "welcome.text.footer"; // NOI18N + public static final String CUSTOMIZE_BUTTON_TEXT_PROPERTY = + "customize.button.text"; // NOI18N + public static final String INSTALLATION_SIZE_LABEL_TEXT_PROPERTY = + "installation.size.label.text"; // NOI18N + + public static final String BUNDLEDPRODUCT_INSTALLED_TEXT_PROPERTY = + "bundledproduct.already.installed.text";//NOI18N + public static final String BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT_PROPERTY = + "bundledproduct.everything.installed.text";//NOI18N + public static final String BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT_PROPERTY = + "bundledproduct.everything.installed.unsufficient.permissions.text";//NOI18N + public static final String BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT_PROPERTY = + "bundledproduct.netbeans.installed.text";//NOI18N + public static final String BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_PROPERTY = + "bundledproduct.unsufficient.permissions";//NOI18N + public static final String BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY = + "bundledproduct.not.installable.text";//NOI18N + public static final String BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY = + "bundledproduct.not.installable.netbeans.installed.text";//NOI18N + + public static final String DEFAULT_TEXT_PANE_CONTENT_TYPE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.text.pane.content.type"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_HEADER = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.header"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_HEADER_JTB = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.header.jtb"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_HEADER_MYSQL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.header.nbgfmysql"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_HEADER_BUNDLEDPRODUCT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.header.nbbundledproduct"); // NOI18N + + + public static final String WELCOME_TEXT_HEADER_APPENDING_PROPERTY = + "NWP.welcome.text.header"; // NOI18N + + public static final String WELCOME_PAGE_TYPE_PROPERTY = + "NWP.welcome.page.type"; + + public static final String WELCOME_PAGE_BUNDLEDPRODUCT_NAME_PROPERTY = + "NWP.welcome.page.bundledproduct.name"; + + public static final String DEFAULT_WELCOME_TEXT_GROUP_TEMPLATE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.group.template"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_PRODUCT_INSTALLED_TEMPLATE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.product.installed.template"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_PRODUCT_DIFFERENT_BUILD_INSTALLED_TEMPLATE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.product.different.build.installed.template"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_PRODUCT_NOT_INSTALLED_TEMPLATE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.product.not.installed.template"); // NOI18N + public static final String DEFAULT_WELCOME_TEXT_OPENTAG = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.opentag"); + public static final String DEFAULT_WELCOME_TEXT_FOOTER = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.welcome.text.footer"); // NOI18N + public static final String DEFAULT_CUSTOMIZE_BUTTON_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.customize.button.text"); // NOI18N + public static final String DEFAULT_INSTALLATION_SIZE_LABEL_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.installation.size.label.text"); // NOI18N + + public static final String DEFAULT_BUNDLEDPRODUCT_INSTALLED_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.installed.text"); // NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_EVERYTHING_INSTALLED_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.everything.installed.text"); // NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_EVERYTHING_INSTALLED_UNSUFFICIENT_PERMISSIONS_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.everything.installed.admin.warning.text"); // NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_NETBEANS_INSTALLED_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.netbeans.installed.text");//NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_UNSUFFICIENT_PERMISSIONS_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.welcome.admin.warning.text");//NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_NOT_COMPATIBLE_TEXT_PROPERTY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.not.installable.text");//NOI18N + public static final String DEFAULT_BUNDLEDPRODUCT_NOT_COMPATIBLE_NETBEANS_INSTALLED_TEXT_PROPERTY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.bundledproduct.not.installable.netbeans.installed.text");//NOI18N + + public static final String DEFAULT_ADDITIONAL_PRODUCT_TO_BE_INSTALLED_TEXT_PROPERTY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.additional.product.to.be.installed"); // NOI18N + public static final String DEFAULT_ADDITIONAL_PRODUCT_ALREADY_INSTALLED_TEXT_PROPERTY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.additional.product.already.installed"); // NOI18N + + + public static final String CUSTOMIZE_TITLE_PROPERTY = + "customize.title"; // NOI18N + public static final String MESSAGE_PROPERTY = + "message"; // NOI18N + public static final String MESSAGE_INSTALL_PROPERTY = + "message.install"; // NOI18N + public static final String MESSAGE_UNINSTALL_PROPERTY = + "message.uninstall"; // NOI18N + public static final String COMPONENT_DESCRIPTION_TEXT_PROPERTY = + "component.description.text"; // NOI18N + public static final String COMPONENT_DESCRIPTION_CONTENT_TYPE_PROPERTY = + "component.description.content.type"; // NOI18N + public static final String SIZES_LABEL_TEXT_PROPERTY = + "sizes.label.text"; // NOI18N + public static final String SIZES_LABEL_TEXT_NO_DOWNLOAD_PROPERTY = + "sizes.label.text.no.download"; // NOI18N + public static final String DEFAULT_INSTALLATION_SIZE_PROPERTY = + "default.installation.size"; // NOI18N + public static final String DEFAULT_DOWNLOAD_SIZE_PROPERTY = + "default.download.size"; // NOI18N + public static final String OK_BUTTON_TEXT_PROPERTY = + "ok.button.text"; // NOI18N + public static final String CANCEL_BUTTON_TEXT_PROPERTY = + "cancel.button.text"; // NOI18N + public static final String DEFAULT_COMPONENT_DESCRIPTION_PROPERTY = + "default.component.description"; + public static final String WELCOME_PAGE_LEFT_TOP_IMAGE_PROPERTY = + "nbi.wizard.ui.swing.welcome.left.top.image";//NOI18N + public static final String WELCOME_PAGE_LEFT_BOTTOM_IMAGE_PROPERTY = + "nbi.wizard.ui.swing.welcome.left.bottom.image";//NOI18N + public static final String WELCOME_PAGE_BACKGROUND_IMAGE_PROPERTY = + "nbi.wizard.ui.swing.welcome.background.image";//NOI18N + public static final String DEFAULT_CUSTOMIZE_TITLE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.customize.title"); // NOI18N + public static final String DEFAULT_MESSAGE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.message.both"); // NOI18N + public static final String DEFAULT_MESSAGE_INSTALL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.message.install"); // NOI18N + public static final String DEFAULT_MESSAGE_UNINSTALL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.message.uninstall"); // NOI18N + public static final String DEFAULT_COMPONENT_DESCRIPTION_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.component.description.text"); // NOI18N + public static final String DEFAULT_COMPONENT_DESCRIPTION_CONTENT_TYPE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.component.description.content.type"); // NOI18N + public static final String DEFAULT_SIZES_LABEL_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.sizes.label.text"); // NOI18N + public static final String DEFAULT_SIZES_LABEL_TEXT_NO_DOWNLOAD = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.sizes.label.text.no.download"); // NOI18N + public static final String DEFAULT_INSTALLATION_SIZE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.default.installation.size"); // NOI18N + public static final String DEFAULT_DOWNLOAD_SIZE = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.default.download.size"); // NOI18N + public static final String DEFAULT_OK_BUTTON_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.ok.button.text"); // NOI18N + public static final String DEFAULT_CANCEL_BUTTON_TEXT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.cancel.button.text"); // NOI18N + public static final String DEFAULT_DEFAULT_COMPONENT_DESCRIPTION = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.default.component.description"); // NOI18N + + public static final String ERROR_NO_CHANGES_PROPERTY = + "error.no.changes.both"; // NOI18N + public static final String ERROR_NO_CHANGES_INSTALL_ONLY_PROPERTY = + "error.no.changes.install"; // NOI18N + public static final String ERROR_NO_RUNTIMES_INSTALL_ONLY_PROPERTY = + "error.no.runtimes.install"; // NOI18N + public static final String ERROR_NO_CHANGES_UNINSTALL_ONLY_PROPERTY = + "error.no.changes.uninstall"; // NOI18N + public static final String ERROR_REQUIREMENT_INSTALL_PROPERTY = + "error.requirement.install"; // NOI18N + public static final String ERROR_CONFLICT_INSTALL_PROPERTY = + "error.conflict.install"; // NOI18N + public static final String ERROR_REQUIREMENT_UNINSTALL_PROPERTY = + "error.requirement.uninstall"; // NOI18N + public static final String ERROR_NO_ENOUGH_SPACE_TO_DOWNLOAD_PROPERTY = + "error.not.enough.space.to.download"; // NOI18N + public static final String ERROR_NO_ENOUGH_SPACE_TO_EXTRACT_PROPERTY = + "error.not.enough.space.to.extract"; // NOI18N + public static final String ERROR_EVERYTHING_IS_INSTALLED_PROPERTY = + "error.everything.is.installed"; // NOI18N + public static final String WARNING_NO_COMPATIBLE_JDK_FOUND = + "warning.no.compatible.jdk.found"; //NOI18N + public static final String WARNING_NO_COMPATIBLE_JAVA_FOUND = + "warning.no.compatible.java.found";//NOI18N + public static final String WARNING_NO_COMPATIBLE_JDK_FOUND_DEPENDENT = + "warning.no.compatible.jdk.found.dependent";//NOI18N + + public static final String DEFAULT_ERROR_NO_CHANGES = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.no.changes.both"); // NOI18N + public static final String DEFAULT_ERROR_NO_CHANGES_INSTALL_ONLY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.no.changes.install"); // NOI18N + public static final String DEFAULT_ERROR_NO_RUNTIMES_INSTALL_ONLY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.no.runtimes.install"); // NOI18N + public static final String DEFAULT_ERROR_NO_CHANGES_UNINSTALL_ONLY = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.no.changes.uninstall"); // NOI18N + public static final String DEFAULT_ERROR_REQUIREMENT_INSTALL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.requirement.install"); // NOI18N + public static final String DEFAULT_ERROR_CONFLICT_INSTALL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.conflict.install"); // NOI18N + public static final String DEFAULT_ERROR_REQUIREMENT_UNINSTALL = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.requirement.uninstall"); // NOI18N + public static final String DEFAULT_ERROR_NO_ENOUGH_SPACE_TO_DOWNLOAD = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.not.enough.space.to.download"); // NOI18N + public static final String DEFAULT_ERROR_NO_ENOUGH_SPACE_TO_EXTRACT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.not.enough.space.to.extract"); // NOI18N + public static final String DEFAULT_ERROR_EVERYTHING_IS_INSTALLED = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.error.everything.is.installed"); // NOI18N + public static final String DEFAULT_WARNING_NO_COMPATIBLE_JDK_FOUND = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.warning.no.compatible.jdk.found"); // NOI18N + public static final String DEFAULT_WARNING_NO_COMPATIBLE_JAVA_FOUND = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.warning.no.compatible.java.found"); // NOI18N + public static final String DEFAULT_WARNING_NO_COMPATIBLE_JDK_FOUND_DEPENDENT = + ResourceUtils.getString(NbWelcomePanel.class, + "NWP.warning.no.compatible.jdk.found.dependent"); // NOI18N + + + public static final long REQUIRED_SPACE_ADDITION = + 10L * 1024L * 1024L; // 10MB +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png new file mode 100644 index 000000000000..d8c41f7dc4c7 Binary files /dev/null and b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-bottom.png differ diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png new file mode 100644 index 000000000000..5069f0eb88fc Binary files /dev/null and b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/panels/netbeans/resources/welcome-left-top.png differ diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/Bundle.properties b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/Bundle.properties new file mode 100644 index 000000000000..f55d864cb587 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/Bundle.properties @@ -0,0 +1,56 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +# MainSequence.java +NBMS.IA.title=Installation +NBMS.IA.description=Please wait while the installer installs NetBeans IDE and runtimes. + +NBMS.CACHE.title=Completing NetBeans IDE installation +NBMS.CACHE.generate=Validation +NBMS.CACHE.CheckForUpdate=Checking for Updates +NBMS.CACHE.InstallJUnit=Installing JUnit library +NBMS.CACHE.CheckForUpdateInstallJUnit=Checking for Updates and install JUnit library +NBMS.CACHE.cleaning=Cleaning up temporary data +NBMS.CACHE.NetworkProblemBoth=Some network problem found.\n\ +Check your network connection and use Plugin Manager in NetBeans IDE.\n\n +NBMS.CACHE.NetworkProblemJunit=Installation of JUnit library failed.\n\ +Check your network connection and use Plugin Manager in NetBeans IDE to install JUnit library later.\n\n +NBMS.CACHE.NetworkProblemUpdates=Checking for updates failed.\n\ +Check your network connection and use Plugin Manager in NetBeans IDE to check for updates.\n\n +NBMS.CACHE.ProblemInstallJUnit=Installation of JUnit library failed.\n\ +To install JUnit library you can use Plugin Manager in NetBeans IDE.\n\n +NBMS.CACHE.ProblemInstallUpdates=Installation of {0} updates failed.\n\ +To install available updates you can use Plugin Manager in NetBeans IDE.\n\n + +#Success if install JUnit and Check For Updates +NBMS.CACHE.SuccessIfBoth_JUnitInstalled_UpdatesInstalled=JUnit library and {0} updates successfully installed.\n\n +NBMS.CACHE.SuccessIfBoth_JUnitInstalled_NoUpdates=JUnit library successfully installed and all plugins are up to date.\n\n +NBMS.CACHE.SuccessIfBoth_JUnitNotFound_UpdatesInstalled={0} updates successfully installed but JUnit library not found.\n\ +Use Plugin Manager in NetBeans IDE to install JUnit library later.\n\n +NBMS.CACHE.SuccessIfBoth_JUnitNotFound_NoUpdates=All plugins are up to date but JUnit library not found.\n\ +Use Plugin Manager in NetBeans IDE to install JUnit library later.\n\n + +#Success if install JUnit (only) +NBMS.CACHE.SuccessIfJunit_JUnitInstalled=JUnit library successfully installed.\n\n +NBMS.CACHE.SuccessIfJunit_JUnitNotFound=JUnit library not found.\n\ +Use Plugin Manager in NetBeans IDE to install JUnit library later.\n\n + +#Success if check for updates (only) +NBMS.CACHE.SuccessIfCheck_UpdatesInstalled={0} updates successfully installed.\n\n +NBMS.CACHE.SuccessIfCheck_NoUpdates=All plugins are up to date.\n\n diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java new file mode 100644 index 000000000000..ae2f19a734f2 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/components/sequences/netbeans/NbMainSequence.java @@ -0,0 +1,666 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.installer.wizard.components.sequences.netbeans; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.zip.ZipOutputStream; +import org.netbeans.installer.product.Registry; +import org.netbeans.installer.product.components.Product; +import org.netbeans.installer.utils.FileUtils; +import org.netbeans.installer.utils.LogManager; +import org.netbeans.installer.utils.ResourceUtils; +import org.netbeans.installer.utils.SystemUtils; +import org.netbeans.installer.utils.helper.ExecutionMode; +import org.netbeans.installer.utils.helper.ExecutionResults; +import org.netbeans.installer.utils.progress.CompositeProgress; +import org.netbeans.installer.utils.progress.Progress; +import org.netbeans.installer.utils.progress.ProgressListener; +import org.netbeans.installer.wizard.components.WizardAction; +import org.netbeans.installer.wizard.components.WizardComponent; +import org.netbeans.installer.wizard.components.WizardSequence; +import org.netbeans.installer.wizard.components.actions.DownloadConfigurationLogicAction; +import org.netbeans.installer.wizard.components.actions.DownloadInstallationDataAction; +import org.netbeans.installer.wizard.components.actions.InstallAction; +import org.netbeans.installer.wizard.components.actions.UninstallAction; +import org.netbeans.installer.wizard.components.actions.netbeans.NbMetricsAction; +import org.netbeans.installer.wizard.components.actions.netbeans.NbShowUninstallationSurveyAction; +import org.netbeans.installer.wizard.components.panels.LicensesPanel; +import org.netbeans.installer.wizard.components.panels.netbeans.NbPostInstallSummaryPanel; +import org.netbeans.installer.wizard.components.panels.netbeans.NbPreInstallSummaryPanel; +import org.netbeans.installer.wizard.components.sequences.ProductWizardSequence; + +/** + * + */ +public class NbMainSequence extends WizardSequence { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + + private DownloadConfigurationLogicAction downloadConfigurationLogicAction; + private LicensesPanel licensesPanel; + private NbPreInstallSummaryPanel nbPreInstallSummaryPanel; + private UninstallAction uninstallAction; + private DownloadInstallationDataAction downloadInstallationDataAction; + private InstallAction installAction; + private NbPostInstallSummaryPanel nbPostInstallSummaryPanel; + private NbMetricsAction metricsAction; + private NbShowUninstallationSurveyAction showUninstallationSurveyAction; + private Map productSequences; + + private static final String SIZE_UPDATES_PATTERN = "updates="; // NOI18N + private static final String SIZE_MODULES_PATTERN = "modules="; // NOI18N + private static final int INSTALL_STEP = 15; + private static final int STARTUP_STEP = 20; + + public NbMainSequence() { + downloadConfigurationLogicAction = new DownloadConfigurationLogicAction(); + licensesPanel = new LicensesPanel(); + nbPreInstallSummaryPanel = new NbPreInstallSummaryPanel(); + uninstallAction = new UninstallAction(); + downloadInstallationDataAction = new DownloadInstallationDataAction(); + installAction = new InstallAction(); + nbPostInstallSummaryPanel = new NbPostInstallSummaryPanel(); + metricsAction = new NbMetricsAction(); + showUninstallationSurveyAction = new NbShowUninstallationSurveyAction(); + productSequences = new HashMap(); + + installAction.setProperty(InstallAction.TITLE_PROPERTY, + DEFAULT_IA_TITLE); + installAction.setProperty(InstallAction.DESCRIPTION_PROPERTY, + DEFAULT_IA_DESCRIPTION); + } + + private static class PopulateCacheAction extends WizardAction { + private final Product nbBase; + private final Product nbJavaSE; + CompositeProgress compositeProgress; + private CountdownProgress countdownProgress; + private int sizeOfModules = 0; + private int sumOfModules = 0; + private int sumOfUpdates = 0; + private int loop = 0; + private String oldDetail = null; + private boolean downloadIsRunning = false; + private int spendPercentage = 0; + + private static final String[] PREFIX_FOR_PROGRESS = new String[] {"FINE [org.netbeans.updater]: 780: ", "INFO: 780: "}; + + public PopulateCacheAction(Product nbBase, Product nbJavaSE) { + this.nbBase = nbBase; + this.nbJavaSE = nbJavaSE; + this.compositeProgress = new CompositeProgress(); + } + + @Override + public void execute() { + File tmpUserDir = new File(SystemUtils.getTempDirectory(), "tmpnb"); // NOI18N + LogManager.log("try temporary directory for sure : "); + try { + if (tmpUserDir.exists()) { + FileUtils.deleteFile(tmpUserDir, true); + } + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + } + LogManager.log("running headless NetBeans IDE : "); + getWizardUi().setProgress(compositeProgress); + compositeProgress.setTitle(ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.title")); // NOI18N + + File nbInstallLocation = nbBase.getInstallationLocation(); + LogManager.log(" nbLocation = " + nbInstallLocation); + + String binDir = "netbeans" + File.separator + "bin"; //NOI18N + String runIDE = new File(nbInstallLocation, binDir).getPath(); // NOI18N + if (SystemUtils.isWindows()) { + runIDE += File.separator + "netbeans.exe"; // NOI18N + } else { + runIDE += File.separator + "netbeans"; // NOI18N + } + + File tmpCacheDir = new File(tmpUserDir, "var" + File.separator + "cache"); // NOI18N + + List commandsBase = new ArrayList(Arrays.asList(runIDE, + SystemUtils.isWindows() ? "--fork-java" : "", + "-J-Dnetbeans.close=true", + "--nosplash", + "-J-Dorg.netbeans.core.WindowSystem.show=false", + "-J-Dplugin.manager.install.global=true", + "--userdir", + tmpUserDir.getPath())); + + boolean checkForUpdate = Boolean.getBoolean(NbPreInstallSummaryPanel.CHECK_FOR_UPDATES_CHECKBOX_PROPERTY); + final boolean checkForUpdateOrig = checkForUpdate; + + ExecutionResults executeResult; + boolean start = true; + try { + while (start) { + try { + compositeProgress.addProgressListener(new ProgressListener() { + + @Override + public void progressUpdated(Progress progress) { + if (oldDetail != null && oldDetail.equals(progress.getDetail())) { + return ; + } + oldDetail = progress.getDetail(); + if (progress.getDetail().startsWith(SIZE_UPDATES_PATTERN) + || progress.getDetail().startsWith(SIZE_MODULES_PATTERN)) { + if (! downloadIsRunning) { + downloadIsRunning = true; + if (countdownProgress != null) { + countdownProgress.detach(); + } + } + boolean modOrUpdate = progress.getDetail().startsWith(SIZE_MODULES_PATTERN); + String size = modOrUpdate ? + progress.getDetail().substring(SIZE_MODULES_PATTERN.length()) : + progress.getDetail().substring(SIZE_UPDATES_PATTERN.length()); + try { + sizeOfModules = Integer.valueOf(size); + if (sizeOfModules > 0) { + spendPercentage = spendPercentage + INSTALL_STEP; + } + loop = 0; + if (modOrUpdate) { + sumOfModules = sumOfModules + sizeOfModules; + } else { + sumOfUpdates = sumOfUpdates + sizeOfModules; + } + } catch (NumberFormatException nfe) { + LogManager.log(nfe); + } + progress.setDetail(""); + } else if (downloadIsRunning && sizeOfModules > 0) { + compositeProgress.setPercentage(spendPercentage - INSTALL_STEP + Math.min(INSTALL_STEP, INSTALL_STEP * loop++ / (sizeOfModules * 2))); + } + } + }); + executeResult = runIDE(commandsBase, nbInstallLocation, checkForUpdate, compositeProgress); + start = false; + if (executeResult.getErrorCode() > 0) { + LogManager.log(" .... exit code: " + executeResult.getErrorCode()); + String msg = ""; + switch (executeResult.getErrorCode()) { + case 31: + if (checkForUpdateOrig) { + msg = ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.NetworkProblemUpdates"); // NOI18N + } + break; + case 33: // update problem + msg = ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.ProblemInstallUpdates", sumOfUpdates); // NOI18N + break; + case 34: // timeout loading JUnit + LogManager.log(" ... timeout loading JUnit - run it again "); + start = true; +// installJUnit = false; + downloadIsRunning = false; + break; + } + nbBase.setProperty(NbPostInstallSummaryPanel.NETBEANS_SUMMARY_MESSAGE_TEXT_PROPERTY, msg); + } else { + if (sumOfUpdates == 0 && sumOfModules > 0) { + LogManager.log(" ... caches don't contain JUnit - run the IDE again. See #224078"); + start = true; + checkForUpdate = false; + downloadIsRunning = false; + continue; + } + LogManager.log(" .... success "); + LogManager.log(" ...... installed " + sumOfModules + " new modules"); + LogManager.log(" ...... installed " + sumOfUpdates + " updates"); + String msg = ""; + if (checkForUpdateOrig) { + msg = sumOfUpdates > 0 ? + // Updates installed + ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.SuccessIfCheck_UpdatesInstalled", sumOfUpdates) : // NOI18N + // No updates + ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.SuccessIfCheck_NoUpdates"); // NOI18N + } + nbBase.setProperty(NbPostInstallSummaryPanel.NETBEANS_SUMMARY_MESSAGE_TEXT_PROPERTY, msg); + } + } catch (Exception ioe) { + LogManager.log(" .... exception ", ioe); + return ; + } + } + } finally { + cleanupNBMsIfLeft(nbInstallLocation); + LogManager.log(" .... done. "); + } + + LogManager.log("preparing caches : "); + + LogManager.log(" temporary cache location = " + tmpCacheDir); + + // zip OSGi cache + try { + LogManager.log(" zipping OSGi caches"); + File zipFile = new File(tmpCacheDir, "populate.zip"); + ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)); + FileUtils.zip(new File (tmpCacheDir, "netigso"), zos, tmpCacheDir, new ArrayList ()); + zos.close(); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + return ; + } finally { + LogManager.log(" .... done. "); + } + + + // remove useless files + LogManager.log(" remove useless files from cache"); + + Progress removeUselessFileProgress = new Progress(); + compositeProgress.addChild(removeUselessFileProgress, 5); + + compositeProgress.setDetail((ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.cleaning"))); // NOI18N + try { + FileUtils.deleteFile(new File(tmpCacheDir, "netigso"), true, removeUselessFileProgress); + FileUtils.deleteFile(new File(tmpCacheDir, "lastModified"), true, removeUselessFileProgress); + FileUtils.deleteFile(new File(tmpCacheDir, "catalogcache"), true, removeUselessFileProgress); + + String[] splashFileNames = tmpCacheDir.list(new FilenameFilter() { + + @Override + public boolean accept(File dir, String name) { + return name.startsWith("splash"); // NOI18N + } + }); + + if (splashFileNames != null) { + for (String name : splashFileNames) { + FileUtils.deleteFile(new File(tmpCacheDir, name), removeUselessFileProgress); + } + } + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + return ; + } finally { + LogManager.log(" .... done. "); + } + + + // copy populate caches and delete temp files + LogManager.log("copying NB log and populated caches : "); + + Progress populeteCacheDirProgress = new Progress(); + compositeProgress.addChild(populeteCacheDirProgress, 5); + + Progress deleteTempDirProgress = new Progress(); + compositeProgress.addChild(deleteTempDirProgress, 5); + + File populateLogDir = new File(nbInstallLocation, "netbeans"+ File.separator + "nb"/*nb cluster*/ + File.separator + "var" + File.separator + "log"); + File tmpMessagesLog = new File(tmpUserDir, "var" + File.separator + "log" + File.separator + "messages.log"); + LogManager.log(" NB log location = " + populateLogDir); + try { + FileUtils.copyFile(tmpMessagesLog, new File(populateLogDir, "messages.log"), true, populeteCacheDirProgress); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + return ; + } finally { + LogManager.log(" .... done. "); + } + + // adding log into list of installed files + LogManager.log("add NB log in installed list: "); + try { + for (File f : populateLogDir.listFiles()) { + nbBase.getInstalledFiles().add(f); + } + nbBase.getInstalledFiles().add(populateLogDir); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + } finally { + LogManager.log(" .... done. "); + } + + File populateCacheDir = new File(nbInstallLocation, "netbeans" + File.separator +"nb"/*nb cluster*/ + File.separator + "var" + File.separator + "cache"); + LogManager.log(" populated cache location = " + populateCacheDir); + try { + FileUtils.copyFile(tmpCacheDir, populateCacheDir, true, populeteCacheDirProgress); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + return ; + } finally { + LogManager.log(" .... done. "); + try { + FileUtils.deleteFile(tmpUserDir, true, deleteTempDirProgress); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + } + } + + + // adding files into list of installed files + LogManager.log("add populated caches in installed list: "); + try { + for (File f : populateCacheDir.listFiles()) { + nbBase.getInstalledFiles().add(f); + } + nbBase.getInstalledFiles().add(populateCacheDir); + LogManager.log(" .... success "); + } catch (Exception ioe) { + LogManager.log(" .... exception " + ioe.getMessage()); + } finally { + LogManager.log(" .... done. "); + } + + // save installed files list + try { + nbBase.getInstalledFiles().saveXmlGz(nbBase.getInstalledFilesList()); + LogManager.log(" .... success "); + } catch (Exception xmle) { + LogManager.log(" .... exception " + xmle.getMessage()); + } + } + + private ExecutionResults runIDE(List commandsBase, File nbInstallLocation, boolean checkForUpdate, CompositeProgress compositeProgress) throws IOException { + List commands = new ArrayList(commandsBase); + + String title = null; + if (checkForUpdate) { + // check for updates + if (! commands.contains("--modules")) { + commands.add("--modules"); + } + if (! commands.toString().contains("--extra-uc") && getExtraUC() != null) { + commands.add("--extra-uc"); + commands.add("\"" + getExtraUC() + "\""); + } + commands.add("--update-all"); + title = title == null ? + ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.CheckForUpdate") : // NOI18N + ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.CheckForUpdateInstallJUnit"); // NOI18N + LogManager.log(" .... check for updates"); + } + if (title == null) { + title = ResourceUtils.getString(NbMainSequence.class, "NBMS.CACHE.generate"); // NOI18N + } + LogManager.log(" Run " + commands); + + countdownProgress = new CountdownProgress(compositeProgress, 25*1000, STARTUP_STEP ,title); + spendPercentage = spendPercentage + STARTUP_STEP; + loop = 0; + sizeOfModules = 0; + countdownProgress.countdown(); + try { + return SystemUtils.executeCommand(compositeProgress, PREFIX_FOR_PROGRESS, nbInstallLocation, commands.toArray(new String[commands.size()])); + } finally { + countdownProgress.stop(); + } + } + + private void cleanupNBMsIfLeft(File installRoot) { + LogManager.log("CleanupNBMsIfLeft(" + installRoot + ")"); + if (installRoot == null || ! installRoot.exists()) { + return ; + } + final Set updateDownloadDirs = new HashSet (); + installRoot.listFiles(new FileFilter() { + + @Override + public boolean accept(File cluster) { + if (cluster.isDirectory()) { + File update = new File(cluster, "update" + File.separator + "download"); // NOI18N + if (update.exists()) { + updateDownloadDirs.add(update); + return true; + } + } + return false; + } + }); + for (File d : updateDownloadDirs) { + try { + LogManager.log(" ... ... deleting " + d); + FileUtils.deleteFile(d, true); + FileUtils.deleteEmptyParents(d); + } catch (IOException ex) { + LogManager.log("Exception while deleting " + d, ex); + } + } + LogManager.log(" ... ... done"); + } + + @Override + public boolean isCancelable() { + return false; + } + + } + + // a candidate to be placed somewhere in utils + private static class CountdownProgress { + + private final CompositeProgress main; + private final long time; + private final int percentage; + private final String title; + private final ScheduledExecutorService scheduler = + Executors.newScheduledThreadPool(1); + private int current; + private ScheduledFuture ticTac; + private Progress countdown; + + public CountdownProgress(CompositeProgress main, long time, int percentage, String title) { + this.main = main; + this.time = time; + this.percentage = percentage; + this.title = title; + this.current = 0; + } + + public void countdown() { + countdown = new Progress(); + main.addChild(countdown, percentage); + main.setDetail(title); + current = 0; + final Runnable tic = new Runnable() { + + @Override + public void run() { + countdown.setPercentage(++current); + } + }; + ticTac = scheduler.scheduleAtFixedRate(tic, 0, time / 100, TimeUnit.MILLISECONDS); + + // schedule timout + scheduler.schedule(new Runnable() { + + @Override + public void run() { + countdown.setPercentage(Progress.COMPLETE); + ticTac.cancel(true); + } + }, time, TimeUnit.MILLISECONDS); + + } + + public void stop() { + if (!ticTac.isDone() && !ticTac.isCancelled()) { + countdown.setPercentage(Progress.COMPLETE); + ticTac.cancel(true); + } + } + + private void detach() { + if (countdown != null) { + main.removeChild(countdown); + ticTac.cancel(true); + countdown = null; + } + } + } + + private static URL getExtraUC() { + URL urlExtra = null; + String extraUC = null; + try { + extraUC = System.getProperty("extra.update.center.url"); + if (extraUC == null || extraUC.isEmpty()) { + LogManager.log(" ... empty URL of Extra UC."); + return null; + } + urlExtra = new URL(extraUC); + } catch (MalformedURLException ex) { + LogManager.log(" Invalid URL of Extra UC " + extraUC + ", cause: ", ex); + } + return urlExtra; + } + + + @Override + public void executeForward() { + final Registry registry = Registry.getInstance(); + final List toInstall = registry.getProductsToInstall(); + final List toUninstall = registry.getProductsToUninstall(); + + // remove all current children (if there are any), as the components + // selection has probably changed and we need to rebuild from scratch + getChildren().clear(); + + // the set of wizard components differs greatly depending on the execution + // mode - if we're installing, we ask for input, run a wizard sequence for + // each selected component and then download and install; if we're creating + // a bundle, we only need to download and package things + + if (toInstall.size() > 0) { + addChild(downloadConfigurationLogicAction); + addChild(licensesPanel); + + for (Product product : toInstall) { + if (!productSequences.containsKey(product)) { + productSequences.put( + product, + new ProductWizardSequence(product)); + } + + addChild(productSequences.get(product)); + } + } + + addChild(nbPreInstallSummaryPanel); + + if (toUninstall.size() > 0) { + addChild(uninstallAction); + } + + if (toInstall.size() > 0) { + addChild(downloadInstallationDataAction); + addChild(installAction); + Product nbBase = null; + for (Product p : toInstall) { + if ("nb-base".equals(p.getUid()) || "nb-all".equals(p.getUid())) { // NOI18N + nbBase = p; + break; + } + } + Product nbJavaSE = null; + for (Product p : toInstall) { + if ("nb-javase".equals(p.getUid())) { + nbJavaSE = p; + break; + } + } + if (nbBase != null) { + PopulateCacheAction pupolateCacheAction = new PopulateCacheAction(nbBase, nbJavaSE); + addChild(pupolateCacheAction); + pupolateCacheAction.setProperty(InstallAction.TITLE_PROPERTY, DEFAULT_IA_TITLE); + pupolateCacheAction.setProperty(InstallAction.DESCRIPTION_PROPERTY, DEFAULT_IA_DESCRIPTION); + + } + } + + addChild(nbPostInstallSummaryPanel); + if (toInstall.size() > 0) { + addChild(metricsAction); + } + if (toUninstall.size() > 0) { + addChild(showUninstallationSurveyAction); + } + + StringBuilder list = new StringBuilder(); + for (Product product : toInstall) { + list.append(product.getUid() + "," + product.getVersion() + ";"); + } + System.setProperty( + LIST_OF_PRODUCTS_TO_INSTALL_PROPERTY, + list.toString()); + + list = new StringBuilder(); + for (Product product : toUninstall) { + list.append(product.getUid() + "," + product.getVersion() + ";"); + } + System.setProperty( + LIST_OF_PRODUCTS_TO_UNINSTALL_PROPERTY, + list.toString()); + + list = new StringBuilder(); + for (Product product : toInstall) { + for (WizardComponent component : productSequences.get(product).getChildren()) { + list.append(component.getClass().getName() + ";"); + } + } + System.setProperty( + PRODUCTS_PANEL_FLOW_PROPERTY, + list.toString()); + + super.executeForward(); + } + + @Override + public boolean canExecuteForward() { + return ExecutionMode.NORMAL == ExecutionMode.getCurrentExecutionMode(); + } + ///////////////////////////////////////////////////////////////////////////////// + // Constants + public static final String DEFAULT_IA_TITLE = + ResourceUtils.getString( + NbMainSequence.class, + "NBMS.IA.title"); // NOI18N + public static final String DEFAULT_IA_DESCRIPTION = + ResourceUtils.getString( + NbMainSequence.class, + "NBMS.IA.description"); // NOI18N + + public static final String LIST_OF_PRODUCTS_TO_INSTALL_PROPERTY = + "nbi.products.to.install"; // NOI18N + public static final String LIST_OF_PRODUCTS_TO_UNINSTALL_PROPERTY = + "nbi.products.to.uninstall"; // NOI18N + public static final String PRODUCTS_PANEL_FLOW_PROPERTY = + "nbi.products.panel.flow"; // NOI18N +} diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-components.xml b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-components.xml new file mode 100644 index 000000000000..e8b1760f4067 --- /dev/null +++ b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-components.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-description-background.png b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-description-background.png new file mode 100644 index 000000000000..d8c41f7dc4c7 Binary files /dev/null and b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-description-background.png differ diff --git a/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-icon.png b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-icon.png new file mode 100644 index 000000000000..1b3bcd61d25b Binary files /dev/null and b/nbbuild/installer/engine/src/org/netbeans/installer/wizard/wizard-icon.png differ diff --git a/nbbuild/installer/external/binaries-list b/nbbuild/installer/external/binaries-list new file mode 100644 index 000000000000..0fe5f06c32cc --- /dev/null +++ b/nbbuild/installer/external/binaries-list @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#456A222BA1345D564CAF7CD3699D8FA98EEFE219 jnlp.jar +#9479880927962525FCDD47EC53735065FD85BC92 jnlp-servlet.jar diff --git a/nbbuild/installer/external/jnlp-license.txt b/nbbuild/installer/external/jnlp-license.txt new file mode 100644 index 000000000000..9da6af3ddda0 --- /dev/null +++ b/nbbuild/installer/external/jnlp-license.txt @@ -0,0 +1,174 @@ +Name: JNLP +License: JWSv1.2.x.BCL +Description: Java Web Start APIs and servlet. +Source: jnlp.jar jnlp-servlet.jar +OSR: 117745 +Comment: version unknown + + Sun Microsystems, Inc. + Binary Code License Agreement +READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE TERMS +(COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE MEDIA +PACKAGE. BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS +AGREEMENT. IF YOU ARE ACCESSING THE SOFTWARE ELECTRONICALLY, INDICATE YOUR +ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS +AGREEMENT. IF YOU DO NOT AGREE TO ALL THESE TERMS, PROMPTLY RETURN THE UNUSED +SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED +ELECTRONICALLY, SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. +1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable +license for the internal use only of the accompanying software and +documentation and any error corrections provided by Sun (collectively +"Software"), by the number of users and the class of computer hardware for +which the corresponding fee has been paid. +2. RESTRICTIONS. Software is confidential and copyrighted. Title to Software +and all associated intellectual property rights is retained by Sun and/or its +licensors. Except as specifically authorized in any Supplemental License +Terms, you may not make copies of Software, other than a single copy of +Software for archival purposes. Unless enforcement is prohibited by applicable +law, you may not modify, decompile, or reverse engineer Software. You +acknowledge that Software is not designed, licensed or intended for use in the +design, construction, operation or maintenance of any nuclear facility. Sun +disclaims any express or implied warranty of fitness for such uses. No right, +title or interest in or to any trademark, service mark, logo or trade name of +Sun or its licensors is granted under this Agreement. +3. LIMITED WARRANTY. Sun warrants to you that for a period of ninety (90) days +from the date of purchase, as evidenced by a copy of the receipt, the media on +which Software is furnished (if any) will be free of defects in materials and +workmanship under normal use. Except for the foregoing, Software is provided +"AS IS". Your exclusive remedy and Sun's entire liability under this limited +warranty will be at Sun's option to replace Software media or refund the fee +paid for Software. +4. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR +IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED +WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON- +INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE +HELD TO BE LEGALLY INVALID. +5. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT +WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR +FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER +CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE +USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether +in contract, tort (including negligence), or otherwise, exceed the amount paid +by you for Software under this Agreement. The foregoing limitations will apply +even if the above stated warranty fails of its essential purpose. +6. Termination. This Agreement is effective until terminated. You may +terminate this Agreement at any time by destroying all copies of Software. +This Agreement will terminate immediately without notice from Sun if you fail +to comply with any provision of this Agreement. Upon Termination, you must +destroy all copies of Software. +7. Export Regulations. All Software and technical data delivered under this +Agreement are subject to US export control laws and may be subject to export or +import regulations in other countries. You agree to comply strictly with all +such laws and regulations and acknowledge that you have the responsibility to +obtain such licenses to export, re-export, or import as may be required after +delivery to you. +8. U.S. Government Restricted Rights. If Software is being acquired by or on +behalf of the U.S. Government or by a U.S. Government prime contractor or +subcontractor (at any tier), then the Government's rights in Software and +accompanying documentation will be only as set forth in this Agreement; this is +in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of +Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD +acquisitions). +9. Governing Law. Any action related to this Agreement will be governed by +California law and controlling U.S. federal law. No choice of law rules of any +jurisdiction will apply. +10. Severability. If any provision of this Agreement is held to be +unenforceable, this Agreement will remain in effect with the provision omitted, +unless omission would frustrate the intent of the parties, in which case this +Agreement will immediately terminate. +11. Integration. This Agreement is the entire agreement between you and Sun +relating to its subject matter. It supersedes all prior or contemporaneous +oral or written communications, proposals, representations and warranties and +prevails over any conflicting or additional terms of any quote, order, +acknowledgment, or other communication between the parties relating to its +subject matter during the term of this Agreement. No modification of this +Agreement will be binding, unless in writing and signed by an authorized +representative of each party. + JAVATM WEB START VERSION 1.2.x + SUPPLEMENTAL LICENSE TERMS +These supplemental license terms ("Supplemental Terms") add to or modify the +terms of the Binary Code License Agreement (collectively, the "Agreement"). +Capitalized terms not defined in these Supplemental Terms shall have the same +meanings ascribed to them in the Agreement. These Supplemental Terms shall +supersede any inconsistent or conflicting terms in the Agreement, or in any +license contained within the Software. +1. Software Internal Use and Development License Grant.Subject to the terms and +conditions of this Agreement, including, but not limited to Section 3 (Java +Technology Restrictions) of these Supplemental Terms, Sun grants you a non- +exclusive, non-transferable, limited license to reproduce internally and use +internally the binary form of the Software complete and unmodified for the sole +purpose of designing, developing, testing, and running your Java applets and +applications intended to run on the Java platform ("Programs"). +2. License to Distribute Software.Subject to the terms and conditions of this +Agreement, including, but not limited to Section 3 (Java Technology +Restrictions) of these Supplemental Terms, Sun grants you a non-exclusive, non- +transferable, limited license to reproduce and distribute the Software in +binary code form only, provided that (i) you distribute the Software complete +and unmodified and only bundled as part of, and for the sole purpose of +running, your Java applets or applications ("Programs"), (ii) the Programs add +significant and primary functionality to the Software, (iii) you do not +distribute additional software intended to replace any component(s) of the +Software, (iv) you do not remove or alter any proprietary legends or notices +contained in the Software, (v) you only distribute the Software subject to a +license agreement that protects Sun's interests consistent with the terms +contained in this Agreement, and (vi) you agree to defend and indemnify Sun and +its licensors from and against any damages, costs, liabilities, settlement +amounts and/or expenses (including attorneys' fees) incurred in connection with +any claim, lawsuit or action by any third party that arises or results from the +use or distribution of any and all Programs and/or Software. +3. Java Technology Restrictions. You may not modify the Java Platform Interface +("JPI", identified as classes contained within the "java" package or any +subpackages of the "java" package), by creating additional classes within the +JPI or otherwise causing the addition to or modification of the classes in the +JPI. In the event that you create an additional class and associated API(s) +which (i) extends the functionality of the Java platform, and (ii) is exposed +to third party software developers for the purpose of developing additional +software which invokes such additional API, you must promptly publish broadly +an accurate specification for such API for free use by all developers. You may +not create, or authorize your licensees to create, additional classes, +interfaces, or subpackages that are in any way identified as "java", "javax", +"sun" or similar convention as specified by Sun in any naming convention +designation. +4. Notice of Contents. Software may contain a Java Runtime Environment (JRE). +5. Notice of Automatic Software Updates from Sun. You acknowledge that the +Software may automatically download, install, and execute applets, +applications, software extensions, and updated versions of the Software from +Sun ("Software Updates"), which may require you to accept updated terms and +conditions for installation. If additional terms and conditions are not +presented on installation, the Software Updates will be considered part of the +Software and subject to the terms and conditions of the Agreement. +6. Notice of Automatic Downloads.You acknowledge that, by your use of the +Software and/or by requesting services that require use of the Software, the +Software may automatically download, install, and execute software applications +from sources other than Sun ("Other Software"). Sun makes no representations of +a relationship of any kind to licensors of Other Software. TO THE EXTENT NOT +PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST +REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR +PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING +OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE OTHER SOFTWARE, EVEN IF SUN +HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +7. Limited Warranty. Any implied warranties on the Software are limited to 90 +days. Some states do not allow limitations on duration of an implied warranty, +so the above may not apply to you. This limited warranty gives you specific +legal rights. You may have others, which vary from state to state. +8. Limitation of Liability. Some states do not allow the exclusion of +incidental or consequential damages, so some of the terms of Section 5, +Limitation of Liability, above may not be applicable to you. +9. Trademarks and Logos. You acknowledge and agree as between you and Sun that +Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, STAROFFICE, STARPORTAL and +iPLANET trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, STAROFFICE, +STARPORTAL and iPLANET-related trademarks, service marks, logos and other brand +designations ("Sun Marks"), and you agree to comply with the Sun Trademark and +Logo Usage Requirements currently located at http://www.sun.com/policies/ +trademarks. Any use you make of the Sun Marks inures to Sun's benefit. +10. Source Code. Software may contain source code that is provided solely for +reference purposes pursuant to the terms of this Agreement. Source code may +not be redistributed unless expressly provided for in this Agreement. +11. Termination for Infringement. Either party may terminate this Agreement +immediately should any Software become, or in either party's opinion be likely +to become, the subject of a claim of infringement of any intellectual property +right. +For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle, +Santa Clara, California 95054, U.S.A +(LFI#117745/Form ID#011801) diff --git a/nbbuild/installer/infra/build/.ant-lib/build.xml b/nbbuild/installer/infra/build/.ant-lib/build.xml new file mode 100644 index 000000000000..dce74e4f9d14 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/build.xml @@ -0,0 +1,90 @@ + + + + + + + + Builds, tests, and runs the project NBI Ant Tasks. + + + diff --git a/nbbuild/installer/infra/build/.ant-lib/nbproject/build-impl.xml b/nbbuild/installer/infra/build/.ant-lib/nbproject/build-impl.xml new file mode 100644 index 000000000000..c68d6d6e6b80 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/nbproject/build-impl.xml @@ -0,0 +1,1067 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + + + + + + java -cp "${run.classpath.with.dist.jar}" ${main.class} + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + Must select one file in the IDE or set profile.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/infra/build/.ant-lib/nbproject/genfiles.properties b/nbbuild/installer/infra/build/.ant-lib/nbproject/genfiles.properties new file mode 100644 index 000000000000..f2fc2a07f600 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2fa8d85b +build.xml.script.CRC32=96f1a860 +build.xml.stylesheet.CRC32=a12b3d02 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=bfa2d738 +nbproject/build-impl.xml.script.CRC32=3affe7c6 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/nbbuild/installer/infra/build/.ant-lib/nbproject/project.properties b/nbbuild/installer/infra/build/.ant-lib/nbproject/project.properties new file mode 100644 index 000000000000..ac84be3f1aa7 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/nbproject/project.properties @@ -0,0 +1,91 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.title=NBI Ant Tasks Library +application.vendor=Kirill Sorokin +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/nbi-ant-tasks.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath=\ + ${ant.core.lib}:\ + ${reference.NBI_Ant_Tasks_Library.jar} +# Space-separated list of extra javac options +javac.compilerargs=-Xlint:unchecked +javac.deprecation=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.6 +javac.target=1.6 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# Property libs.Ant1.6.5.classpath is set here just to make sharing of project simpler. +# The library definition has always preference over this property. +main.class=org.netbeans.installer.infra.build.ant.utils.VerifyFile +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +project.NBI_Ant_Tasks_Library=../../../../nbi/infra/build/.ant-lib +reference.NBI_Ant_Tasks_Library.jar=${project.NBI_Ant_Tasks_Library}/dist/nbi-ant-tasks.jar +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src +test.src.dir=test diff --git a/nbbuild/installer/infra/build/.ant-lib/nbproject/project.xml b/nbbuild/installer/infra/build/.ant-lib/nbproject/project.xml new file mode 100644 index 000000000000..89e31adee38d --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/nbproject/project.xml @@ -0,0 +1,46 @@ + + + + org.netbeans.modules.java.j2seproject + + + NetBeans Installer Ant Tasks + 1.6.5 + + + + + + + + + + NBI_Ant_Tasks_Library + jar + + jar + clean + jar + + + + diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberBluePrints.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberBluePrints.java new file mode 100644 index 000000000000..6922fbdf2864 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberBluePrints.java @@ -0,0 +1,167 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Dmitry Lipin + */ +public class BuildNumberBluePrints extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String updateNumber = + matcher.group(2); // NOMAGI + final String buildType = + matcher.group(3); // NOMAGI + final String milestoneNumber = + matcher.group(4); // NOMAGI + + final String buildNumber = FORMAT_OUT.format( + FORMAT_IN.parse(matcher.group(5))); // NOMAGI + getProject().setProperty( + prefix + UPDATE_NUMBER_SUFFIX, + updateNumber); + getProject().setProperty( + prefix + BUILD_TYPE_SUFFIX, + buildType); + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + } else { + throw new BuildException( + "Cannot parse the input file."); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "java_ee_sdk-([0-9]+)_([0-9]+)-([A-Za-z0-9]+)-bin-b([0-9]+)-blueprints-([A-Za-z0-9_]+).zip");//NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + /** + * Update number property suffix. + */ + private static final String UPDATE_NUMBER_SUFFIX = + ".update.number"; // NOI18N + + /** + * Build type property suffix. + */ + private static final String BUILD_TYPE_SUFFIX = + ".build.type"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberFirstCup.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberFirstCup.java new file mode 100644 index 000000000000..3dcbcace49fe --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberFirstCup.java @@ -0,0 +1,175 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Dmitry Lipin + */ +public class BuildNumberFirstCup extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String macroNumber = + matcher.group(1); // NOMAGI + final String microNumber = + matcher.group(2); // NOMAGI + final String milestoneNumber = + matcher.group(3); // NOMAGI + + final String buildNumber = FORMAT_OUT.format( + FORMAT_IN.parse(matcher.group(4))); // NOMAGI + + getProject().setProperty( + prefix + MACRO_BUILD_SUFFIX, + macroNumber); + getProject().setProperty( + prefix + MICRO_BUILD_SUFFIX, + microNumber); + + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + } else { + throw new BuildException( + "Cannot parse the input file."); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "firstcup-([0-9]+)_([0-9]+)-bin-b([0-9]+)-([A-Za-z0-9_]+).zip");//NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Build type property suffix. + */ + private static final String BUILD_TYPE_SUFFIX = + ".build.type"; // NOI18N + + /** + * Macro Build number property suffix. + */ + private static final String MACRO_BUILD_SUFFIX = + ".macro.number"; // NOI18N + + /** + * Macro Build number property suffix. + */ + private static final String MICRO_BUILD_SUFFIX = + ".micro.number"; + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberGlassFish.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberGlassFish.java new file mode 100644 index 000000000000..0557687fcf89 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberGlassFish.java @@ -0,0 +1,198 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Kirill Sorokin + */ +public class BuildNumberGlassFish extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + Matcher matcher = PATTERN.matcher(contents); + boolean found = false; + if (matcher.find()) { + found = true; + } else { + matcher = PATTERN_V3.matcher(contents); + } + if (found || matcher.find()) { + found = true; + } else { + matcher = PATTERN_V3_P02.matcher(contents); + } + if (found || matcher.find()) { + String buildType = ""; + String releaseNumber = ""; + int counter = 1; + if(matcher.groupCount() > 3) { //V2 + buildType = matcher.group(counter++); // NOMAGI + } else { // V3.X + releaseNumber = matcher.group(counter++); // NOMAGI + } + // no milestones in GF 4 + final String milestoneNumberReal = "0"; + final String milestoneNumber = "0"; + + String buildNumber = matcher.group(counter++); // NOMAGI + + getProject().setProperty( + prefix + BUILD_TYPE_SUFFIX, + buildType.toLowerCase()); + getProject().setProperty( + prefix + MILESTONE_NUMBER_REAL_SUFFIX, + milestoneNumberReal); + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + getProject().setProperty( + prefix + RELEASE_NUMBER_SUFFIX, + releaseNumber); + } else { + throw new BuildException( + "Cannot parse the input file " + file); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "sjsas-9_1_02-([a-z0-9]+)-bin-" + // NOI18N + "b(([0-9]+)[a-z]?)-linux-([A-Za-z0-9_]+)\\.bin"); // NOI18N + private static final Pattern PATTERN_V3 = Pattern.compile( + "glassfish-([0-9]+[\\.0-9]+)-b(([0-9]+)[a-z]?)\\.zip"); // NOI18N + + // glassfish-3.1.2-2-b03.zip + private static final Pattern PATTERN_V3_P02 = Pattern.compile( + "glassfish-([0-9]+[\\.0-9]+)-[0-9]-b(([0-9]+)[a-z]?)\\.zip"); // NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + private static final DateFormat FORMAT_IN_V3 = + new SimpleDateFormat("M_dd_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_REAL_SUFFIX = + ".milestone.number.real"; // NOI18N + + /** + * Build type property suffix. + */ + private static final String BUILD_TYPE_SUFFIX = + ".build.type"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Release number property suffix. + */ + private static final String RELEASE_NUMBER_SUFFIX = + ".release.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK.java new file mode 100644 index 000000000000..2b0c820466a9 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK.java @@ -0,0 +1,128 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and + * get version, update, build, etc + * + * @author Jiri Rechtacek + */ +public class BuildNumberJDK extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the JDK build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + Matcher matcher = PATTERN.matcher(contents); + if (matcher.find()) { + System.out.println("###: GROUP COUNT: " + matcher.groupCount()); + String jdkVersion = matcher.group(1); + String jdkUpdate = matcher.group(2); + String jdkBuildType = matcher.group(3); + String jdkBuildNumber = matcher.group(4); + String jdkEaText = "fcs".equals(jdkBuildType) ? "" : "ea-"; // NOI18N + + getProject().setProperty("jdk.version.number", jdkVersion); // NOI18N + getProject().setProperty("jdk.update.number", jdkUpdate); // NOI18N + getProject().setProperty("jdk.update.number.long", jdkUpdate.length() == 1 ? "0" + jdkUpdate : jdkUpdate); // NOI18N + getProject().setProperty("jdk.ea.text", jdkEaText); // NOI18N + getProject().setProperty("jdk.build.number", jdkBuildNumber); // NOI18N + } else { + // In case there is no update number + matcher = PATTERN_NO_UPDATE.matcher(contents); + + if (matcher.find()) { + System.out.println("###: GROUP COUNT: " + matcher.groupCount()); + String jdkVersion = matcher.group(1); + String jdkBuildType = matcher.group(2); + String jdkBuildNumber = matcher.group(3); + String jdkEaText = "fcs".equals(jdkBuildType) ? "" : "ea-"; // NOI18N + + getProject().setProperty("jdk.version.number", jdkVersion); // NOI18N + getProject().setProperty("jdk.ea.text", jdkEaText); // NOI18N + getProject().setProperty("jdk.build.number", jdkBuildNumber); // NOI18N + getProject().setProperty("jdk.update.number", "0"); // NOI18N + } else { + throw new BuildException( + "Cannot parse the input file " + file); // NOI18N + } + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + * ${jdk_builds_host}/java/re/jdk/7u25/promoted/latest/bundles/linux-x64/jdk-7u25-fcs-bin-b15-linux-x64-05_jun_2013.tar.gz + */ + private static final Pattern PATTERN = Pattern.compile( + "jdk-([0-9]+)u([0-9]+)-([a-z]+)-bin-" + // NOI18N + "b(([0-9]+)+)-([A-Za-z0-9_-]+)\\.tar.gz"); // NOI18N + + /** + * Pattern for which to look in the input file. No update number + * ${jdk_builds_host}/java/re/jdk/8/promoted/latest/bundles/linux-x64/jdk-8-fcs-bin-b127-linux-x64-29_jan_2014.tar.gz + */ + private static final Pattern PATTERN_NO_UPDATE = Pattern.compile( + "jdk-([0-9]+)-([a-z]+)-bin-" + // NOI18N + "b(([0-9]+)+)-([A-Za-z0-9_-]+)\\.tar.gz"); // NOI18N + +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK11.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK11.java new file mode 100644 index 000000000000..7f270c5ae9e5 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberJDK11.java @@ -0,0 +1,105 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and + * get version, update, build, etc + * + */ +public class BuildNumberJDK11 extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the JDK build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + Matcher matcher = PATTERN.matcher(contents); + if (matcher.find()) { + String jdkVersion = matcher.group(1); + String jdkUpdate = matcher.group(4); + if(jdkUpdate == null) { + jdkUpdate = "0";// NOI18N + } + String jdkBuildType = "0";//NOI18N + String jdkBuildNumber = matcher.group(6); + String jdkEaText = ""; // NOI18N + + getProject().setProperty("jdk.version.number", jdkVersion); // NOI18N + getProject().setProperty("jdk.update.number", jdkUpdate); // NOI18N + getProject().setProperty("jdk.update.number.long", jdkUpdate.length() == 1 ? "0" + jdkUpdate : jdkUpdate); // NOI18N + getProject().setProperty("jdk.ea.text", jdkEaText); // NOI18N + getProject().setProperty("jdk.build.number", jdkBuildNumber); // NOI18N + } else { + throw new BuildException( + "Cannot parse the input file " + file); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + * ${jdk_builds_host}/artifactory/re-release-local/jdk/11.0.1/13/bundles/linux-x64/jdk-11.0.1+13_linux-x64_bin.tar.gz + */ + private static final Pattern PATTERN = Pattern.compile( + "jdk-([1-9][0-9]*)((\\.0)*\\.([1-9])([0-9]*))*\\+([0-9]{2})" + // NOI18N + "_([a-z]+)-([A-Za-z0-9_-]+)_bin\\.tar\\.gz"); // NOI18N + +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbCcpp.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbCcpp.java new file mode 100644 index 000000000000..67810d0fde01 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbCcpp.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans c/c++ pack build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbCcpp extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans c/c++ pack build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "cnd-cluster-([0-9_]+)\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbEntPack.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbEntPack.java new file mode 100644 index 000000000000..e4a9aa7ab2d8 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbEntPack.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans enterprise pack build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbEntPack extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans enterprise pack build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "ent_pack-hula-([0-9_]+)\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbIde.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbIde.java new file mode 100644 index 000000000000..5d681af8a9e6 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbIde.java @@ -0,0 +1,113 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans ide build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbIde extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans ide build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + matcher.group(1)); // NOMAGI + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "netbeans-6_0-daily-bin-([0-9]+)-.*?\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbMobility.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbMobility.java new file mode 100644 index 000000000000..fed45042f298 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbMobility.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans mobility pack build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbMobility extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans mobility pack build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "netbeans-mobility-([0-9_]+)\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbUml.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbUml.java new file mode 100644 index 000000000000..748704228c93 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbUml.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans c/c++ pack build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbUml extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans c/c++ pack build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "uml_cluster-hydra-([0-9_]+)\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbVisualWeb.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbVisualWeb.java new file mode 100644 index 000000000000..332b2c34502c --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberNbVisualWeb.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * netbeans visual web pack build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberNbVisualWeb extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the netbeans visual web pack build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "RAVE-vw-([0-9_]+)\\.zip"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberOpenEsb.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberOpenEsb.java new file mode 100644 index 000000000000..117aac6f08e6 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberOpenEsb.java @@ -0,0 +1,143 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * project openesb build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberOpenEsb extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the project openesb build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + String buildNumber = matcher.group(1); // NOMAGI + + getProject().setProperty( + prefix + BUILD_NUMBER_REAL_SUFFIX, + buildNumber); + + if (buildNumber.indexOf('_') == -1) { + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber + "00"); // NOI18N + } else { + final int index = buildNumber.indexOf('_'); // NOMAGI + + final String bnPrefix = + buildNumber.substring(0, index); // NOMAGI + final String bnSuffix = + buildNumber.substring(index + 1); // NOMAGI + + buildNumber = + bnPrefix + + (bnSuffix.length() < 2 ? "0" : "") + // NOI18N NOMAGI + bnSuffix; + + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + "20" + buildNumber); // NOI18N NOMAGI + } + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "Build([0-9_]+)"); // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Real build number property suffix. + */ + private static final String BUILD_NUMBER_REAL_SUFFIX = + ".build.number.real"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberPortletContainer.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberPortletContainer.java new file mode 100644 index 000000000000..56634574d875 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberPortletContainer.java @@ -0,0 +1,199 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Dmitry Lipin + */ +public class BuildNumberPortletContainer extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String macroNumber = + matcher.group(1); // NOMAGI + final String microNumber = + matcher.group(2); // NOMAGI + final String minorNumber = + (matcher.group(3) == null) ? // NOMAGI + "0" : matcher.group(4); // NOMAGI + final String milestoneNumber = + matcher.group(5); // NOMAGI + + final String buildDate = matcher.group(6); + + final String buildNumber = FORMAT_OUT.format( + FORMAT_IN.parse(buildDate)); // NOMAGI + + getProject().setProperty( + prefix + MACRO_BUILD_SUFFIX, + macroNumber); + getProject().setProperty( + prefix + MICRO_BUILD_SUFFIX, + microNumber); + getProject().setProperty( + prefix + MINOR_BUILD_SUFFIX, + minorNumber); + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + getProject().setProperty( + prefix + BUILD_DATE_SUFFIX, + buildDate); + + } else { + throw new BuildException( + "Cannot parse the input file."); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "portlet_container-([0-9]+)_([0-9]+)(_([0-9]+))?-fcs-bin-b([0-9]+)-([A-Za-z0-9_]+).zip");//NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Build type property suffix. + */ + private static final String BUILD_TYPE_SUFFIX = + ".build.type"; // NOI18N + + /** + * Macro Build number property suffix. + */ + private static final String MACRO_BUILD_SUFFIX = + ".macro.number"; // NOI18N + + /** + * Micro Build number property suffix. + */ + private static final String MICRO_BUILD_SUFFIX = + ".micro.number"; + + /** + * Minor Build number property suffix. + */ + private static final String MINOR_BUILD_SUFFIX = + ".minor.number"; + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_DATE_SUFFIX = + ".build.date"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSjsam.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSjsam.java new file mode 100644 index 000000000000..21a3e8a6bb1e --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSjsam.java @@ -0,0 +1,151 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * access manager build number from it. + * + * @author Kirill Sorokin + */ +public class BuildNumberSjsam extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the access manager build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + String contents = Utils.read(in).toString(); + + in.close(); + + contents = contents.replace("/", ""); + contents = contents.replace("\\", ""); + contents = contents.replace("\n", ""); + contents = contents.replace("\r", ""); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String milestoneNumber = + matcher.group(2); // NOMAGI + final String buildNumber = FORMAT_OUT.format(FORMAT_IN.parse( + matcher.group(3))); // NOMAGI + + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + } else { + throw new BuildException( + "Cannot find build number"); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "access_manager-7_1-p([0-9]+)-rr-bin-b([0-9]+)-([A-Za-z0-9_]+).zip", + Pattern.MULTILINE); // NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSwdp.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSwdp.java new file mode 100644 index 000000000000..595686ac8f5b --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberSwdp.java @@ -0,0 +1,169 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Kirill Sorokin + */ +public class BuildNumberSwdp extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String macroNumber = + matcher.group(1); // NOMAGI + final String buildType = + matcher.group(2); // NOMAGI + final String milestoneNumber = + matcher.group(3); // NOMAGI + + final String buildNumber = FORMAT_OUT.format( + FORMAT_IN.parse(matcher.group(4))); // NOMAGI + + getProject().setProperty( + prefix + BUILD_TYPE_SUFFIX, + buildType.toLowerCase()); + getProject().setProperty( + prefix + MACRO_BUILD_SUFFIX, + macroNumber); + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + } else { + throw new BuildException( + "Cannot parse the input file."); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "swdp-R([0-9]+)-([a-z]+)-bin-b([0-9]+)-windows-i586-([A-Za-z0-9_]+)\\.exe");//NOI18N + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Build type property suffix. + */ + private static final String BUILD_TYPE_SUFFIX = + ".build.type"; // NOI18N + + /** + * Macro Build number property suffix. + */ + private static final String MACRO_BUILD_SUFFIX = + ".macro.number"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N +} diff --git a/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberWsrp.java b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberWsrp.java new file mode 100644 index 000000000000..6f7b050d2211 --- /dev/null +++ b/nbbuild/installer/infra/build/.ant-lib/src/org/netbeans/installer/infra/build/ant/BuildNumberWsrp.java @@ -0,0 +1,170 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.netbeans.installer.infra.build.ant; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Task; +import org.netbeans.installer.infra.build.ant.utils.Utils; + +/** + * This class is an ant task which parses a given input file and devises the + * glassfish milestone number, build type (ea, beta, rc, etc) and build number from + * it. + * + * @author Dmitry Lipin + */ +public class BuildNumberWsrp extends Task { + ///////////////////////////////////////////////////////////////////////////////// + // Instance + /** + * The input file. + */ + private File file; + + /** + * The properties' names prefix. + */ + private String prefix; + + // setters ////////////////////////////////////////////////////////////////////// + /** + * Setter for the file attribute. + * + * @param path The value of the file attribute. + */ + public void setFile(String path) { + this.file = new File(path); + } + + /** + * Setter for the prefix attribute. + * + * @param prefix The value of the prefix attribute. + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + // execution //////////////////////////////////////////////////////////////////// + /** + * Executes the task. The input file is parsed and three properties identifying + * the glassfish build are set. + * + * @throws org.apache.tools.ant.BuildException if the input file cannot be + * parsed for whatever reason. + */ + @Override + public void execute() throws BuildException { + try { + final FileInputStream in = new FileInputStream(file); + final CharSequence contents = Utils.read(in); + + in.close(); + + final Matcher matcher = PATTERN.matcher(contents); + + if (matcher.find()) { + final String macroNumber = + matcher.group(1); // NOMAGI + final String microNumber = + matcher.group(2); // NOMAGI + + final String milestoneNumber = + matcher.group(3); // NOMAGI + + final String buildNumber = FORMAT_OUT.format( + FORMAT_IN.parse(matcher.group(4))); // NOMAGI + + getProject().setProperty( + prefix + MACRO_NUMBER_SUFFIX, + macroNumber); + getProject().setProperty( + prefix + MICRO_NUMBER_SUFFIX, + microNumber); + getProject().setProperty( + prefix + MILESTONE_NUMBER_SUFFIX, + milestoneNumber); + getProject().setProperty( + prefix + BUILD_NUMBER_SUFFIX, + buildNumber); + } else { + throw new BuildException( + "Cannot parse the input file."); // NOI18N + } + } catch (IOException e) { + throw new BuildException(e); + } catch (ParseException e) { + throw new BuildException(e); + } + } + + ///////////////////////////////////////////////////////////////////////////////// + // Constants + /** + * Pattern for which to look in the input file. + */ + private static final Pattern PATTERN = Pattern.compile( + "wsrp-([0-9]+)_([0-9]+)-beta2-bin-b([0-9]+)-([A-Za-z0-9_]+).zip");//NOI18N + + + /** + * Date format used in the input file. + */ + private static final DateFormat FORMAT_IN = + new SimpleDateFormat("dd_MMM_yyyy", Locale.US); // NOI18N + + /** + * Date format to use in the output properties. + */ + private static final DateFormat FORMAT_OUT = + new SimpleDateFormat("yyyyMMdd", Locale.US); // NOI18N + + /** + * Milestone number property suffix. + */ + private static final String MILESTONE_NUMBER_SUFFIX = + ".milestone.number"; // NOI18N + + /** + * Build number property suffix. + */ + private static final String BUILD_NUMBER_SUFFIX = + ".build.number"; // NOI18N + /** + * Macro number property suffix. + */ + private static final String MACRO_NUMBER_SUFFIX = + ".macro.number"; // NOI18N + /** + * Micro number property suffix. + */ + private static final String MICRO_NUMBER_SUFFIX = + ".micro.number"; // NOI18N + +} diff --git a/nbbuild/installer/infra/build/build.properties b/nbbuild/installer/infra/build/build.properties new file mode 100644 index 000000000000..78ec8962260f --- /dev/null +++ b/nbbuild/installer/infra/build/build.properties @@ -0,0 +1,105 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +##################################################################################### +#build.number= +# +#output.dir= +# +#binary.cache.host= +#nb.builds.host= +#glassfish.builds.host= +#openesb.builds.host= +#sjsam.builds.host= +# +#jdk.home= +# +#cvs.root= +# +#glassfish.home= +#glassfish.asadmin= +#glassfish.http.port= +#glassfish.admin.port= +#glassfish.host= +#glassfish.user= +#glassfish.password= +# +#registries.home= +# +#jarsigner.keystore= +#jarsigner.alias= +#jarsigner.storepass= +# +#remote.host.windows= +#remote.port.windows= +#remote.user.windows= +# +#remote.host.linux= +#remote.port.linux= +#remote.user.linux= +# +#remote.host.solaris-x86= +#remote.port.solaris-x86= +#remote.user.solaris-x86= +# +#remote.host.solaris-sparc= +#remote.port.solaris-sparc= +#remote.user.solaris-sparc= +# +#remote.host.macosx= +#remote.port.macosx= +#remote.user.macosx= +##################################################################################### + +core.module.name=nbi +netbeans.module.name=installer + +hg.root=${basedir}/../../.. +hg.root.translatedfiles=${hg.root}/l10n + +nbi.all.dir=${basedir}/nbi_all +nbi.all.relative.path=infra/build/nbi_all +nbi.core.dir=${nbi.all.dir}/${core.module.name} +nbi.netbeans.dir=${nbi.all.dir}/${netbeans.module.name} +nbi.cache.dir=${basedir}/cache + +temp.file=${basedir}/temp.ant.tmp +environment.properties=${basedir}/environment.properties + +glassfish.password.line=AS_ADMIN_PASSWORD=${glassfish.password} + +glassfish.j2ee.jar=${glassfish.home}/lib/j2ee.jar + +jre-nested.version.number=8 +jre-nested.update.number=101 + +app.name=${nb.files.prefix}-${build.number} +context.home=/netbeans/7.0/nightly +context.path=${context.home}/${build.number} +context.dir=${registries.home}/${build.number} + +context.path.token=/nbi/dev +context.path.replacement=${context.path} + +context.dir.token=ROOT = new File\\(".*?"\\); +context.dir.replacement=ROOT = new File\\("${context.dir}"\); + +custom.tasks.src.1=${nbi.core.dir}/infra/build/.ant-lib/src +custom.tasks.src.2=${nbi.core.dir}/infra/build/.ant-lib/src-registries-management +custom.tasks.src.3=${nbi.netbeans.dir}/infra/build/.ant-lib/src +custom.tasks.cls=${nbi.netbeans.dir}/infra/build/.ant-lib/build diff --git a/nbbuild/installer/infra/build/build.sh b/nbbuild/installer/infra/build/build.sh new file mode 100644 index 000000000000..00459e835eab --- /dev/null +++ b/nbbuild/installer/infra/build/build.sh @@ -0,0 +1,196 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +################################################################################ + +################################################################################ +# get the path to the current directory and change to it +set -x +DIRNAME=`dirname $0` +cd ${DIRNAME} + +################################################################################ +# load the properties +if [ -f "../../../../build-private.sh" ] ; then +source ../../../../build-private.sh +else + echo "No build-private.sh file exist" +fi +################################################################################ +# define the environment for running ant + +if [ -z "$BUILD_NETBEANS" ] ; then + #build NetBeans bundles by default + BUILD_NETBEANS=1 +fi + +if [ -z "$BUILD_NB" ] ; then + #build NetBeans full bundle by default + BUILD_NB=0 +fi + +if [ -z "$BUILD_NBJDK7" ] ; then + #do not build NetBeans/JDK7 bundles by default + BUILD_NBJDK7=0 +fi + +if [ -z "$BUILD_NBJDK8" ] ; then + #do not build NetBeans/JDK8 bundles by default + BUILD_NBJDK8=0 +fi + +if [ -z "$BUILD_NBJDK11" ] ; then + #do not build NetBeans/JDK11 bundles by default + BUILD_NBJDK11=0 +fi + +if [ -z "$BUNDLE_JDK_PLATFORM" ] ; then + #build NetBeans/JDK for windows,windows-x64,linux,linux-x64 by default (Mac has own native build) + #BUNDLE_JDK_PLATFORM="windows,windows-x64,linux,linux-x64" + + BUNDLE_JDK_PLATFORM="windows-x64,linux-x64" +fi + +if [ -z "$COMMUNITY_ML_BUILD" ] ; then + COMMUNITY_ML_BUILD=0 +fi + +if [ -z "$BUILD_JTB" ] ; then + #do not build Java Tools Bundle installers by default + BUILD_JTB=0 +fi + +if [ -z "$BUILD_MYSQL" ] ; then + #do not build NetBeans/GlassFish/MySQL bundles by default + BUILD_MYSQL=0 +fi + +if [ -z "$BUILD_WEBLOGIC" ] ; then + #do not build NetBeans/WebLogic bundles by default + BUILD_WEBLOGIC=0 +fi + +if [ -z "$RUNJAVAFX" ] ; then + #do not build NetBeans/JavaFX bundles by default + RUNJAVAFX=0 +fi + +if [ -z "$CACHE_DIR" ] ; then + curdir=`pwd` + CACHE_DIR="$DIRNAME/../../../../NBI-cache" + mkdir -p "$CACHE_DIR" + cd "$CACHE_DIR" + CACHE_DIR=`pwd` + cd "$curdir" + echo "NBI Cache : $CACHE_DIR" + export CACHE_DIR +fi + + + + +if [ -n "$JDK_HOME" ] ; then +JAVA_HOME="$JDK_HOME" +fi + +if [ -z "$JDK_HOME" ] && [ -n "$JAVA_HOME" ] ; then +JDK_HOME="$JAVA_HOME" +fi + + +JAVA_HOME=`echo "$JAVA_HOME" | sed "s/\\\\\\/\//g"` +JDK_HOME=`echo "$JDK_HOME" | sed "s/\\\\\\/\//g"` + +export JAVA_HOME JDK_HOME + + +if [ -z "$ANT_OPTS" ] ; then + ANT_OPTS="-Xmx768m" +fi + +java8output=`"$JAVA_HOME/bin/java" -version 2>&1 | grep 1.8.0` + +if [ -n "$java7output" ] ; then + ANT_OPTS="$ANT_OPTS -Djavac.target=1.8 -Djavac.source=1.8" +fi + +export ANT_OPTS + +if [ -z "$USE_JARSIGNER" ] ; then + if [ -n "$JARSIGNER_KEYSTORE" ] ; then + USE_JARSIGNER=true + else + USE_JARSIGNER=false + fi +fi + + +if [ -z "$OUTPUT_DIR" ] ; then + OUTPUT_DIR="$DIRNAME/../../../../dist/installers" + mkdir -p "$OUTPUT_DIR" + cd "$OUTPUT_DIR" + OUTPUT_DIR=`pwd` + cd "$curdir" + echo "NBI Output Dir : $OUTPUT_DIR" +fi + +if [ -n "$BASE_DIR" ] ; then + if [ -z "$NB_BUILDS_HOST_EN" ] ; then + NB_BUILDS_HOST_EN="file:$BASE_DIR/dist/zip/moduleclusters" + fi + if [ -z "$NB_BUILDS_HOST_ML" ] ; then + NB_BUILDS_HOST_ML="file:$BASE_DIR/dist/ml/zip/moduleclusters" + fi +fi + +if [ -n "$DATESTAMP" ] ; then + NB_BUILD_NUMBER="$DATESTAMP" +fi + +if [ -z "$NB_BUILD_NUMBER" ] ; then + echo "Build number is not defined" + exit 1; +fi + +if [ -z "$NB_FILES_PREFIX" ] && [ -n "$BASENAME_PREFIX" ] ; then + NB_FILES_PREFIX="$BASENAME_PREFIX" +fi + +run() { + + ################################################################################ + # run the build + ant build\ + ${ADDITIONAL_PARAMETERS} \ + $* + ERROR_CODE=$? + + if [ $ERROR_CODE != 0 ]; then + echo "ERROR: $ERROR_CODE - NBI installers build failed" + exit $ERROR_CODE; + fi +} + +NB_BUILDS_HOST=${NB_BUILDS_HOST_EN} +export NB_BUILDS_HOST +sh init.sh | cat > build-private.properties +cat build-private.properties +run $* + +################################################################################ diff --git a/nbbuild/installer/infra/build/build.xml b/nbbuild/installer/infra/build/build.xml new file mode 100644 index 000000000000..22fd897b11ae --- /dev/null +++ b/nbbuild/installer/infra/build/build.xml @@ -0,0 +1,2218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + **/*_${nb.locales}.* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +cvs.root=${cvs.root} +cvs.module=installer +cvs.timestamp=${cvs.timestamp} +cvs.branch=${cvs.branch} + +checkout.sources=false +sources.dir=${nbi.all.dir} + +release.to.server=false +release.registry.dir=${output.dir}/registry-temp + +build.number=${build.number} +dont.build.custom.tasks=true +custom.tasks.cls=${custom.tasks.cls} + +build.engine=false + +engine.dist.file.name=nbi-engine.jar +engine.dist.file=${nbi.netbeans.dir}/infra/build/engine/dist/nbi-engine.jar + +release.url=http://${glassfish.host}:${glassfish.http.port}${context.path}/admin +release.registry=NetBeans + +packaged.data.dir=${nbi.cache.dir}/packaged +downloads.cache.dir=${nbi.cache.dir}/raw + +binary.cache.host=${binary.cache.host} +nb.builds.host=${nb.builds.host} +glassfish.builds.host=${glassfish.builds.host} +jdk.builds.host=${jdk.builds.host} +jdk7.builds.path=${jdk.builds.path} +jdk8.builds.path=${jdk.builds.path} +jdk11.builds.path=${jdk.builds.path} +openesb.builds.host=${openesb.builds.host} +remote.work.dir=~/.${nb.bundle.files.prefix} + + + + +glassfish-mod.milestone.number=${glassfish-mod.milestone.number} +glassfish-mod.milestone.number.real=${glassfish-mod.milestone.number.real} +glassfish-mod.build.number=${glassfish-mod.build.number} +glassfish-mod.release.number=${glassfish-mod.release.number} + +tomcat.full.version=${tomcat.full.version} +tomcat.version=${tomcat.version} + +nb.full.version=${nb.full.version} +nb.zip.files.prefix=${nb.zip.files.prefix} +nb.bundle.files.prefix=${nb.bundle.files.prefix} + + + + + + + +weblogic.full.version=${weblogic.full.version} +weblogic.version=${weblogic.version} + + + + + +sjsam.builds.host=${sjsam.builds.host} +sjsam.milestone.number=${sjsam.milestone.number} +sjsam.build.number=${sjsam.build.number} + + + + + + +javaeesdk.build.location=${javaeesdk.build.location} +portalpack.builds.host=${portalpack.builds.host} + +javaeesdk-firstcup.milestone.number=${javaeesdk-firstcup.milestone.number} +javaeesdk-firstcup.build.number=${javaeesdk-firstcup.build.number} +javaeesdk-firstcup.macro.number=${javaeesdk-firstcup.macro.number} +javaeesdk-firstcup.micro.number=${javaeesdk-firstcup.micro.number} + +javaeesdk-blueprints.milestone.number=${javaeesdk-blueprints.milestone.number} +javaeesdk-blueprints.build.number=${javaeesdk-blueprints.build.number} +javaeesdk-blueprints.build.type=${javaeesdk-blueprints.build.type} +javaeesdk-blueprints.update.number=${javaeesdk-blueprints.update.number} + +javaeesdk-samples.milestone.number=${javaeesdk-samples.milestone.number} +javaeesdk-samples.build.type=${javaeesdk-samples.build.type} +javaeesdk-samples.build.number=${javaeesdk-samples.build.number} +javaeesdk-samples.update.number=${javaeesdk-samples.update.number} + +javaeesdk-javadocs.build.number=${javaeesdk-javadocs.build.number} + +portletcontainer.milestone.number=${portletcontainer.milestone.number} +portletcontainer.build.number=${portletcontainer.build.number} +portletcontainer.macro.number=${portletcontainer.macro.number} +portletcontainer.micro.number=${portletcontainer.micro.number} +portletcontainer.minor.number=${portletcontainer.minor.number} +portletcontainer.build.date=${portletcontainer.build.date} + +wsrp.macro.number=${wsrp.macro.number} +wsrp.micro.number=${wsrp.micro.number} +wsrp.milestone.number=${wsrp.milestone.number} +wsrp.build.number=${wsrp.build.number} +portalpack.build.number=${portalpack.build.number} + + + + + + +jarsigner.keystore=${jarsigner.keystore} +jarsigner.alias=${jarsigner.alias} +jarsigner.storepass=${jarsigner.storepass} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/infra/build/engine/build.properties b/nbbuild/installer/infra/build/engine/build.properties new file mode 100644 index 000000000000..fdcb6219e2a1 --- /dev/null +++ b/nbbuild/installer/infra/build/engine/build.properties @@ -0,0 +1,60 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the engine sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=engine + +# name of the engine's distributive file +engine.dist.file.name=nbi-engine.jar + +# we do not need to build anything native for the netbeans-specific engine, as it +# does not contain any native components +build.native=false + +# custom parameter for the netbeans project build script - in case of the netbeans +# nbi engine - the location of the core engine jar file +nb.custom.parameter=-Dreference.NBI_Engine.jar=${core.engine.dist.file} + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant + +sources.params.length=2 +sources.params.1.token={display-version} +sources.params.1.value=11.0 +sources.params.2.token={jtb-display-version} +sources.params.2.value=0 diff --git a/nbbuild/installer/infra/build/engine/build.xml b/nbbuild/installer/infra/build/engine/build.xml new file mode 100644 index 000000000000..65faf0c2d7cd --- /dev/null +++ b/nbbuild/installer/infra/build/engine/build.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the engine use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbbuild/installer/infra/build/groups/documentation-group/build.properties b/nbbuild/installer/infra/build/groups/documentation-group/build.properties new file mode 100644 index 000000000000..191bc0d1e02b --- /dev/null +++ b/nbbuild/installer/infra/build/groups/documentation-group/build.properties @@ -0,0 +1,73 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the group's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/groups/documentation-group + +# core group's properties +# * ${group.uid} - the unique identifier for the group; a registry can contain +# only one group with a given identifier +group.uid=documentation-group + +# miscellaneous group properties +# * ${group.offset} - order of the group's node among its parent's children, +# the bigger the offset value, the further the group's node will be +# * ${group.expand} - whether to automatically expand the group's node in the +# components tree or not; 'true'/'false' +# * ${group.visible} - whether the group's node is visible or not (note that +# this value will be modified at nbi runtime, 'true' may become 'false' if +# the group is filtered out); 'true'/'false' +group.offset=20000 +group.expand=true +group.visible=true + +# additional groups's properties; these will appear in the group's descriptor +# and in the registry in the form of value +# tags. +# * ${group.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +group.properties.length=0 +#group.properties.1.name= +#group.properties.1.value= + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=0 +#sources.params.1.token= +#sources.params.1.value= diff --git a/nbbuild/installer/infra/build/groups/documentation-group/build.xml b/nbbuild/installer/infra/build/groups/documentation-group/build.xml new file mode 100644 index 000000000000..92df0ea268ba --- /dev/null +++ b/nbbuild/installer/infra/build/groups/documentation-group/build.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/groups/nb-addons-group/build.properties b/nbbuild/installer/infra/build/groups/nb-addons-group/build.properties new file mode 100644 index 000000000000..61f20f1df90e --- /dev/null +++ b/nbbuild/installer/infra/build/groups/nb-addons-group/build.properties @@ -0,0 +1,73 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the group's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/groups/nb-addons-group + +# core group's properties +# * ${group.uid} - the unique identifier for the group; a registry can contain +# only one group with a given identifier +group.uid=nb-addons-group + +# miscellaneous group properties +# * ${group.offset} - order of the group's node among its parent's children, +# the bigger the offset value, the further the group's node will be +# * ${group.expand} - whether to automatically expand the group's node in the +# components tree or not; 'true'/'false' +# * ${group.visible} - whether the group's node is visible or not (note that +# this value will be modified at nbi runtime, 'true' may become 'false' if +# the group is filtered out); 'true'/'false' +group.offset=40000 +group.expand=true +group.visible=true + +# additional groups's properties; these will appear in the group's descriptor +# and in the registry in the form of value +# tags. +# * ${group.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +group.properties.length=0 +#group.properties.1.name= +#group.properties.1.value= + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=0 +#sources.params.1.token= +#sources.params.1.value= diff --git a/nbbuild/installer/infra/build/groups/nb-addons-group/build.xml b/nbbuild/installer/infra/build/groups/nb-addons-group/build.xml new file mode 100644 index 000000000000..03bb7297cd88 --- /dev/null +++ b/nbbuild/installer/infra/build/groups/nb-addons-group/build.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/groups/nb-ide-group/build.properties b/nbbuild/installer/infra/build/groups/nb-ide-group/build.properties new file mode 100644 index 000000000000..fdfe388d591d --- /dev/null +++ b/nbbuild/installer/infra/build/groups/nb-ide-group/build.properties @@ -0,0 +1,73 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the group's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/groups/nb-ide-group + +# core group's properties +# * ${group.uid} - the unique identifier for the group; a registry can contain +# only one group with a given identifier +group.uid=nb-ide-group + +# miscellaneous group properties +# * ${group.offset} - order of the group's node among its parent's children, +# the bigger the offset value, the further the group's node will be +# * ${group.expand} - whether to automatically expand the group's node in the +# components tree or not; 'true'/'false' +# * ${group.visible} - whether the group's node is visible or not (note that +# this value will be modified at nbi runtime, 'true' may become 'false' if +# the group is filtered out); 'true'/'false' +group.offset=10000 +group.expand=true +group.visible=true + +# additional groups's properties; these will appear in the group's descriptor +# and in the registry in the form of value +# tags. +# * ${group.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +group.properties.length=0 +#group.properties.1.name= +#group.properties.1.value= + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=1 +sources.params.1.token={display-version} +sources.params.1.value=Build ${build.number} diff --git a/nbbuild/installer/infra/build/groups/nb-ide-group/build.xml b/nbbuild/installer/infra/build/groups/nb-ide-group/build.xml new file mode 100644 index 000000000000..6130ca9af92d --- /dev/null +++ b/nbbuild/installer/infra/build/groups/nb-ide-group/build.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/groups/runtimes-group/build.properties b/nbbuild/installer/infra/build/groups/runtimes-group/build.properties new file mode 100644 index 000000000000..7fe61f52bb86 --- /dev/null +++ b/nbbuild/installer/infra/build/groups/runtimes-group/build.properties @@ -0,0 +1,73 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the group's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/groups/runtimes-group + +# core group's properties +# * ${group.uid} - the unique identifier for the group; a registry can contain +# only one group with a given identifier +group.uid=runtimes-group + +# miscellaneous group properties +# * ${group.offset} - order of the group's node among its parent's children, +# the bigger the offset value, the further the group's node will be +# * ${group.expand} - whether to automatically expand the group's node in the +# components tree or not; 'true'/'false' +# * ${group.visible} - whether the group's node is visible or not (note that +# this value will be modified at nbi runtime, 'true' may become 'false' if +# the group is filtered out); 'true'/'false' +group.offset=20000 +group.expand=true +group.visible=true + +# additional groups's properties; these will appear in the group's descriptor +# and in the registry in the form of value +# tags. +# * ${group.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +group.properties.length=0 +#group.properties.1.name= +#group.properties.1.value= + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=0 +#sources.params.1.token= +#sources.params.1.value= diff --git a/nbbuild/installer/infra/build/groups/runtimes-group/build.xml b/nbbuild/installer/infra/build/groups/runtimes-group/build.xml new file mode 100644 index 000000000000..12c38d21eb4a --- /dev/null +++ b/nbbuild/installer/infra/build/groups/runtimes-group/build.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/groups/tools-group/build.properties b/nbbuild/installer/infra/build/groups/tools-group/build.properties new file mode 100644 index 000000000000..e3b3ae6c6f63 --- /dev/null +++ b/nbbuild/installer/infra/build/groups/tools-group/build.properties @@ -0,0 +1,73 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the group's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/groups/tools-group + +# core group's properties +# * ${group.uid} - the unique identifier for the group; a registry can contain +# only one group with a given identifier +group.uid=tools-group + +# miscellaneous group properties +# * ${group.offset} - order of the group's node among its parent's children, +# the bigger the offset value, the further the group's node will be +# * ${group.expand} - whether to automatically expand the group's node in the +# components tree or not; 'true'/'false' +# * ${group.visible} - whether the group's node is visible or not (note that +# this value will be modified at nbi runtime, 'true' may become 'false' if +# the group is filtered out); 'true'/'false' +group.offset=20000 +group.expand=true +group.visible=true + +# additional groups's properties; these will appear in the group's descriptor +# and in the registry in the form of value +# tags. +# * ${group.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +group.properties.length=0 +#group.properties.1.name= +#group.properties.1.value= + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=0 +#sources.params.1.token= +#sources.params.1.value= diff --git a/nbbuild/installer/infra/build/groups/tools-group/build.xml b/nbbuild/installer/infra/build/groups/tools-group/build.xml new file mode 100644 index 000000000000..d56ed830fbf6 --- /dev/null +++ b/nbbuild/installer/infra/build/groups/tools-group/build.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/init.sh b/nbbuild/installer/infra/build/init.sh new file mode 100644 index 000000000000..b97b016f4ae6 --- /dev/null +++ b/nbbuild/installer/infra/build/init.sh @@ -0,0 +1,63 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +echo build.number="${NB_BUILD_NUMBER}" +echo output.dir="${OUTPUT_DIR}" +echo binary.cache.host="${BINARY_CACHE_HOST}" +echo nb.builds.host="${NB_BUILDS_HOST}" +echo nb.files.prefix="${BASENAME_PREFIX}" +echo nb.locales="${LOCALES}" +echo community.mlbuild="${COMMUNITY_ML_BUILD}" +echo glassfish.builds.host="${GLASSFISH_BUILDS_HOST}" +echo jdk.builds.host="${JDK_BUILDS_HOST}" +echo jdk7.builds.path="${JDK7_BUILDS_PATH}" +echo jdk8.builds.path="${JDK8_BUILDS_PATH}" +echo jdk11.builds.path="${JDK11_BUILDS_PATH}" +echo openesb.builds.host="${OPENESB_BUILDS_HOST}" +echo sjsam.builds.host="${SJSAM_BUILDS_HOST}" +echo portalpack.builds.host="${PORTALPACK_BUILDS_HOST}" +echo wtk.builds.host="${WTK_BUILDS_HOST}" +echo javafx.builds.host="${JAVAFX_BUILDS_HOST}" +echo jdk.home="${JDK_HOME}" +echo cvs.root="${CVS_ROOT}" +echo cvs.timestamp="${CVS_STAMP}" +echo cvs.branch="${CVS_BRANCH}" +echo build.jdk7="${BUILD_NBJDK7}" +echo build.jdk8="${BUILD_NBJDK8}" +echo build.jdk11="${BUILD_NBJDK11}" +echo bundle.jdk.platform="${BUNDLE_JDK_PLATFORM}" +echo build.jtb="${BUILD_JTB}" +echo build.mysql="${BUILD_MYSQL}" +echo build.weblogic="${BUILD_WEBLOGIC}" +echo build.netbeans.bundles="${BUILD_NETBEANS}" +echo build.nb="${BUILD_NB}" +echo build.javafx="${RUNJAVAFX}" +echo glassfish.home="${GLASSFISH_HOME}" +echo glassfish.asadmin="${GLASSFISH_ASADMIN}" +echo glassfish.http.port="${GLASSFISH_HTTP_PORT}" +echo glassfish.admin.port="${GLASSFISH_ADMIN_PORT}" +echo glassfish.host="${GLASSFISH_HOST}" +echo glassfish.user="${GLASSFISH_USER}" +echo glassfish.password="${GLASSFISH_PASSWORD}" +echo jarsigner.enabled="${USE_JARSIGNER}" +echo jarsigner.keystore="${JARSIGNER_KEYSTORE}" +echo jarsigner.alias="${JARSIGNER_ALIAS}" +echo jarsigner.storepass="${JARSIGNER_STOREPASS}" +echo pack200.enabled="${USE_PACK200}" +echo nbi.cache.dir="${CACHE_DIR}" +echo nb.binary.name="${BINARY_NAME}" diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk11.properties b/nbbuild/installer/infra/build/products/jdk/build_jdk11.properties new file mode 100644 index 000000000000..503e7baa8aef --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk11.properties @@ -0,0 +1,174 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/jdk + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=jdk +product.version=${jdk.version.number}.0.${jdk.update.number}.${jdk.build.number}.0 +product.version.windows-x64=${product.version}64 +product.version.linux-x64=${product.version}64 +#product.platforms= - will be overriden, as we need to build several times +# for several platforms + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=false +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 + +product.data.length=${product.data.length.${product.platforms}} +product.data.length.windows=0 +product.data.length.windows-x64=1 +product.data.length.linux=0 +product.data.length.linux-x64=1 + +product.data.1.uri.prefix=${jdk.builds.host}/${jdk11.builds.path}/ +product.data.1.uri.windows-x64=${product.data.1.uri.prefix}/windows-x64/jdk-${jdk.version.number}.0.${jdk.update.number}_windows-x64_bin.exe +product.data.1.uri.linux-x64=${product.data.1.uri.prefix}/linux-x64/jdk-${jdk.version.number}.0.${jdk.update.number}_linux-x64_bin.tar.gz +product.data.1.uri=${product.data.1.uri.${product.platforms}} +product.data.1.zip=false +product.data.1.tar.windows=false +product.data.1.tar.windows-x64=false +product.data.1.tar.linux=true +product.data.1.tar.linux-x64=true +product.data.1.tar=${product.data.1.tar.${product.platforms}} +folder.name.unzipped=jdk-${jdk.version.number}.0.${jdk.update.number} + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator.windows=257000000 +product.disk.space.modificator.windows-x64=257000000 +product.disk.space.modificator.linux=235000000 +product.disk.space.modificator.linux-x64=235000000 +product.disk.space.modificator=${product.disk.space.modificator.${product.platforms}} + + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +#product.install-afters.length= +#product.install-afters.1.uid= + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=2 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/jdk-${jdk.version.number}.0.${jdk.update.number} +product.properties.2.name=installation.location.windows +product.properties.2.value.windows=$N{install}/Java/jdk-${jdk.version.number}.0.${jdk.update.number} +product.properties.2.value.windows-x64=$N{install_x64}/Java/jdk-${jdk.version.number}.0.${jdk.update.number} +product.properties.2.value=${product.properties.2.value.${product.platforms}} + + + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=5 +sources.params.1.token={display-version} +sources.params.1.value=${jdk.version.number} Update ${jdk.update.number} +sources.params.2.token={jdk-installer-file} +sources.params.2.value.windows=jdk-${jdk.version.number}-windows-i586.exe +sources.params.2.value.windows-x64=jdk-${jdk.version.number}.0.${jdk.update.number}_windows-x64_bin.exe +sources.params.2.value.linux= +sources.params.2.value.linux-x64= +sources.params.2.value=${sources.params.2.value.${product.platforms}} +sources.params.3.token={jdk-install-dir} +sources.params.3.value=${folder.name.unzipped} +sources.params.4.token={jdk-base-dir} +sources.params.4.value=jdk-${jdk.version.number}.0.${jdk.update.number}.${jdk.build.number} diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk11.xml b/nbbuild/installer/infra/build/products/jdk/build_jdk11.xml new file mode 100644 index 000000000000..e3c1ed004f6b --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk11.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CALLING JDK11 PRE-PACKAGE + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk5.properties b/nbbuild/installer/infra/build/products/jdk/build_jdk5.properties new file mode 100644 index 000000000000..ba8b5b70de49 --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk5.properties @@ -0,0 +1,158 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/jdk + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=jdk +product.version=1.5.0.19.2 +#product.platforms= - will be overriden, as we need to build several times +# for several platforms + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=false +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 +product.data.length=1 +product.data.1.uri.prefix=${glassfish.builds.host}/java/re/j2sdk/1.5.0_19/promoted/fcs/b02/bundles +product.data.1.uri.windows=${product.data.1.uri.prefix}/windows-i586/jdk-1_5_0_19-windows-i586-p.exe +product.data.1.uri.linux=${product.data.1.uri.prefix}/linux-i586/jdk-1_5_0_19-linux-i586.bin +product.data.1.uri.solaris-x86=${product.data.1.uri.prefix}/solaris-i586/jdk-1_5_0_19-solaris-i586.sh +product.data.1.uri.solaris-sparc=${product.data.1.uri.prefix}/solaris-sparc/jdk-1_5_0_19-solaris-sparc.sh +product.data.1.uri=${product.data.1.uri.${product.platforms}} +product.data.1.zip=false + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator.windows=200000000 +product.disk.space.modificator.linux=100000000 +product.disk.space.modificator.solaris-sparc=100000000 +product.disk.space.modificator.solaris-x86=90000000 +product.disk.space.modificator=${product.disk.space.modificator.${product.platforms}} + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +#product.install-afters.length= +#product.install-afters.1.uid= + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=2 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/jdk1.5.0_19 +product.properties.2.name=installation.location.windows +product.properties.2.value=$N{install}/Java/jdk1.5.0_19 + + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=4 +sources.params.1.token={display-version} +sources.params.1.value=5 Update 19 +sources.params.2.token={jdk-installer-file} +sources.params.2.value.windows=jdk-1_5_0_19-windows-i586-p.exe +sources.params.2.value.linux=jdk-1_5_0_19-linux-i586.bin +sources.params.2.value.solaris-x86=jdk-1_5_0_19-solaris-i586.sh +sources.params.2.value.solaris-sparc=jdk-1_5_0_19-solaris-sparc.sh +sources.params.2.value=${sources.params.2.value.${product.platforms}} +sources.params.3.token={jdk-install-dir} +sources.params.3.value=jdk1.5.0_19 +sources.params.4.token={jdk-base-dir} +sources.params.4.value=jdk1.5.0.b64 diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk5.xml b/nbbuild/installer/infra/build/products/jdk/build_jdk5.xml new file mode 100644 index 000000000000..44d445909e6b --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk5.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk6.properties b/nbbuild/installer/infra/build/products/jdk/build_jdk6.properties new file mode 100644 index 000000000000..55ad65cf5658 --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk6.properties @@ -0,0 +1,174 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/jdk + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=jdk +product.version.windows=1.6.0.51.1032 +product.version.windows-x64=1.6.0.51.1064 +product.version.linux=1.6.0.51.1032 +product.version.linux-x64=1.6.0.51.1064 +#product.platforms= - will be overriden, as we need to build several times +# for several platforms + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=false +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 + +product.data.length=${product.data.length.${product.platforms}} +product.data.length.windows=1 +product.data.length.windows-x64=1 +product.data.length.linux=1 +product.data.length.linux-x64=1 + +product.data.1.uri.prefix=${jdk.builds.host}/java/re/jdk/6u51/promoted/fcs/b10/bundles +product.data.1.uri.windows=${product.data.1.uri.prefix}/windows-i586/jdk-6u51-windows-i586.exe +product.data.1.uri.windows-x64=${product.data.1.uri.prefix}/windows-amd64/jdk-6u51-windows-x64.exe +product.data.1.uri.linux=${product.data.1.uri.prefix}/linux-i586/jdk-6u51-linux-i586.bin +product.data.1.uri.linux-x64=${product.data.1.uri.prefix}/linux-amd64/jdk-6u51-linux-x64.bin +product.data.1.uri=${product.data.1.uri.${product.platforms}} +product.data.1.zip=false + +#product.data.2.uri=${product.data.1.uri.prefix}/windows-i586/jre-6u15-windows-i586.exe +#product.data.2.zip=false + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator.windows=250000000 +product.disk.space.modificator.windows-x64=250000000 +product.disk.space.modificator.linux=150000000 +product.disk.space.modificator.linux-x64=150000000 +product.disk.space.modificator=${product.disk.space.modificator.${product.platforms}} + + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +#product.install-afters.length= +#product.install-afters.1.uid= + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=2 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/jdk1.6.0_51 +product.properties.2.name=installation.location.windows +product.properties.2.value.windows=$N{install}/Java/jdk1.6.0_51 +product.properties.2.value.windows-x64=$N{install_x64}/Java/jdk1.6.0_51 +product.properties.2.value=${product.properties.2.value.${product.platforms}} + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=4 +sources.params.1.token={display-version} +sources.params.1.value=6 Update 51 +sources.params.2.token={jdk-installer-file} +sources.params.2.value.windows=jdk-6u51-windows-i586.exe +sources.params.2.value.windows-x64=jdk-6u51-windows-x64.exe +sources.params.2.value.linux=jdk-6u51-linux-i586.bin +sources.params.2.value.linux-x64=jdk-6u51-linux-x64.bin +sources.params.2.value=${sources.params.2.value.${product.platforms}} +sources.params.3.token={jdk-install-dir} +sources.params.3.value=jdk1.6.0_51 +sources.params.4.token={jdk-base-dir} +sources.params.4.value=jdk1.6.0_51.b10 +#sources.params.5.token={jre-installer-file} +#sources.params.5.value=jre-6u15-windows-i586.exe diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk6.xml b/nbbuild/installer/infra/build/products/jdk/build_jdk6.xml new file mode 100644 index 000000000000..1a3a1515ebda --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk6.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk7.properties b/nbbuild/installer/infra/build/products/jdk/build_jdk7.properties new file mode 100644 index 000000000000..7ee1354250ed --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk7.properties @@ -0,0 +1,177 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/jdk + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=jdk +product.version=1.${jdk.version.number}.0.${jdk.update.number}.${jdk.build.number} +product.version.windows=${product.version}32 +product.version.windows-x64=${product.version}64 +product.version.linux=${product.version}32 +product.version.linux-x64=${product.version}64 +#product.platforms= - will be overriden, as we need to build several times +# for several platforms + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=false +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 + +product.data.length=${product.data.length.${product.platforms}} +product.data.length.windows=1 +product.data.length.windows-x64=1 +product.data.length.linux=1 +product.data.length.linux-x64=1 + +product.data.1.uri.prefix=${jdk.builds.host}/${jdk7.builds.path}/all/b${jdk.build.number}/bundles +product.data.1.uri.windows=${product.data.1.uri.prefix}/windows-i586/jdk-7u${jdk.update.number}-${jdk.ea.text}windows-i586.exe +product.data.1.uri.windows-x64=${product.data.1.uri.prefix}/windows-x64/jdk-7u${jdk.update.number}-${jdk.ea.text}windows-x64.exe +product.data.1.uri.linux=${product.data.1.uri.prefix}/linux-i586/jdk-7u${jdk.update.number}-${jdk.ea.text}linux-i586.tar.gz +product.data.1.uri.linux-x64=${product.data.1.uri.prefix}/linux-x64/jdk-7u${jdk.update.number}-${jdk.ea.text}linux-x64.tar.gz +product.data.1.uri=${product.data.1.uri.${product.platforms}} +product.data.1.zip=false +product.data.1.tar.windows=false +product.data.1.tar.windows-x64=false +product.data.1.tar.linux=true +product.data.1.tar.linux-x64=true +product.data.1.tar=${product.data.1.tar.${product.platforms}} +folder.name.unzipped=jdk1.${jdk.version.number}.0_${jdk.update.number} + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator.windows=257000000 +product.disk.space.modificator.windows-x64=257000000 +product.disk.space.modificator.linux=235000000 +product.disk.space.modificator.linux-x64=235000000 +product.disk.space.modificator=${product.disk.space.modificator.${product.platforms}} + + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +#product.install-afters.length= +#product.install-afters.1.uid= + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=2 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/jdk1.${jdk.version.number}.0_${jdk.update.number} +product.properties.2.name=installation.location.windows +product.properties.2.value.windows=$N{install}/Java/jdk1.${jdk.version.number}.0_${jdk.update.number} +product.properties.2.value.windows-x64=$N{install_x64}/Java/jdk1.${jdk.version.number}.0_${jdk.update.number} +product.properties.2.value=${product.properties.2.value.${product.platforms}} + + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=5 +sources.params.1.token={display-version} +sources.params.1.value=${jdk.version.number} Update ${jdk.update.number} +sources.params.2.token={jdk-installer-file} +sources.params.2.value.windows=jdk-${jdk.version.number}u${jdk.update.number}-windows-i586.exe +sources.params.2.value.windows-x64=jdk-${jdk.version.number}u${jdk.update.number}-windows-x64.exe +sources.params.2.value.linux= +sources.params.2.value.linux-x64= +sources.params.2.value=${sources.params.2.value.${product.platforms}} +sources.params.3.token={jdk-install-dir} +sources.params.3.value=${folder.name.unzipped} +sources.params.4.token={jdk-base-dir} +sources.params.4.value=jdk1.${jdk.version.number}.0_${jdk.update.number}.b${jdk.build.number} diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk7.xml b/nbbuild/installer/infra/build/products/jdk/build_jdk7.xml new file mode 100644 index 000000000000..16e11632a48d --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk7.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk8.properties b/nbbuild/installer/infra/build/products/jdk/build_jdk8.properties new file mode 100644 index 000000000000..0a62d7c44640 --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk8.properties @@ -0,0 +1,178 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/jdk + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=jdk +product.version=1.${jdk.version.number}.0.${jdk.update.number.long}.${jdk.build.number} +product.version.windows=${product.version}32 +product.version.windows-x64=${product.version}64 +product.version.linux=${product.version}32 +product.version.linux-x64=${product.version}64 +#product.platforms= - will be overriden, as we need to build several times +# for several platforms + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=false +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 + +product.data.length=${product.data.length.${product.platforms}} +product.data.length.windows=1 +product.data.length.windows-x64=1 +product.data.length.linux=1 +product.data.length.linux-x64=1 + +product.data.1.uri.prefix=${jdk.builds.host}/${jdk8.builds.path}/all/b${jdk.build.number}/bundles +product.data.1.uri.windows=${product.data.1.uri.prefix}/windows-i586/jdk-8u${jdk.update.number}-${jdk.ea.text}windows-i586.exe +product.data.1.uri.windows-x64=${product.data.1.uri.prefix}/windows-x64/jdk-8u${jdk.update.number}-${jdk.ea.text}windows-x64.exe +product.data.1.uri.linux=${product.data.1.uri.prefix}/linux-i586/jdk-8u${jdk.update.number}-${jdk.ea.text}linux-i586.tar.gz +product.data.1.uri.linux-x64=${product.data.1.uri.prefix}/linux-x64/jdk-8u${jdk.update.number}-${jdk.ea.text}linux-x64.tar.gz +product.data.1.uri=${product.data.1.uri.${product.platforms}} +product.data.1.zip=false +product.data.1.tar.windows=false +product.data.1.tar.windows-x64=false +product.data.1.tar.linux=true +product.data.1.tar.linux-x64=true +product.data.1.tar=${product.data.1.tar.${product.platforms}} +folder.name.unzipped=jdk1.${jdk.version.number}.0_${jdk.update.number.long} + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator.windows=257000000 +product.disk.space.modificator.windows-x64=257000000 +product.disk.space.modificator.linux=235000000 +product.disk.space.modificator.linux-x64=235000000 +product.disk.space.modificator=${product.disk.space.modificator.${product.platforms}} + + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +#product.install-afters.length= +#product.install-afters.1.uid= + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=2 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/jdk1.${jdk.version.number}.0_${jdk.update.number.long} +product.properties.2.name=installation.location.windows +product.properties.2.value.windows=$N{install}/Java/jdk1.${jdk.version.number}.0_${jdk.update.number.long} +product.properties.2.value.windows-x64=$N{install_x64}/Java/jdk1.${jdk.version.number}.0_${jdk.update.number.long} +product.properties.2.value=${product.properties.2.value.${product.platforms}} + + + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=5 +sources.params.1.token={display-version} +sources.params.1.value=${jdk.version.number} Update ${jdk.update.number} +sources.params.2.token={jdk-installer-file} +sources.params.2.value.windows=jdk-${jdk.version.number}u${jdk.update.number}-windows-i586.exe +sources.params.2.value.windows-x64=jdk-${jdk.version.number}u${jdk.update.number}-windows-x64.exe +sources.params.2.value.linux= +sources.params.2.value.linux-x64= +sources.params.2.value=${sources.params.2.value.${product.platforms}} +sources.params.3.token={jdk-install-dir} +sources.params.3.value=${folder.name.unzipped} +sources.params.4.token={jdk-base-dir} +sources.params.4.value=jdk1.${jdk.version.number}.0_${jdk.update.number.long}.b${jdk.build.number} diff --git a/nbbuild/installer/infra/build/products/jdk/build_jdk8.xml b/nbbuild/installer/infra/build/products/jdk/build_jdk8.xml new file mode 100644 index 000000000000..ad588bd53064 --- /dev/null +++ b/nbbuild/installer/infra/build/products/jdk/build_jdk8.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/products/nb-all/build.properties b/nbbuild/installer/infra/build/products/nb-all/build.properties new file mode 100644 index 000000000000..8eec55eae983 --- /dev/null +++ b/nbbuild/installer/infra/build/products/nb-all/build.properties @@ -0,0 +1,165 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# path to the directory where the base build scripts library and properties +# reside +common.dir=../../../../../nbi/infra/build/.common + +# path to the local working directory; this directory which will be the target +# for checking out the sources and will be used for the build process +# * this path can be either absolute or relative in any unix environment, +# however, only relative paths are supported on windows, as the cygwin scp +# command does not properly handle colon in local paths +work.dir=./build + +# path to the local distributive directory; this directory will contain the +# distributive file, when (if) the build script finishes successfully +dist.dir=./dist + +# path to the products's sources within the cvs module; it should be a relative +# path from the module's root, e.g. for 'nbi/engine', where 'nbi is the module +# name, the path should be 'engine' +cvs.path=components/products/nb-all + +# core product properties: +# * ${product.uid} - product "family" (e.g. nb-ide) +# * ${product.version} - actual products' version; together with the uid it +# forms the unique identifier for the product) +# * ${product.platforms} - the list of platforms that are supported by this +# product (note that this property is not related to native libraries) +product.uid=nb-all +product.version=${nb.full.version} +product.platforms=windows linux + +# miscellaneous product properties: +# * ${product.status} - default status that the product will have in the +# registry. it is meant to be always "not-installed", unless you want +# something really exotic +# * ${product.offset} - order of the product's node among its parent's +# children, the bigger the offset value, the further the product's node will +# be +# * ${product.expand} - whether to automatically expand the product's node in +# the components tree or not; 'true'/'false' +# * ${product.visible} - whether the product's node is visible or not (note +# that this value will be modified at nbi runtime, 'true' may become 'false' +# if the product is filtered out); 'true'/'false' +# * ${product.features} - list of features that this porduct belongs to; the +# list should be space-separated +product.status=not-installed +product.offset=10000 +product.expand=true +product.visible=true +product.features= + +# list of configuration logic jar files; normally the first one would be the +# distributive file of the product's netbeans project +# * ${product.logic.length} - total number of the files +# * indices should start with 1 +product.logic.length=1 +product.logic.1.uri=file:${nbproject.dist.dir}/${nbproject.dist.file.name} + +# list of product installation data files +# * ${product.data.length} - total number of the files +# * ${product.data.N.uri} - uri at which the installation data file is located +# * ${product.data.N.zip} - whether the data file is a zip archive which needs to +# be extracted or it is a file that should be used directly; 'true'/'false' +# * indices should start with 1 + +product.data.length=1 + +product.data.length.windows=1 +product.data.length.linux=1 + +#derive from properties +product.data.1.uri=${nb.builds.host}/${nb.binary.name} +product.data.1.zip=true + +product.packaged.data.file.common=${packaged.data.dir}/${product.uid}${nb.build.suffix},${product.version}-${build.number},common,${i}.jar +product.packaged.data.properties.file.common=${packaged.data.dir}/${product.uid}${nb.build.suffix},${product.version}-${build.number},common,${i}.jar.properties + +product.packaged.data.file.1=${product.packaged.data.file.common} +product.packaged.data.properties.file.1=${product.packaged.data.properties.file.common} + + +product.packaged.data.file=${product.packaged.data.file.${i}} +product.packaged.data.properties.file=${product.packaged.data.properties.file.${i}} + + +# modificator for the required disk space parameter; the core value will be the +# sum of unzipped unstallation data files +# * the measurement unit is one byte +product.disk.space.modificator=0 + +# product's requirements (i.e. other products that should be installed +# in order for this product to succesfully install and function) +# * ${product.requirements.length} - total number of the requirements +# * indices should start with 1 +product.requirements.length=0 +#product.requirements.1.uid= +#product.requirements.1.version-lower= +#product.requirements.1.version-upper= + +# product's conflicts (i.e. other products that prevent this product from +# functioning correctly, and thus cannot be installed together with it) +# * ${product.conflicts.length} - total number of the conflicts +# * indices should start with 1 +product.conflicts.length=0 +#product.conflicts.1.uid= +#product.conflicts.1.version-lower= +#product.conflicts.1.version-upper= + +# other products that should be installed prior to this product; these +# dependencies do not imply that the dependent product will be installed at +# all, but if both the current and the dependent product are selected for +# installation, the latter will be installed first +# * ${product.install-afters.length} - total number of the install-afters +# * indices should start with 1 +product.install-afters.length=2 +product.install-afters.1.uid=jdk +product.install-afters.2.uid=jre-nested + +# additional product's properties; these will appear in the product's +# descriptor and in the registry in the form of +# value tags. +# * ${product.properties.length} - total number of the properties +# * indices should start with 1 +# * properties are not i18n compliant +product.properties.length=4 +product.properties.1.name=installation.location +product.properties.1.value=$N{install}/netbeans-11.0 +product.properties.2.name=installation.location.windows +product.properties.2.value=$N{install}/NetBeans-11.0 +product.properties.3.name=installation.location.macosx +product.properties.3.value=$N{install}/NetBeans/NetBeans 11.app +product.properties.4.name=minimum.jdk.version +product.properties.4.value=1.8.0 + +# sources parameters; a search-and-replace will be run over the sources after +# check-out, replacing [token] => [value]; regular expressions are not allowed +# * ${sources.params.length} - total number of the parameters +# * indices should start with 1 +# * parameters are not i18n compliant +sources.params.length=4 +sources.params.1.token={display-version} +sources.params.1.value=11.0 +sources.params.2.token={platform-cluster} +sources.params.2.value=platform +sources.params.3.token={nb-cluster} +sources.params.3.value=nb +sources.params.4.token={ide-cluster} +sources.params.4.value=ide diff --git a/nbbuild/installer/infra/build/products/nb-all/build.xml b/nbbuild/installer/infra/build/products/nb-all/build.xml new file mode 100644 index 000000000000..9c62d11b2209 --- /dev/null +++ b/nbbuild/installer/infra/build/products/nb-all/build.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + In order to 'clean', 'checkout' and 'build' the group use the + 'build-all' target. To 'clean', 'checkout', 'build' and + 'release' - use 'release-all'. + + For more details, please see the source of this build script. + + + diff --git a/nbbuild/installer/infra/build/web/build.xml b/nbbuild/installer/infra/build/web/build.xml new file mode 100644 index 000000000000..d4656eb8c298 --- /dev/null +++ b/nbbuild/installer/infra/build/web/build.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + add_language("${language.id}", "${language.name}" + + + + + , "${locale.name}", "${language.webpage.name}" + + ); + + + + + + + + + + + + diff --git a/nbbuild/installer/infra/build/web/bundles.list b/nbbuild/installer/infra/build/web/bundles.list new file mode 100644 index 000000000000..deae5fef7b86 --- /dev/null +++ b/nbbuild/installer/infra/build/web/bundles.list @@ -0,0 +1,8 @@ +#UID= +javase=nb-base, nb-javase, nb-extide, nb-platform-sdk, nb-javafx-mod +javaee=nb-base, nb-javase, nb-platform-sdk, nb-javafx-mod, nb-javaee, nb-webcommon, nb-extide, glassfish-mod, tomcat +html=nb-base, nb-php, nb-webcommon, nb-extide +php=nb-base, nb-php, nb-webcommon, nb-extide +cpp=nb-base, nb-cnd +all=nb-base, nb-javase, nb-platform-sdk, nb-javafx-mod, nb-javaee, nb-webcommon, nb-extide, nb-javacard, nb-javame, nb-cnd, nb-groovy, nb-php, nb-ergonomics, glassfish-mod, tomcat +hidden=nb-base, nb-ergonomics, nb-javafx, nb-ruby, nb-extide, jre-nested diff --git a/nbbuild/installer/infra/build/web/css/download.css b/nbbuild/installer/infra/build/web/css/download.css new file mode 100644 index 000000000000..22a400a6a0d1 --- /dev/null +++ b/nbbuild/installer/infra/build/web/css/download.css @@ -0,0 +1,293 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* Top header *****************************************************************/ +table.top_header { + margin: 0px auto 0px auto; + width: 100%; + height: 57px; + border-collapse: collapse; + background-image: url('https://netbeans.org/images_www/v6/products-top-bg.gif'); + background-repeat: no-repeat; + background-position: right; +} + +table.top_header td { + padding: 25px 23px 0px 23px; + color: #D5D5D5; +} + +table.top_header td.title { + width: 100%; + font-size: 1.8em; + color: #0e1b55; +} + +table.top_header td.menu { + white-space: nowrap; + font-size: 1.2em; +} + +table.subscription_selects { + margin: 10px auto 0px auto; + padding-bottom: 7px; + width: 95%; + empty-cells: show; + align: left; +} + +table.subscription { + padding: 0px 0px 0px 0px; + width: 430px; +} + +table.l_p_select_note { + margin: 0px 0px 0px 0px; +} + +/* Language/platform selection ************************************************/ +table.l_p_select { + margin: 0px 0px 0px 0px; + padding-top: 0px; + width: 100%; + border-collapse: collapse; +} + +table.l_p_select td { + padding: 0px 0px 0px 0px; +} + +table.l_p_select td.spacer { + width: 100%; +} + +table.l_p_select td.label { + padding-left: 15px; + padding-right: 5px; +} + + +/* Missing components warning ************************************************/ +table.missing_components { + width: 100%; + border-collapse: collapse; +} + +table.missing_components td.label { + text-align: right; + color: #808080; + padding-top: 5px; +} + +/* Components table ***********************************************************/ +table.components_table { + margin: 0px auto 0px auto; + width: 95%; + border-collapse: collapse; + empty-cells: show; +} + +table.components_table th { + padding: 2px 5px 2px 5px; + text-align: center; + color: #333333; + font-family: Arial, sans-serif; + font-weight: normal; + font-size: 1.1em; + cursor: default; +} + +table.components_table th.over { + background: #eeeeee; +} + + +table.components_table .star { + padding: 0px 0px 0px 5px; + text-align: center; + color: #333333; + font-family: Arial, sans-serif; + font-weight: bold; + font-size: 1.2em; + cursor: default; +} + + +table.components_table td { + border-top: 1px solid #D5D5D5; + border-bottom: 1px solid #D5D5D5; + padding: 2px 5px 2px 5px; + text-align: center; + font-family: Verdana, Arial, sans-serif; + font-size: 1em; + cursor: default; +} + +table.components_table td.over { + background: #eeeeee; +} + + +table.components_table .header { + border-width: 0px; + padding: 0px 0px 5px 0px; + font-weight: bold; + color: #FF8E00; + font-size: 1.1em; +} + + +table.components_table .left { + text-align: left; +} + +table.components_table .no_border { + border-width: 0px; +} + +table.components_table .download_button { + padding: 5px 3px 2px 3px; +} + +table.components_table .no_padding { + padding: 0px 0px 0px 0px; +} + +table.components_table .left_border { + border-left: 1px solid #D5D5D5; +} + +table.components_table .right_border { + border-right: 1px solid #D5D5D5; +} + +table.components_table .bottom_border { + border-bottom: 1px solid #D5D5D5; +} + +table.components_table .wide { + width: 100%; +} + +table.components_table .bottom { + vertical-align: bottom; +} + +table.components_table .beige { + background-color: #FFF4E5; +} + +table.components_table .comment { + +} + +table.components_table .bold_comment { + color: #ff5e08; + font-family: Arial, sans-serif; + font-weight: bold; +} + +table.components_table .warning { + color: #cc9900; +} + +table.components_table .product_note { + color: #D5D5D5; + font-size: 0.85em; +} + +table.components_table .product_display_name { + padding: 0px 0px 0px 8px; + color: #333333; +} + +table.components_table .product_display_name_no { + padding: 0px 0px 0px 8px; + color: #808080; +} + + +table.components_table .bundle_display_name { + color: #333333; +} + +table.components_table .bundle_display_name_no { + color: #808080; +} + +table.components_table .community_note_number { + color: #FF0000; + position: relative; + bottom: 4px; +} + + +table.components_table .title { + font-size: 1.3em; + white-space: nowrap; +} + +div.files_list { + margin-left: 8px; +} + + +.community_separator { + color: #888888; +} + +.pop_up { + color: #333333; + width: 250px; + min-height: 10px; + margin-top: 1.2em; + margin-left: 30px; + padding: 5px 5px 5px 5px; + border: 1px solid #6B6B6B; + position: absolute; + z-index: 100; + visibility: hidden; + background-color: #E6F6FE; +} + +.noscript_warning { + font-size: 1.2em; + color: #ff0000; + font-weight: bold; + margin: 20px 40px 20px 40px; +} + +.special_message_number { + margin: 0px 0px 0px 0px; + color: #FF5E08; +} +.special_message_text { +} + +.bold {font-weight:bold;} + +.legal_box { + padding: 4px 5px 10px 10px; + margin-right: 25px; + background-color:#E6F6FE; +} + +.download_tab_active { + color: #999999; +} diff --git a/nbbuild/installer/infra/build/web/css/start.css b/nbbuild/installer/infra/build/web/css/start.css new file mode 100644 index 000000000000..dce0ffa30833 --- /dev/null +++ b/nbbuild/installer/infra/build/web/css/start.css @@ -0,0 +1,63 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* Top header *****************************************************************/ +table.top_header { + margin: 0px auto 0px auto; + width: 100%; + height: 57px; + border-collapse: collapse; + background-image: url('https://netbeans.org/images_www/v6/products-top-bg.gif'); + background-repeat: no-repeat; + background-position: right; +} + +table.top_header td { + padding: 25px 23px 0px 23px; +} + + +table.top_header td.title { + width: 95%; + font-size: 1.8em; + color: #0e1b55; +} + +div.download_info { + margin:5px 0px 0px 30px; + padding-top:0px; + padding-left:15px; + color: #333333; +} + +p.file_information { + color: #333333; + font-size:0.9em; + font-weight: normal; +} + +a.download_link { + font-weight: normal; +} + +.legal_box { + padding: 4px 5px 10px 10px; + margin-right: 25px; + background-color:#E6F6FE; +} diff --git a/nbbuild/installer/infra/build/web/img/checked_badge_beige.gif b/nbbuild/installer/infra/build/web/img/checked_badge_beige.gif new file mode 100644 index 000000000000..258372feb065 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/checked_badge_beige.gif differ diff --git a/nbbuild/installer/infra/build/web/img/checked_badge_notavailable.gif b/nbbuild/installer/infra/build/web/img/checked_badge_notavailable.gif new file mode 100644 index 000000000000..72197be15f70 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/checked_badge_notavailable.gif differ diff --git a/nbbuild/installer/infra/build/web/img/checked_badge_white.gif b/nbbuild/installer/infra/build/web/img/checked_badge_white.gif new file mode 100644 index 000000000000..6049a0f75d1f Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/checked_badge_white.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download-arrow.gif b/nbbuild/installer/infra/build/web/img/download-arrow.gif new file mode 100644 index 000000000000..4f6354e88a80 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download-arrow.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download.gif b/nbbuild/installer/infra/build/web/img/download.gif new file mode 100644 index 000000000000..f4cfdf2553c4 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_d.gif b/nbbuild/installer/infra/build/web/img/download_d.gif new file mode 100644 index 000000000000..5e5208977b28 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_d.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_h.gif b/nbbuild/installer/infra/build/web/img/download_h.gif new file mode 100644 index 000000000000..5f5ee1f3661a Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_h.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_x64.gif b/nbbuild/installer/infra/build/web/img/download_x64.gif new file mode 100644 index 000000000000..f4a7cdfa70ae Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_x64.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_x64_h.gif b/nbbuild/installer/infra/build/web/img/download_x64_h.gif new file mode 100644 index 000000000000..a072a08b52d8 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_x64_h.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_x86.gif b/nbbuild/installer/infra/build/web/img/download_x86.gif new file mode 100644 index 000000000000..0c4653435106 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_x86.gif differ diff --git a/nbbuild/installer/infra/build/web/img/download_x86_h.gif b/nbbuild/installer/infra/build/web/img/download_x86_h.gif new file mode 100644 index 000000000000..474c114a2231 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/download_x86_h.gif differ diff --git a/nbbuild/installer/infra/build/web/img/info_icon.gif b/nbbuild/installer/infra/build/web/img/info_icon.gif new file mode 100644 index 000000000000..9b29f737a5b8 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/info_icon.gif differ diff --git a/nbbuild/installer/infra/build/web/img/info_icon_h.gif b/nbbuild/installer/infra/build/web/img/info_icon_h.gif new file mode 100644 index 000000000000..6696b813ced7 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/info_icon_h.gif differ diff --git a/nbbuild/installer/infra/build/web/img/plugins_small.gif b/nbbuild/installer/infra/build/web/img/plugins_small.gif new file mode 100644 index 000000000000..db14c7a48261 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/plugins_small.gif differ diff --git a/nbbuild/installer/infra/build/web/img/support_small.gif b/nbbuild/installer/infra/build/web/img/support_small.gif new file mode 100644 index 000000000000..435447974064 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/support_small.gif differ diff --git a/nbbuild/installer/infra/build/web/img/training_small.gif b/nbbuild/installer/infra/build/web/img/training_small.gif new file mode 100644 index 000000000000..ddc925b90f5b Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/training_small.gif differ diff --git a/nbbuild/installer/infra/build/web/img/tutorials_small.gif b/nbbuild/installer/infra/build/web/img/tutorials_small.gif new file mode 100644 index 000000000000..fab4c9a7a4b4 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/tutorials_small.gif differ diff --git a/nbbuild/installer/infra/build/web/img/warning_badge_beige.gif b/nbbuild/installer/infra/build/web/img/warning_badge_beige.gif new file mode 100644 index 000000000000..35d3fa6b5ab5 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/warning_badge_beige.gif differ diff --git a/nbbuild/installer/infra/build/web/img/warning_badge_white.gif b/nbbuild/installer/infra/build/web/img/warning_badge_white.gif new file mode 100644 index 000000000000..35d3fa6b5ab5 Binary files /dev/null and b/nbbuild/installer/infra/build/web/img/warning_badge_white.gif differ diff --git a/nbbuild/installer/infra/build/web/index.html b/nbbuild/installer/infra/build/web/index.html new file mode 100644 index 000000000000..5be27d4abcdc --- /dev/null +++ b/nbbuild/installer/infra/build/web/index.html @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+ + +
+ + + +
+ + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+
+ + +
+
+
+ + +
+ + + + + + + +
  + + + +
+ + +
+ +
+
+
+ + + + + + + +
+ +
+ + + + +
+ + + + + + + + + +
+ + +
+

+ + + + + + + +

+

+ + + +

+
+
+

+
+
+
+
+ + +
+

+ + + + + + + + + +
+ +
+
    +
  • facebook
  • +
  • youtube
  • +
  • google+
  • +
  • twitter
  • +
+ + +
+
+ By use of this website, you agree to the NetBeans Policies and Terms of Use. + © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo +
+
+
+ +
+ + + + + + + + + diff --git a/nbbuild/installer/infra/build/web/js/build_info.js b/nbbuild/installer/infra/build/web/js/build_info.js new file mode 100644 index 000000000000..728f861d75a2 --- /dev/null +++ b/nbbuild/installer/infra/build/web/js/build_info.js @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +var build_info = new Object; + +build_info.BUILD_DISPLAY_VERSION = "{build.display.version}"; +build_info.BUILD_DISPLAY_VERSION_SHORT = "{build.display.version.short}"; + +build_info.ZIP_FILES_PREFIX = "{nb.zip.files.prefix}"; +build_info.BUNDLE_FILES_PREFIX = "{nb.bundle.files.prefix}"; +build_info.BOUNCER_PRODUCT_PREFIX = "{nb.bundle.files.prefix}"; + +build_info.COMMUNITY_BUILD = "{community.mlbuild}"; +build_info.SHOW_ADDITIONAL_LANGUAGES = 0;//"{enable.languages.redirect}"; + +build_info.ADDITIONAL_BUILD_LOCATION = "{alternative.languages.page.url}"; + +build_info.BUILD_LOCATION = ""; + +build_info.LOAD_OMNITURE_CODE = 0; +build_info.LOAD_GOOGLE_ANALYTICS_CODE = 0; +build_info.USE_BOUNCER = 0; +build_info.ADD_VERSION_INFO_TO_URL = 0; + +build_info.BOUNCER_URL = "http://services.netbeans.org/bouncer/index.php"; + +build_info.USE_HTML_ZIP_LISTING = 0; + +build_info.add_download_tabs = function() { + add_download_tab("8.1", "http://netbeans.org/downloads/"); + add_download_tab(DEVELOPMENT_TITLE /*,DEVELOPMENT_BUILDS_LINK*/); + add_download_tab(ARCHIVE_TITLE,ARCHIVE_BUILDS_LINK); +} +add_build_info(build_info); diff --git a/nbbuild/installer/infra/build/web/js/common.js b/nbbuild/installer/infra/build/web/js/common.js new file mode 100644 index 000000000000..5bfc40f59aa3 --- /dev/null +++ b/nbbuild/installer/infra/build/web/js/common.js @@ -0,0 +1,498 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* Languages and their ids which NetBeans is available*/ +var LANGUAGES = new Array(); +var BUILD_INFO = new Array(); + +var PLATFORM_IDS = new Array(); +var PLATFORM_LONG_NAMES = new Array(); +var PLATFORM_SHORT_NAMES = new Array(); + +var BUNDLE_IDS = new Array(); +var BUNDLE_LONG_NAMES = new Array(); +var BUNDLE_SHORT_NAMES = new Array(); + +var FILES = new Array(); + +PLATFORM_IDS [0] = "windows"; +PLATFORM_IDS [1] = "linux"; +PLATFORM_IDS [2] = "macosx"; +PLATFORM_IDS [3] = "zip"; +/* +// Commented since NBI installers are not used for now +PLATFORM_IDS [4] = "macosx-x86"; +PLATFORM_IDS [5] = "macosx-ppc"; +*/ + +BUNDLE_IDS [0] = "javase"; +//BUNDLE_IDS [1] = "javafx"; +BUNDLE_IDS [1] = "javaee"; +//BUNDLE_IDS [2] = "ruby"; +BUNDLE_IDS [2] = "html"; +BUNDLE_IDS [3] = "php"; +BUNDLE_IDS [4] = "cpp"; +BUNDLE_IDS [5] = "all"; + +var DEFAULT_LANGUAGE = "DEFAULT"; +var PAGELANG_SEP = "pagelang="; + +var OMNITURE_CODE_JS = "//netbeans.org/images_www/js/s_code_remote.js"; +var GOOGLE_ANALYTICS_JS = "http://www.google-analytics.com/ga.js"; + +function getNameById(id,ids,names) { + for(var i = 0 ; i < ids.length; i++) { + if(ids[i] == id) { + return names[i]; + } + } + return ""; +} + +function getPlatformShortName(id) { + return getNameById(id, PLATFORM_IDS, PLATFORM_SHORT_NAMES); +} +function getPlatformLongName(id) { + return getNameById(id, PLATFORM_IDS, PLATFORM_LONG_NAMES); +} + +function getLanguageName(id) { + var ids = new Array(); + var names = new Array(); + for(var i=0;i resultLanguage.length) { + resultLanguage = value; + } + } + } + } + + //no language (for id) selected - fallback to en if it is available + if (resultLanguage == "" && option == 0) { + for(var i=0; i < variants.length; i++ ) { + if(variants[i].id == "en") { + return "en"; + } + } + } + + return resultLanguage; +} + + +function load_js(script_filename) { + document.write(''); +} + +function load_page_js_locale(name,ext) { + load_js_locale(name, ext); +} + +function useAnotherLocation() { + var loc = get_language_location(); + return loc != getPageArtifactsLocation(false); +} + +function isMainLanguage(language) { + for(var i=0; i < LANGUAGES.length; i++ ) { + if(LANGUAGES[i].id == language) { + return LANGUAGES[i].location == getPageArtifactsLocation(false); + } + } + return false; +} + +function load_js_locale(script_filename, extension) { + var suffix = ""; + var locale_suffix = ""; + locale_suffix = get_language_suffix(); + if(locale_suffix!="") { + suffix = "_" + locale_suffix; + } + var a = useAnotherLocation(); + load_page_js(script_filename + suffix + extension, a); +} + +function load_page_img(img,add) { + if(add) { + document.write(''); + } else { + document.write(''); + } +} +function load_page_css(css) { + document.write(''); +} + +function other_webpage_langs_available() { + for(var i=0 ; i < LANGUAGES.length; i++) { + if ( LANGUAGES[i].suffix && LANGUAGES[i].suffix.length > 0) { + return true; + } + } + return false; +} + +function page_languages_sort_function(a, b){ + if (a.webpagename && b.webpagename) { + return a.webpagename > b.webpagename ? 1 : (a.webpagename == b.webpagename ? 0 : -1); + } else { + return a.suffix > b.suffix ? 1 : (a.suffix == b.suffix ? 0 : -1); + } +} + +function write_page_languages() { + var locale_suffix = get_language_suffix(); + + if(other_webpage_langs_available()) { + document.getElementById("pagelanguagesbox").style.visibility = 'visible'; + } + var url = "" + window.location; + var qIndex = url.indexOf("?")!=-1 ? url.indexOf("?") : url.length; + var aIndex = url.indexOf("&")!=-1 ? url.indexOf("&") : url.length; + var page = url.substring(0, Math.min(qIndex, aIndex)); + var get_request = url.substring(url.indexOf(page) + page.length, url.length); + if(get_request.indexOf(PAGELANG_SEP)==-1) { + if(get_request.indexOf("?")==-1) { + get_request += "?"; + } else if(get_request.indexOf("&")) { + get_request += "&"; + } + get_request += PAGELANG_SEP; + } else { + var regexp = new RegExp(PAGELANG_SEP + "[a-zA-Z]+(_[a-zA-Z]+){0,2}","g"); + get_request = get_request.replace(regexp, PAGELANG_SEP); + } + var languages_sorted = LANGUAGES.slice().sort(page_languages_sort_function); + + for(var i=0;i' + languages_sorted[i].webpagename + ''); + } + } +} + +function startList() { + // source: //netbeans.org/branding/scripts/lang-pulldown.js + if (document.all&&document.getElementById) { + navRoot = document.getElementById("nav"); + if (navRoot!=null) { //if the language panel is active + for (i=0; i 0) { + for (var i = 0; i < FILES.length; i++) { + if(FILES[i].name.indexOf(dir)==0 && languageCompatible(FILES[i].locales, lang_id) && is_suitable_location(lang_id, FILES[i].location)) { + var stripped = FILES[i].name.substring(dir.length, FILES[i].name.length); + if(stripped.indexOf('/')==-1) { + lst[lst.length] = stripped; + } + } + } + } + return lst; +} + +function languageCompatible(language_list, lang_id) { + for(var i = 0; i < language_list.length; i++) { + if(language_list[i]==lang_id) return true; + } + return false; +} + +function get_file_info(filename,lang_id) { + var file = null; + if(FILES.length > 0) { + for (var i = 0; i < FILES.length; i++) { + if(FILES[i].name == filename && languageCompatible(FILES[i].locales, lang_id)) { + file = FILES[i]; + break; + } + } + } + return file; +} + +function getSize(filename, lang_id) { + var file = get_file_info(filename, lang_id); + return file!=null ? file.size : ""; +} + +function getMD5(filename, lang_id) { + var file = get_file_info(filename, lang_id); + return file!=null ? file.md5 : ""; +} + + +function get_file_name(platform, option, language, bits) { + //bits = !bits ? 'x86' : bits; + var fn = ""; + if(platform=="zip") { + fn += "zip/"; + } else { + fn += "bundles/"; + } + return fn + get_file_name_short(platform, option, language,bits); +} + +function is_file_available(platform, option, language, bits) { + return get_file_info(get_file_name(platform, option, language, bits), language) != null; +} + +function get_build_location(lang_id) { + var mainLanguage = isMainLanguage(lang_id); + var location = get_build_info(mainLanguage).BUILD_LOCATION; + if(!mainLanguage && location == "") { + location = get_build_info(true).ADDITIONAL_BUILD_LOCATION; + } + return location; +} + +function get_zip_files_prefix(lang_id) { + return get_build_info(isMainLanguage(lang_id)).ZIP_FILES_PREFIX; +} + +function get_bundles_files_prefix(lang_id) { + return get_build_info(isMainLanguage(lang_id)).BUNDLE_FILES_PREFIX; +} + +function get_file_name_short(platform, option, language, bits) { + var file_name = ""; + if(platform=="zip") { + if(option == "javadoc" || option == "platform-src" || option == "src") { + file_name += get_zip_files_prefix(language).replace("-ml",""); + } else { + file_name += get_zip_files_prefix(language); + } + } else { + file_name += get_bundles_files_prefix(language); + } + if (option != "all") { + file_name += "-" + option; + } + + if ( platform != "zip" ) { + file_name += "-" + platform; + } + + if(bits) { + file_name += "-"+bits; + } + + if (platform == "windows") { + file_name += ".exe"; + } else if (platform == "macosx") { + file_name += ".dmg"; + } else if(platform == "zip"){ + file_name += ".zip" + } else { + file_name += ".sh"; + } + return file_name; +} + +function get_file_url(filename, lang_id) { + var url = get_build_location(lang_id); + url += filename; + return url; +} + + +function get_file_bouncer_url(platform, option, language) { + var url = get_build_info(isMainLanguage(language)).BOUNCER_URL; + url += "?" + "product=" + get_build_info(isMainLanguage(language)).BOUNCER_PRODUCT_PREFIX; + if(option != "all") { + url += "-" + option; + } + url += "&" + "os=" + platform; + return url; +} + +function message(msg) { + document.write(msg); +} +function writeUrl(url,msg) { + document.write('' + msg + ''); +} +function set_page_title(title) { + document.title = title; + var titleElement = document.getElementsByTagName("title"); + if(titleElement.length == 1) { + titleElement[0].text = title; + } else { + document.write('' + title + ''); + } +} + +function set_page_description(desc) { + document.write(''); +} + +function add_file(name, size, md5, locales) { + var index = FILES.length; + FILES[index] = new Object; + FILES[index].name = name; + FILES[index].size = size; + FILES[index].md5 = md5; + FILES[index].locales = locales.split(","); + FILES[index].location = currentLocation; +} + +function load_files_information(additional) { + if(!additional) { + load_page_js("files.js", false); + } else if(get_build_info(true).SHOW_ADDITIONAL_LANGUAGES == 1) { + load_page_js("files.js", true); + } +} + +function add_language(id, name, suffix, webpagename) { + var index = LANGUAGES.length; + for(var i=0;iCommon Development and Distribution License (CDDL) v1.0 and GNU General Public License (GPL) v2. Such distributions include additional components under separate licenses identified in the License file. See the Third Party License file for external components included in NetBeans and their associated licenses."; + +var LEGAL_WARNING_MESSAGE = "WARNING: These builds are still under development and could contain defects that lead to data loss. They are meant for evaluation of new features. As always, be sure to back up your changes if you use these builds on your production code."; diff --git a/nbbuild/installer/infra/build/web/js/download.js b/nbbuild/installer/infra/build/web/js/download.js new file mode 100644 index 000000000000..e6b21a50f646 --- /dev/null +++ b/nbbuild/installer/infra/build/web/js/download.js @@ -0,0 +1,775 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +var PRODUCT_INFOS = new Array(); + +var BUNDLES = new Array(); + +var product_uids = new Array(); +var product_versions = new Array(); +var product_display_names = new Array(); +var product_notes = new Array(); +var product_descriptions = new Array(); +var product_download_sizes = new Array(); +var product_platforms = new Array(); + +var group_products = new Array(); +var group_display_names = new Array(); +var group_descriptions = new Array(); + + +var INFO_ICON = getImagesLocation() + "info_icon.gif"; +var INFO_ICON_H = getImagesLocation() + "info_icon_h.gif"; + +var CHECKED_WHITE_SRC = getImagesLocation() + "checked_badge_white.gif"; +var CHECKED_BEIGE_SRC = getImagesLocation() + "checked_badge_beige.gif"; +var WARNING_WHITE_SRC = getImagesLocation() + "warning_badge_white.gif"; +var WARNING_BEIGE_SRC = getImagesLocation() + "warning_badge_beige.gif"; +var CHECKED_WHITE_NA_SRC = getImagesLocation() + "checked_badge_notavailable.gif"; + +var IMAGE_CHECKED_WHITE_NOT_AVAILABLE = ''; + +var DOWNLOAD_BUTTON_NORMAL_SRC = getImagesLocation() + DOWNLOAD_BUTTON_NORMAL; +var DOWNLOAD_BUTTON_DISABLED_SRC = getImagesLocation() + DOWNLOAD_BUTTON_DISABLED; +var DOWNLOAD_BUTTON_HIGHLIGHT_SRC = getImagesLocation() + DOWNLOAD_BUTTON_HIGHLIGHT; + +var DOWNLOAD_IMG = ''; +var DOWNLOAD_IMG_DISABLED = ''; + + +var IMAGE_CHECKED_WHITE = ''; +var IMAGE_WARNING_WHITE = ''; +var IMAGE_CHECKED_BEIGE = ''; +var IMAGE_WARNING_BEIGE = ''; + +var NETBEANS_DOWNLOAD_BUNDLES_COMMUNITY_MSG_NUMBER = "1"; + +var download_tabs_number = 0; +var last_selected_lang = 0; +var MORE_LANG_ID = "more"; + +function handle_keyup(event) { + //if (event.keyCode == 13) { + // download('standard'); + //} +} + +function initialize() { + if (document.images) { + download_on = new Image(); + download_on.src = DOWNLOAD_BUTTON_NORMAL_SRC; + download_off= new Image(); + download_off.src = DOWNLOAD_BUTTON_DISABLED_SRC; + download_hl = new Image(); + download_hl.src = DOWNLOAD_BUTTON_HIGHLIGHT_SRC; + info = new Image(); + info.src = INFO_ICON; + info_h = new Image(); + info_h.src = INFO_ICON_H; + chw = new Image(); + chw.src = CHECKED_WHITE_SRC; + chb = new Image(); + chb.src = CHECKED_BEIGE_SRC; + ww = new Image(); + ww.src = WARNING_WHITE_SRC; + wb = new Image(); + wb.src = WARNING_BEIGE_SRC; + chwna = new Image(); + chwna.src = CHECKED_WHITE_NA_SRC; + } +} + +function write_languages() { + var added = false; + for(var i=0; i < LANGUAGES.length; i++ ) { + if(!isMainLanguage(LANGUAGES[i].id) && !added) { + added = true; + document.write(''); + } + document.write(''); + } +} + +function write_platforms() { + for(var i=0; i < PLATFORM_IDS.length; i++ ) { + document.write(''); + } +} + +function write_components() { + for (var i = 0; i < group_products.length; i++) { + // skip the first group name as it goes to the title of the table + if (i != 0) { + document.write(''); + document.write(' ' + ((i==1) ? BUNDLED_SERVERS_GROUP_NAME : group_display_names[i]) + ''); + + for(var k=0;k'); + } + + document.write(''); + } + + for (var j = 0; j < group_products[i].length; j++) { + var uid = group_products[i][j]; + var index = ""; + for(var k=0;k'); + + document.write(' '); + + document.write('
' + ''+ product_display_names[index] + '

' + product_descriptions[index] + '
'); + document.write(''); + //document.write('' + product_display_names[index] + ''); + document.write('' + product_display_names[index] + ''); + if (product_notes[j] != '') { + document.write('
' + product_notes[index] + ''); + } + document.write(' '); + + for(var k=0;k'); + } + + document.write(''); + } + } +} + +function parseList(list) { + var obj = new Array(); + var idx = -1; + var rest = list; + while (rest!="") { + idx = rest.indexOf(", "); + if(idx !=-1) { + obj[obj.length] = rest.substring(0, idx); + rest = rest.substring(idx + 2, rest.length); + } else { + obj[obj.length] = rest; + rest = ""; + } + } + + return obj; +} + +function add_product_info(uid, version, name, note, description, size, platforms) { + product_uids[product_uids.length] = uid; + product_versions[product_versions.length] = version; + product_display_names[product_display_names.length] = name; + product_notes[product_notes.length] = note; + product_descriptions[product_descriptions.length] = description; + product_download_sizes[product_download_sizes.length] = size; + product_platforms[product_platforms.length] = parseList(platforms); +} + +function add_group_info(products, name, description) { + group_products[group_products.length] = parseList(products); + group_display_names[group_display_names.length] = name; + group_descriptions[group_descriptions.length] = description; +} + +function add_bundle_info(uid, products) { + var index = BUNDLES.length; + BUNDLES[index] = new Object; + BUNDLES[index].uid = uid; + BUNDLES[index].products = parseList(products); +} + +function getHeader(community) { + return (community ? + (NETBEANS_DOWNLOAD_BUNDLES_COMMUNITY_MSG + '' + NETBEANS_DOWNLOAD_BUNDLES_COMMUNITY_MSG_NUMBER + '') : + NETBEANS_DOWNLOAD_BUNDLES_MSG); +} + +function write_table_header() { + document.write(''); + document.write(''); + document.write(''); + document.write(''); + document.write(''); + document.write(' '); + document.write('
' + getHeader(isCommunityBuild()) + '
'); + document.write(''); + document.write(''); + document.write('

'); + document.write(''); + document.write('' + NETBEANS_PACKS_MSG + '*'); + for(var i=0;i ' + getBundleLongName(id) + ''); + } + document.write(''); +} + +function get_download_button(id, enabled, bit) { + bit = bit || ''; + if(enabled) { + if(id!=='') + var img = DOWNLOAD_IMG; + if(bit.length>0) { + img=DOWNLOAD_IMG.replace(/download/g,"download_"+bit); + } + return ' ' + img + ''; + } else { + return DOWNLOAD_IMG_DISABLED; + } +} + +function write_table_footer() { + document.write(''); + document.write(' '); + for(var i=0;i' + get_download_button (id, true) + ''); + } + document.write(''); +} + +function write_components_sizes() { + document.write(''); + document.write(''); + for(var i=0;i'); + } + + document.write(''); +} + +function show_description(index) { + document.getElementById('product_' + index + '_description').style.visibility = 'visible'; +} + +function hide_description(index) { + document.getElementById('product_' + index + '_description').style.visibility = 'hidden'; +} + + +function highlight(){ + var table = document.getElementById("components_table"); + var tr = table.getElementsByTagName("tr"); + var cells = new Array(); + for (var i=0;i