forked from nodebox/nodebox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelauncher.nsi
51 lines (39 loc) · 1.12 KB
/
makelauncher.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; This script creates a Java launcher for NodeBox.
Name "NodeBox"
Caption "NodeBox"
Icon "platform\windows\installer\nodebox.ico"
OutFile "dist\windows\nodebox\NodeBox.exe"
RequestExecutionLevel user
SilentInstall silent
AutoCloseWindow true
ShowInstDetails nevershow
!define CLASSPATH "lib\nodebox.jar"
!define CLASS "nodebox.client.Application"
!include "FileFunc.nsh"
Section ""
Call GetJRE
Pop $R0
; change for your purpose (-jar etc.)
${GetParameters} $0
StrCpy $0 '"$R0" -Xms128m -Xmx1024m -classpath "${CLASSPATH}" ${CLASS} $0'
SetOutPath $EXEDIR
Exec $0
SectionEnd
; Returns the full path of a valid javaw.exe.
; We assume it is under nodebox\jre\bin\javaw.exe
Function GetJRE
Push $R0
Push $R1
; Use javaw.exe to avoid DOS box.
!define JAVAEXE "javaw.exe"
ClearErrors
StrCpy $R0 "$EXEDIR\jre\bin\${JAVAEXE}"
IfFileExists $R0 JreFound
StrCpy $R0 ""
; Show an error message
MessageBox MB_OK|MB_ICONSTOP "No Java found. Please download NodeBox again from www.nodebox.net."
StrCpy $R0 "${JAVAEXE}" ;; As a last resort, try the current directory.
JreFound:
Pop $R1
Exch $R0
FunctionEnd