Skip to content

Commit

Permalink
Added windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
xitiomet committed Jan 14, 2023
1 parent 8fa65c8 commit 350f7c2
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 1 deletion.
3 changes: 3 additions & 0 deletions get_jre.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
jlink.exe -v --add-modules java.base,java.logging,java.management,java.naming,java.security.jgss,java.sql,java.xml --output c:\Users\brian\src\json-roller\jre --strip-debug --compress 2 --no-header-files --no-man-pages
pause
80 changes: 80 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.8</version>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<!-- build native image debian package -->
<execution>
Expand Down Expand Up @@ -154,6 +157,83 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>2.0.1</version>
<executions>
<execution>
<id>l4j-gui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>console</headerType>
<outfile>target/json-roller.exe</outfile>
<jar>target/${project.artifactId}-${project.version}.jar</jar>
<!-- if <dontWrapJar>true</dontWrapJar> change to this conf <jar>${project.artifactId}-${project.version}.jar</jar> -->
<dontWrapJar>false</dontWrapJar>
<errTitle>Error in launch4j plugin</errTitle>
<classPath>
<mainClass>${mainClass}</mainClass>
</classPath>
<icon>src/main/resources/jsonroller.ico</icon>
<jre>
<path>%JAVA_HOME%;%PATH%;jre</path>
<minVersion>1.8.0</minVersion>
<initialHeapSize>512</initialHeapSize>
<maxHeapSize>1024</maxHeapSize>
<opts>
<opt>-Djava.awt.headless=true</opt>
</opts>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>1.0.0.0</txtFileVersion>
<fileDescription>json-roller</fileDescription>
<copyright>Copyright (c) 2019</copyright>
<companyName>openstatic.org</companyName>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<productName>JSONRoller</productName>
<internalName>JSONRoller</internalName>
<originalFilename>json-roller.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.digitalmediaserver</groupId>
<artifactId>nsis-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<makensisExecutable>C:\Program Files (x86)\NSIS\makensis.exe</makensisExecutable>
<makensisExecutableLinux>/usr/bin/makensis</makensisExecutableLinux>
<makensisExecutableMacOS></makensisExecutableMacOS>
<compression>lzma</compression>
<compressionIsFinal>true</compressionIsFinal>
<compressionDictSize>64</compressionDictSize>
<defines>
<PROJECT_NAME_SHORT>json-roller</PROJECT_NAME_SHORT>
<PROJECT_NAME_CAMEL>${project.name.camel}</PROJECT_NAME_CAMEL>
</defines>
</configuration>
<executions>
<execution>
<id>build-windows-installer</id>
<configuration>
<scriptFile>${basedir}/src/nsis/json-roller.nsi</scriptFile>
<outputFile>json-roller-setup.exe</outputFile>
</configuration>
<goals>
<goal>generate-headerfile</goal>
<goal>make</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/openstatic/OutputData.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ function makeSortable(table)
var selectEl = document.createElement('select');
selectEl.style.width = '100%';
selectEl.id = 'filter'+j;
createOptions(selectEl, uniqueArray(valuesForColumn(table, j)));
createOptions(selectEl, uniqueArray(valuesForColumn(table, j)).sort(function (a, b) { // sort rows
return (a.localeCompare(b, 'en', {numeric: true}));
}));
let fj = j, ftable = table, fselectEl = selectEl;
selectEl.onchange = function() {
applyFilters();
Expand Down
Binary file added src/main/resources/jsonroller.icns
Binary file not shown.
Binary file added src/main/resources/jsonroller.ico
Binary file not shown.
Binary file added src/main/resources/jsonroller64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 104 additions & 0 deletions src/nsis/json-roller.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
;NSIS Modern User Interface
;Basic Example Script
;Written by Joost Verburg

;--------------------------------
;Include Modern UI

!include "MUI2.nsh"

!include "EnvVarUpdate.nsh"

;--------------------------------
;General

;Name and file
Name "json-roller"

;Default installation folder
InstallDir "$PROGRAMFILES\json-roller"

;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\json-roller" ""

;Request application privileges for Windows Vista
RequestExecutionLevel admin

!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\json-roller"

;--------------------------------
;Interface Settings

!define MUI_ABORTWARNING

;--------------------------------
;Pages

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES


;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "json-roller" Main
SectionIn RO
WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayName" "JSON Roller"
WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayIcon" "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "${REG_UNINSTALL}" "DisplayVersion" "1.0"
WriteRegStr HKLM "${REG_UNINSTALL}" "Publisher" "openstatic.org"
WriteRegStr HKLM "${REG_UNINSTALL}" "InstallSource" "$EXEDIR\"

${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR"
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"

;Under WinXP this creates two separate buttons: "Modify" and "Remove".
;"Modify" will run installer and "Remove" will run uninstaller.
WriteRegDWord HKLM "${REG_UNINSTALL}" "NoModify" 1
WriteRegDWord HKLM "${REG_UNINSTALL}" "NoRepair" 0
WriteRegStr HKLM "${REG_UNINSTALL}" "UninstallString" '"$INSTDIR\Uninstall.exe"'

SetOutPath "$INSTDIR"

File ${PROJECT_BUILD_DIR}\json-roller.exe

;Store installation folder
WriteRegStr HKCU "Software\json-roller" "" $INSTDIR

;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd

Section "Java Runtime Environment" java

SetOutPath "$INSTDIR\jre"
File /r "${PROJECT_BASEDIR}\jre\*"
SectionEnd

;--------------------------------
;Uninstaller Section

Section "Uninstall"

;ADD YOUR OWN FILES HERE...

Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\json-roller.exe"
RMDir /r "$INSTDIR"

${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR"
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"

DeleteRegKey /ifempty HKCU "Software\json-roller"
DeleteRegKey HKLM "${REG_UNINSTALL}"
SectionEnd

0 comments on commit 350f7c2

Please sign in to comment.