Skip to content

Commit

Permalink
Double-click on JAR doesn't launch the application #32 (#34)
Browse files Browse the repository at this point in the history
* Add support TLS1.2 to download from gitub.com

* Feature #32: Associate .jar files

* Add installer options samples
  • Loading branch information
douph1 authored and George Adams committed Feb 11, 2019
1 parent 4d0bbcc commit f0dacad
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.de-de.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Als JRE_HOME-Umgebungsvariable verwenden.</String>
<String Id="FeatureSourceTitle">Quellcode</String>
<String Id="FeatureSourceDescription">Quellcode für Klassen, welche die öffentliche API von Java enthalten.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.en-us.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
<String Id="FeatureJreHomeDescription">Set JRE_HOME environment variable.</String>
<String Id="FeatureSourceTitle">Source Code</String>
<String Id="FeatureSourceDescription">Source code for classes that comprise the public API of Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.es-es.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Establecer la variable de entorno JRE_HOME.</String>
<String Id="FeatureSourceTitle">Código fuente</String>
<String Id="FeatureSourceDescription">Código fuente de las clases que componen la API pública de Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.fr-fr.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Définir la variable d'environnement JRE_HOME.</String>
<String Id="FeatureSourceTitle">Code source</String>
<String Id="FeatureSourceDescription">Code source des classes qui composent l'API publique de Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associer les .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associer les fichiers .jar avec AdoptOpenJDK pour execution par double-click</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.ja-jp.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Set JRE_HOME environment variable.</String>
<String Id="FeatureSourceTitle">Source Code</String>
<String Id="FeatureSourceDescription">Source code for classes that comprise the public API of Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.zh-cn.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Set JRE_HOME environment variable.</String>
<String Id="FeatureSourceTitle">Source Code</String>
<String Id="FeatureSourceDescription">Source code for classes that comprise the public API of Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
2 changes: 2 additions & 0 deletions wix/Lang/OpenJDK.Base.zh-tw.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<String Id="FeatureJreHomeDescription">Set JRE_HOME environment variable.</String>
<String Id="FeatureSourceTitle">Source Code</String>
<String Id="FeatureSourceDescription">Source code for classes that comprise the public API of Java.</String>
<String Id="FeatureJarFileRunWithTitle">Associate .jar</String>
<String Id="FeatureJarFileRunWithDescription">Associate .jar files to run with AdoptOpenJDK</String>
</WixLocalization>
18 changes: 18 additions & 0 deletions wix/Main.hotspot.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@
<Environment Id="JAVA_HOME" Name="JAVA_HOME" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
<?endif?>
<!-- Add jar launch by double click -->
<Component Id="SetJarFileRunWith" Guid="*">
<!--
https://support.microsoft.com/en-us/help/256986/windows-registry-information-for-advanced-users
If you write keys to a key under HKEY_CLASSES_ROOT, the system stores the information under HKEY_LOCAL_MACHINE\Software\Classes.
If you write values to a key under HKEY_CLASSES_ROOT, and the key already exists under HKEY_CURRENT_USER\Software\Classes, the system will store the information there instead of under HKEY_LOCAL_MACHINE\Software\Classes.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar\OpenWithProgids
is automatically created by Windows when running jar file for the first time
-->
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\.jar" Type="string" Value="AdoptOpenJDK.jarfile" KeyPath="yes" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\.jar" Type="string" Name="Content Type" Value="application/jar" KeyPath="no" />

<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\AdoptOpenJDK.jarfile\shell\open\command" Type="string" Value="&quot;[INSTALLDIR]bin\javaw.exe&quot; -jar &quot;%1&quot; %*" KeyPath="no" />
</Component>
</DirectoryRef>

