generate reports using maven-checkstyle-plugin, cobertura-maven-plugin and maven...
[nntprss-ng.git] / nntprss-starter.nsi
blob5a6a129632a4e6f883a34821d49b24a6293aac4c
1 ; nntp//rss application launcher
2 ; Script based upon:
3 ; Jelude launcher - http://www.sfu.ca/~tyuen/jelude/
4 ; Java Launcher http://nsis.sourceforge.net/archive/nsisweb.php?page=326&instances=0,64
5 ;--------- CONFIGURATION ---------
7 !define APPNAME "nntp//rss"
8 !define JARFILE "nntprss-start.jar"
10 ;Uncomment the next line to specify an icon for the EXE.
11 Icon "nntprss.ico"
13 ;---------------------------------
14 Name "nntp//rss"
15 Caption "${APPNAME}"
16 OutFile "nntprss.exe"
18 SilentInstall silent
19 XPStyle on
21 Section ""
22 Call GetJRE
23 Pop $R0
25 StrCpy $R1 ""
26 Call GetParameters
27 Pop $R1
29 StrCpy $R0 '$R0 -jar "${JARFILE}" $R1'
30 SetOutPath $EXEDIR
31 Exec "$R0"
32 Quit
33 SectionEnd
35 Function GetParameters
36 Push $R0
37 Push $R1
38 Push $R2
39 StrCpy $R0 $CMDLINE 1
40 StrCpy $R1 '"'
41 StrCpy $R2 1
42 StrCmp $R0 '"' loop
43 StrCpy $R1 ' '
44 loop:
45 StrCpy $R0 $CMDLINE 1 $R2
46 StrCmp $R0 $R1 loop2
47 StrCmp $R0 "" loop2
48 IntOp $R2 $R2 + 1
49 Goto loop
50 loop2:
51 IntOp $R2 $R2 + 1
52 StrCpy $R0 $CMDLINE 1 $R2
53 StrCmp $R0 " " loop2
54 StrCpy $R0 $CMDLINE "" $R2
55 Pop $R2
56 Pop $R1
57 Exch $R0
58 FunctionEnd
60 Function GetJRE
62 ; Find JRE (Java.exe)
63 ; 1 - in .\jre directory (JRE Installed with application)
64 ; 2 - in JAVA_HOME environment variable
65 ; 3 - in the registry
66 ; 4 - assume java.exe in current dir or PATH
67 Push $R0
68 Push $R1
70 ClearErrors
71 StrCpy $R0 "$EXEDIR\jre\bin\javaw.exe"
72 IfFileExists $R0 JreFound
73 StrCpy $R0 ""
75 ClearErrors
76 ReadEnvStr $R0 "JAVA_HOME"
77 StrCpy $R0 "$R0\bin\javaw.exe"
78 IfErrors 0 JreFound
80 ClearErrors
81 ReadRegStr $R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
82 ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R1" "JavaHome"
83 StrCpy $R0 "$R0\bin\javaw.exe"
85 IfErrors 0 JreFound
86 Sleep 800
87 MessageBox MB_ICONEXCLAMATION|MB_YESNO \
88 'Could not find a Java Runtime Environment installed on your computer. \
89 $\nWithout it you cannot run "${APPNAME}". \
90 $\n$\nWould you like to visit the Java website to download it?' \
91 IDNO +2
92 ExecShell open "http://java.sun.com/getjava"
93 Quit
95 JreFound:
96 Pop $R1
97 Exch $R0
98 FunctionEnd