<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trumpetinc</id>
	<title>NSIS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trumpetinc"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/Special:Contributions/Trumpetinc"/>
	<updated>2026-08-27T10:29:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17570</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17570"/>
		<updated>2009-08-21T23:55:38Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: fixed usage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
Download: &amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Forum: [http://forums.winamp.com/showthread.php?postid=2552459#post2552459]&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[InetLoad plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows (note that the !define must come before the !include):&lt;br /&gt;
&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;lt;nowiki&amp;gt;&amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:JREDyna.zip&amp;diff=17569</id>
		<title>File:JREDyna.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:JREDyna.zip&amp;diff=17569"/>
		<updated>2009-08-21T23:54:48Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: uploaded a new version of &amp;quot;File:JREDyna.zip&amp;quot;:&amp;amp;#32;Fixed usage error (must do !define before !include)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1.0.0.0&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17568</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17568"/>
		<updated>2009-08-21T23:28:27Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
Download: &amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Forum: [http://forums.winamp.com/showthread.php?postid=2552459#post2552459]&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[InetLoad plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;lt;nowiki&amp;gt;&amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17567</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17567"/>
		<updated>2009-08-21T23:19:59Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
Download:&lt;br /&gt;
&amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[InetLoad plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;lt;nowiki&amp;gt;&amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17566</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17566"/>
		<updated>2009-08-21T23:16:10Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
Download:&lt;br /&gt;
&amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17565</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17565"/>
		<updated>2009-08-21T23:14:42Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
Download:&lt;br /&gt;
&amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17564</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17564"/>
		<updated>2009-08-21T23:10:52Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
[[File:JREDyna.zip]]&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
*The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
*Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
*Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=File:JREDyna.zip&amp;diff=17563</id>
		<title>File:JREDyna.zip</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=File:JREDyna.zip&amp;diff=17563"/>
		<updated>2009-08-21T23:04:48Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: 1.0.0.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1.0.0.0&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17562</id>
		<title>Talk:Java Launcher with automatic JRE installation</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17562"/>
		<updated>2009-08-21T22:59:54Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think that this solution has a security hole in it - the Java app will get launched with elevated permissions if the JRE had to be downloaded.&lt;br /&gt;
&lt;br /&gt;
I believe that you want to use:&lt;br /&gt;
&lt;br /&gt;
  UAC::Exec &#039;&#039; &#039;$0&#039; &#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
to launch the application with regular user permissions, if the JRE had to be installed.  I don&#039;t know what will happen if you attempt to use UAC:Exec if you haven&#039;t elevated already (you might have to have a check to determine whether you launch UAC::Exec or just regular Exec)&lt;br /&gt;
&lt;br /&gt;
Finally, you should be calling UAC:Unload in your .OnInstFailed and .OnInstSuccess functions, as follows:&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstFailed&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstSuccess&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;br /&gt;
[[User:Trumpetinc|Trumpetinc]] 22:59, 21 August 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17561</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17561"/>
		<updated>2009-08-21T22:57:52Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
==Links==&lt;br /&gt;
&amp;lt;attach&amp;gt;JREDyna.zip&amp;lt;/attach&amp;gt;&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
1. The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
2. Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
3. Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17560</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17560"/>
		<updated>2009-08-21T22:56:27Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
1. The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
2. Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
3. Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17559</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17559"/>
		<updated>2009-08-21T22:54:36Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
*[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
*[[A slightly better Java Launcher]]&lt;br /&gt;
*[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload_plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;br /&gt;
&lt;br /&gt;
==Future Improvements==&lt;br /&gt;
1. The text strings used in this page should be configurable, and should be i18n aware&lt;br /&gt;
2. Add option to control whether the JRE install is silent (no dialogs or progress bars displayed). Personally, I don&#039;t like having it be completely hidden as this introduces large delays with no visible user feedback - but other users may feel differently.  Having the user click a couple of buttons in Sun&#039;s installer is acceptable, I think (the same thing occurs with apps that include download of .NET, for example).&lt;br /&gt;
3. Maybe make JRE_URL define optional&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17558</id>
		<title>Java Runtime Environment Dynamic Installer</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Runtime_Environment_Dynamic_Installer&amp;diff=17558"/>
		<updated>2009-08-21T22:47:40Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: Created page with &amp;#039;{{PageAuthor|trumpetinc}}  ==Description== A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tel…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|trumpetinc}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
A header that makes it easy to add Java Runtime installation to your installer. Includes version detection, optional custom page to tell user that JRE installation is going to occur, automatic download of the latest JRE and installation.&lt;br /&gt;
&lt;br /&gt;
==Discussion==&lt;br /&gt;
I&#039;ve always felt that it should be *easy* to install the Java Runtime while installing our applications, and without making our installer contain the 10MB JRE installer.  Sun has focused their energy on making installation easy from inside a web page, but for those of us still installing applications on workstations, no decent option is available.&lt;br /&gt;
&lt;br /&gt;
There are a number of projects in the wiki that address some of the problem, but none in a way that was easy to just drop into an existing installer. Here are some examples:&lt;br /&gt;
&lt;br /&gt;
[[Java Launcher with automatic JRE installation]]&lt;br /&gt;
[[A slightly better Java Launcher]]&lt;br /&gt;
[[New installer with JRE check (includes fixes from &#039;Simple installer with JRE check&#039; and missing_jre.ini)]]&lt;br /&gt;
&lt;br /&gt;
The important thing about this library is that it makes it easy to drop into any installer.  The end result is an installation experience that is similar to the .NET download that is part of many applications dependent on that framework.&lt;br /&gt;
&lt;br /&gt;
The download URL for the Java Runtime that is shown in the examples will get the latest version of the JRE (and should continue to work, even as Sun releases new builds).  Getting the Java Runtime to install in a quasi-silent operating mode took some doing.  See the [http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/silent.html#creating Sun documentation on silent mode operation] as a starting place, but be aware that Sun&#039;s installer is a small executable that downloads a larger MSI file, then calls msiexec with a bunch of command line arguments.&lt;br /&gt;
&lt;br /&gt;
==Dependencies==&lt;br /&gt;
&lt;br /&gt;
This library is dependent on the [[Inetload_plug-in]] plugin.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
===Include and Defines===&lt;br /&gt;
Include the header and define two constants in your .nsi file as follows:&lt;br /&gt;
&lt;br /&gt;
  !include &amp;quot;JREDyna.nsh&amp;quot;&lt;br /&gt;
  !define JRE_VERSION &amp;quot;1.6&amp;quot;&lt;br /&gt;
  !define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=33787&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Add page notifying user that JRE installation is required (Optional)===&lt;br /&gt;
When declaring your pages, use the following macro to insert the JRE notification page:&lt;br /&gt;
&lt;br /&gt;
  !insertmacro CUSTOM_PAGE_JREINFO&lt;br /&gt;
&lt;br /&gt;
===Detect, download and install JRE - if necessary===&lt;br /&gt;
In one of your installation sections, make the following call:&lt;br /&gt;
&lt;br /&gt;
  call DownloadAndInstallJREIfNecessary&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:Headers]]&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_with_automatic_JRE_installation&amp;diff=17556</id>
		<title>Java Launcher with automatic JRE installation</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Java_Launcher_with_automatic_JRE_installation&amp;diff=17556"/>
		<updated>2009-08-20T18:21:44Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: Added reference to Chat entry about UAC and security&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
I mixed follwing scripts. You need the UAC plug-in to compile this.&lt;br /&gt;
* [[A slightly better Java Launcher]]&lt;br /&gt;
* [[Simple Java Runtime Download Script]]&lt;br /&gt;
* [[UAC plug-in]]&lt;br /&gt;
&lt;br /&gt;
== The script ==&lt;br /&gt;
&lt;br /&gt;
Note: Be sure to see [[Talk:Java Launcher with automatic JRE installation]] for a note about security and how UAC is being used in the code below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
; Java Launcher with automatic JRE installation&lt;br /&gt;
;-----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Name &amp;quot;Java Launcher&amp;quot;&lt;br /&gt;
Caption &amp;quot;Java Launcher&amp;quot;&lt;br /&gt;
; Icon &amp;quot;Java Launcher.ico&amp;quot;&lt;br /&gt;
OutFile &amp;quot;SampleLauncher.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
VIAddVersionKey &amp;quot;ProductName&amp;quot; &amp;quot;Java Launcher&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;Comments&amp;quot; &amp;quot;A test comment&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;CompanyName&amp;quot; &amp;quot;Fake company&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;LegalTrademarks&amp;quot; &amp;quot;Java Launcher is a trademark of Fake company&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;LegalCopyright&amp;quot; &amp;quot;Fake company&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;FileDescription&amp;quot; &amp;quot;Java Launcher&amp;quot;&lt;br /&gt;
VIAddVersionKey &amp;quot;FileVersion&amp;quot; &amp;quot;1.0.0&amp;quot;&lt;br /&gt;
VIProductVersion &amp;quot;1.0.0.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!define CLASSPATH &amp;quot;sample.jar&amp;quot;&lt;br /&gt;
!define CLASS &amp;quot;Sample&amp;quot;&lt;br /&gt;
!define PRODUCT_NAME &amp;quot;Sample&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; Definitions for Java 6.0&lt;br /&gt;
!define JRE_VERSION &amp;quot;6.0&amp;quot;&lt;br /&gt;
!define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=24936&amp;amp;/jre-6u10-windows-i586-p.exe&amp;quot;&lt;br /&gt;
;!define JRE_VERSION &amp;quot;5.0&amp;quot;&lt;br /&gt;
;!define JRE_URL &amp;quot;http://javadl.sun.com/webapps/download/AutoDL?BundleId=22933&amp;amp;/jre-1_5_0_16-windows-i586-p.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
; use javaw.exe to avoid dosbox.&lt;br /&gt;
; use java.exe to keep stdout/stderr&lt;br /&gt;
!define JAVAEXE &amp;quot;javaw.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
RequestExecutionLevel user&lt;br /&gt;
SilentInstall silent&lt;br /&gt;
AutoCloseWindow true&lt;br /&gt;
ShowInstDetails nevershow&lt;br /&gt;
&lt;br /&gt;
!include &amp;quot;FileFunc.nsh&amp;quot;&lt;br /&gt;
!insertmacro GetFileVersion&lt;br /&gt;
!insertmacro GetParameters&lt;br /&gt;
!include &amp;quot;WordFunc.nsh&amp;quot;&lt;br /&gt;
!insertmacro VersionCompare&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;&amp;quot;&lt;br /&gt;
  Call GetJRE&lt;br /&gt;
  Pop $R0&lt;br /&gt;
 &lt;br /&gt;
  ; change for your purpose (-jar etc.)&lt;br /&gt;
  ${GetParameters} $1&lt;br /&gt;
  StrCpy $0 &#039;&amp;quot;$R0&amp;quot; -classpath &amp;quot;${CLASSPATH}&amp;quot; ${CLASS} $1&#039;&lt;br /&gt;
 &lt;br /&gt;
  SetOutPath $EXEDIR&lt;br /&gt;
  Exec $0&lt;br /&gt;
SectionEnd&lt;br /&gt;
&lt;br /&gt;
;  returns the full path of a valid java.exe&lt;br /&gt;
;  looks in:&lt;br /&gt;
;  1 - .\jre directory (JRE Installed with application)&lt;br /&gt;
;  2 - JAVA_HOME environment variable&lt;br /&gt;
;  3 - the registry&lt;br /&gt;
;  4 - hopes it is in current dir or PATH&lt;br /&gt;
Function GetJRE&lt;br /&gt;
    Push $R0&lt;br /&gt;
    Push $R1&lt;br /&gt;
    Push $2&lt;br /&gt;
  &lt;br /&gt;
  ; 1) Check local JRE&lt;br /&gt;
  CheckLocal:&lt;br /&gt;
    ClearErrors&lt;br /&gt;
    StrCpy $R0 &amp;quot;$EXEDIR\jre\bin\${JAVAEXE}&amp;quot;&lt;br /&gt;
    IfFileExists $R0 JreFound&lt;br /&gt;
  &lt;br /&gt;
  ; 2) Check for JAVA_HOME&lt;br /&gt;
  CheckJavaHome:&lt;br /&gt;
    ClearErrors&lt;br /&gt;
    ReadEnvStr $R0 &amp;quot;JAVA_HOME&amp;quot;&lt;br /&gt;
    StrCpy $R0 &amp;quot;$R0\bin\${JAVAEXE}&amp;quot;&lt;br /&gt;
    IfErrors CheckRegistry     &lt;br /&gt;
    IfFileExists $R0 0 CheckRegistry&lt;br /&gt;
    Call CheckJREVersion&lt;br /&gt;
    IfErrors CheckRegistry JreFound&lt;br /&gt;
 &lt;br /&gt;
  ; 3) Check for registry&lt;br /&gt;
  CheckRegistry:&lt;br /&gt;
    ClearErrors&lt;br /&gt;
    ReadRegStr $R1 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; &amp;quot;CurrentVersion&amp;quot;&lt;br /&gt;
    ReadRegStr $R0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment\$R1&amp;quot; &amp;quot;JavaHome&amp;quot;&lt;br /&gt;
    StrCpy $R0 &amp;quot;$R0\bin\${JAVAEXE}&amp;quot;&lt;br /&gt;
    IfErrors DownloadJRE&lt;br /&gt;
    IfFileExists $R0 0 DownloadJRE&lt;br /&gt;
    Call CheckJREVersion&lt;br /&gt;
    IfErrors DownloadJRE JreFound&lt;br /&gt;
  &lt;br /&gt;
  DownloadJRE:&lt;br /&gt;
    Call ElevateToAdmin&lt;br /&gt;
    MessageBox MB_ICONINFORMATION &amp;quot;${PRODUCT_NAME} uses Java Runtime Environment ${JRE_VERSION}, it will now be downloaded and installed.&amp;quot;&lt;br /&gt;
    StrCpy $2 &amp;quot;$TEMP\Java Runtime Environment.exe&amp;quot;&lt;br /&gt;
    nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2&lt;br /&gt;
    Pop $R0 ;Get the return value&lt;br /&gt;
    StrCmp $R0 &amp;quot;success&amp;quot; +3&lt;br /&gt;
      MessageBox MB_ICONSTOP &amp;quot;Download failed: $R0&amp;quot;&lt;br /&gt;
      Abort&lt;br /&gt;
    ExecWait $2&lt;br /&gt;
    Delete $2&lt;br /&gt;
    &lt;br /&gt;
    ReadRegStr $R1 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; &amp;quot;CurrentVersion&amp;quot;&lt;br /&gt;
    ReadRegStr $R0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment\$R1&amp;quot; &amp;quot;JavaHome&amp;quot;&lt;br /&gt;
    StrCpy $R0 &amp;quot;$R0\bin\${JAVAEXE}&amp;quot;&lt;br /&gt;
    IfFileExists $R0 0 GoodLuck&lt;br /&gt;
    Call CheckJREVersion&lt;br /&gt;
    IfErrors GoodLuck JreFound&lt;br /&gt;
    &lt;br /&gt;
  ; 4) wishing you good luck&lt;br /&gt;
  GoodLuck:&lt;br /&gt;
    StrCpy $R0 &amp;quot;${JAVAEXE}&amp;quot;&lt;br /&gt;
    ; MessageBox MB_ICONSTOP &amp;quot;Cannot find appropriate Java Runtime Environment.&amp;quot;&lt;br /&gt;
    ; Abort&lt;br /&gt;
  &lt;br /&gt;
  JreFound:&lt;br /&gt;
    Pop $2&lt;br /&gt;
    Pop $R1&lt;br /&gt;
    Exch $R0&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
; Pass the &amp;quot;javaw.exe&amp;quot; path by $R0&lt;br /&gt;
Function CheckJREVersion&lt;br /&gt;
    Push $R1&lt;br /&gt;
    &lt;br /&gt;
    ; Get the file version of javaw.exe&lt;br /&gt;
    ${GetFileVersion} $R0 $R1&lt;br /&gt;
    ${VersionCompare} ${JRE_VERSION} $R1 $R1&lt;br /&gt;
    &lt;br /&gt;
    ; Check whether $R1 != &amp;quot;1&amp;quot;&lt;br /&gt;
    ClearErrors&lt;br /&gt;
    StrCmp $R1 &amp;quot;1&amp;quot; 0 CheckDone&lt;br /&gt;
    SetErrors&lt;br /&gt;
    &lt;br /&gt;
  CheckDone:&lt;br /&gt;
    Pop $R1&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
; Attempt to give the UAC plug-in a user process and an admin process.&lt;br /&gt;
Function ElevateToAdmin&lt;br /&gt;
  UAC_Elevate:&lt;br /&gt;
    UAC::RunElevated&lt;br /&gt;
    StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user?&lt;br /&gt;
    StrCmp 0 $0 0 UAC_Err ; Error?&lt;br /&gt;
    StrCmp 1 $1 0 UAC_Success ;Are we the real deal or just the wrapper?&lt;br /&gt;
    Quit&lt;br /&gt;
    &lt;br /&gt;
  UAC_ElevationAborted:&lt;br /&gt;
    # elevation was aborted, run as normal?&lt;br /&gt;
    MessageBox MB_ICONSTOP &amp;quot;This installer requires admin access, aborting!&amp;quot;&lt;br /&gt;
    Abort&lt;br /&gt;
&lt;br /&gt;
  UAC_Err:&lt;br /&gt;
    MessageBox MB_ICONSTOP &amp;quot;Unable to elevate, error $0&amp;quot;&lt;br /&gt;
    Abort&lt;br /&gt;
&lt;br /&gt;
  UAC_Success:&lt;br /&gt;
    StrCmp 1 $3 +4 ;Admin?&lt;br /&gt;
    StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?&lt;br /&gt;
    MessageBox MB_ICONSTOP &amp;quot;This installer requires admin access, try again&amp;quot;&lt;br /&gt;
    goto UAC_Elevate &lt;br /&gt;
FunctionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Code Examples]]&lt;br /&gt;
[[Category:Java]]&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17555</id>
		<title>Talk:Java Launcher with automatic JRE installation</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17555"/>
		<updated>2009-08-20T18:19:18Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think that this solution has a security hole in it - the Java app will get launched with elevated permissions if the JRE had to be downloaded.&lt;br /&gt;
&lt;br /&gt;
I believe that you want to use:&lt;br /&gt;
&lt;br /&gt;
  UAC::Exec &#039;&#039; &#039;$0&#039; &#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
to launch the application with regular user permissions, if the JRE had to be installed.  I don&#039;t know what will happen if you attempt to use UAC:Exec if you haven&#039;t elevated already (you might have to have a check to determine whether you launch UAC::Exec or just regular Exec)&lt;br /&gt;
&lt;br /&gt;
Finally, you should be calling UAC:Unload in your .OnInstFailed and .OnInstSuccess functions, as follows:&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstFailed&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstSuccess&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17554</id>
		<title>Talk:Java Launcher with automatic JRE installation</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17554"/>
		<updated>2009-08-20T18:16:52Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think that this solution has a security hole in it - the Java app will get launched with elevated permissions if the JRE had to be downloaded.&lt;br /&gt;
&lt;br /&gt;
I believe that you want to use:&lt;br /&gt;
&lt;br /&gt;
  UAC::Exec &#039;&#039; &#039;javaw.exe -cp blah blah&#039; &#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
to launch the application with regular user permissions, if the JRE had to be installed.  I don&#039;t know what will happen if you attempt to use UAC:Exec if you haven&#039;t elevated already (you might have to have a check to determine whether you launch UAC::Exec or just regular Exec)&lt;br /&gt;
&lt;br /&gt;
Finally, you should be calling UAC:Unload in your .OnInstFailed and .OnInstSuccess functions, as follows:&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstFailed&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;br /&gt;
&lt;br /&gt;
  Function .OnInstSuccess&lt;br /&gt;
    UAC::Unload ;Must call unload!&lt;br /&gt;
  FunctionEnd&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17553</id>
		<title>Talk:Java Launcher with automatic JRE installation</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Talk:Java_Launcher_with_automatic_JRE_installation&amp;diff=17553"/>
		<updated>2009-08-20T18:16:16Z</updated>

		<summary type="html">&lt;p&gt;Trumpetinc: some warnings about how the UAC plugin is being used&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think that this solution has a security hole in it - the Java app will get launched with elevated permissions if the JRE had to be downloaded.&lt;br /&gt;
&lt;br /&gt;
I believe that you want to use:&lt;br /&gt;
&lt;br /&gt;
UAC::Exec &#039;&#039; &#039;javaw.exe -cp blah blah&#039; &#039;&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
to launch the application with regular user permissions, if the JRE had to be installed.  I don&#039;t know what will happen if you attempt to use UAC:Exec if you haven&#039;t elevated already (you might have to have a check to determine whether you launch UAC::Exec or just regular Exec)&lt;br /&gt;
&lt;br /&gt;
Finally, you should be calling UAC:Unload in your .OnInstFailed and .OnInstSuccess functions, as follows:&lt;br /&gt;
&lt;br /&gt;
Function .OnInstFailed&lt;br /&gt;
  UAC::Unload ;Must call unload!&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
Function .OnInstSuccess&lt;br /&gt;
  UAC::Unload ;Must call unload!&lt;br /&gt;
FunctionEnd&lt;/div&gt;</summary>
		<author><name>Trumpetinc</name></author>
	</entry>
</feed>