<!-- List of features to install -->
Expand All @@ -95,6 +110,9 @@
<Feature Id="FeatureEnvironment" Level="1" Title="!(loc.FeatureEnvironmentTitle)" Description="!(loc.FeatureEnvironmentDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="AddToEnvironmentPath" />
</Feature>
<Feature Id="FeatureJarFileRunWith" Level="1" Title="!(loc.FeatureJarFileRunWithTitle)" Description="!(loc.FeatureJarFileRunWithDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJarFileRunWith" />
</Feature>
<?if $(env.PRODUCT_CATEGORY)="jre"?>
<Feature Id="FeatureJreHome" Level="2" Title="!(loc.FeatureJreHomeTitle)" Description="!(loc.FeatureJreHomeDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJreHomeVariable" />
Expand Down
18 changes: 18 additions & 0 deletions wix/Main.openj9.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@
<Environment Id="JAVA_HOME" Name="JAVA_HOME" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
<?endif?>
<!-- Add jar launch by double click -->
<Component Id="SetJarFileRunWith" Guid="*">
<!--
https://support.microsoft.com/en-us/help/256986/windows-registry-information-for-advanced-users
If you write keys to a key under HKEY_CLASSES_ROOT, the system stores the information under HKEY_LOCAL_MACHINE\Software\Classes.
If you write values to a key under HKEY_CLASSES_ROOT, and the key already exists under HKEY_CURRENT_USER\Software\Classes, the system will store the information there instead of under HKEY_LOCAL_MACHINE\Software\Classes.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jar\OpenWithProgids
is automatically created by Windows when running jar file for the first time
-->
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\.jar" Type="string" Value="AdoptOpenJDK.jarfile" KeyPath="yes" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\.jar" Type="string" Name="Content Type" Value="application/jar" KeyPath="no" />

<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\AdoptOpenJDK.jarfile\shell\open\command" Type="string" Value="&quot;[INSTALLDIR]bin\javaw.exe&quot; -jar &quot;%1&quot; %*" KeyPath="no" />
</Component>
</DirectoryRef>

<!-- List of features to install -->
Expand All @@ -95,6 +110,9 @@
<Feature Id="FeatureEnvironment" Level="1" Title="!(loc.FeatureEnvironmentTitle)" Description="!(loc.FeatureEnvironmentDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="AddToEnvironmentPath" />
</Feature>
<Feature Id="FeatureJarFileRunWith" Level="1" Title="!(loc.FeatureJarFileRunWithTitle)" Description="!(loc.FeatureJarFileRunWithDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJarFileRunWith" />
</Feature>
<?if $(env.PRODUCT_CATEGORY)="jre"?>
<Feature Id="FeatureJreHome" Level="2" Title="!(loc.FeatureJreHomeTitle)" Description="!(loc.FeatureJreHomeDescription)" Absent="allow" AllowAdvertise="no" InstallDefault="followParent">
<ComponentRef Id="SetJreHomeVariable" />
Expand Down
18 changes: 18 additions & 0 deletions wix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,21 @@
If Java Runtime Environment need to be build with Eclipse OpenJ9 only.

5. Deploy via Active Directory GPO.


5a. Installation optional parameters:
INSTALLLEVEL
1 = (Add to PATH + Associate jar)
2 = (Add to PATH + Associate jar) + define JAVA_HOME
usage sample:
msiexec /i OpenJDK8-jdk_xxx.msi INSTALLLEVEL=1
msiexec /i OpenJDK8-jdk_xxx.msi INSTALLLEVEL=2

Features available:
FeatureEnvironment ( PATH )
FeatureJavaHome (JAVA_HOME)
FeatureJarFileRunWith (associate .jar)

usage sample:
msiexec /i OpenJDK8-jdk_xxx.msi ADDLOCAL=FeatureJavaHome,FeatureJarFileRunWith

1 change: 1 addition & 0 deletions wix/SourceDir/CreateSourceFolder.OpenJDK11.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
$urls = @(
'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11%2B28/OpenJDK11-jdk_x64_windows_hotspot_11_28.zip',
'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11%2B28/OpenJDK11-jdk_x64_windows_openj9_11_28.zip',
Expand Down
1 change: 1 addition & 0 deletions wix/SourceDir/CreateSourceFolder.OpenJDK8.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
$urls = @(
'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u181-b13/OpenJDK8U-jdk_x64_windows_hotspot_8u181b13.zip',
'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u181-b13/OpenJDK8U-jre_x64_windows_hotspot_8u181b13.zip',
Expand Down

0 comments on commit f0dacad

Please sign in to comment.