Best Java Launcher: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with ";This is a very simple Java Launcher ;Author: Sri Harsha Chilakapati !include FileFunc.nsi Crccheck off icon icon.ico outfile test.exe silentinstall silent section '' section...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
;This is a very simple Java Launcher
{{PageAuthor|Sriharshach}}
;Author: Sri Harsha Chilakapati
== About ==
This script will produce an EXE that can be prepended to a JAVA jar file to produce a self executable java application.


!include FileFunc.nsi
== Usage ==
Crccheck off
# Compile NSIS script
# Execute from the DOS / Command Prompt:
<highlight-dos>
copy /b test.exe+myjar.jar output.exe
</highlight-dos>


icon icon.ico
== Script ==
outfile test.exe
<highlight-nsis>;This is a very simple Java Launcher
 
;Author: Sri Harsha Chilakapati
silentinstall silent
 
 
  !include FileFunc.nsh
section ''
  Crccheck off
sectionend
 
 
  ;icon icon.ico
function .onInit
  outfile test.exe
  ${GetExeName} $0
 
  ${GetParameters} $1
  silentinstall silent
  execwait 'javaw.exe "$0" "$1"'
 
functionend
  section '1'
  sectionend
 
  function .onInit
    ${GetExeName} $0
    ${GetParameters} $1
    execwait 'javaw.exe "$0" "$1"'
  functionend


;usage: copy/b test.exe+myjar.jar output.exe
;usage: copy /b test.exe+myjar.jar output.exe</highlight-nsis>

Latest revision as of 00:58, 3 March 2011

Author: Sriharshach (talk, contrib)


About

This script will produce an EXE that can be prepended to a JAVA jar file to produce a self executable java application.

Usage

  1. Compile NSIS script
  2. Execute from the DOS / Command Prompt:
copy /b test.exe+myjar.jar output.exe

Script

;This is a very simple Java Launcher
;Author: Sri Harsha Chilakapati
 
  !include FileFunc.nsh
  Crccheck off
 
  ;icon icon.ico
  outfile test.exe
 
  silentinstall silent
 
  section '1'
  sectionend
 
  function .onInit
    ${GetExeName} $0
    ${GetParameters} $1
    execwait 'javaw.exe "$0" "$1"'
  functionend
 
;usage: copy /b test.exe+myjar.jar output.exe