--- /dev/null
+;--------- CONFIGURATION ---------\r
+\r
+!define APPNAME "Stigmata: Java birthmarking toolkit"\r
+!define JARFILE "stigmata-1.1.0.jar"\r
+\r
+;Uncomment the next line to specify an icon for the EXE.\r
+Icon "stigmata.ico"\r
+\r
+;Uncomment the next line to specify a splash screen bitmap.\r
+;!define SPLASH_IMAGE "splash.bmp"\r
+\r
+;---------------------------------\r
+\r
+Name "Stigmata"\r
+Caption "${APPNAME}"\r
+OutFile "stigmata.exe"\r
+\r
+SilentInstall silent\r
+AutoCloseWindow true\r
+ShowInstDetails nevershow\r
+XPStyle on\r
+\r
+!addplugindir .\r
+\r
+Section ""\r
+ System::Call "kernel32::CreateMutexA(i 0, i 0, t 'jelude') i .r1 ?e"\r
+ Pop $R0\r
+ StrCmp $R0 0 +2\r
+ Quit\r
+\r
+ ClearErrors\r
+ ReadEnvStr $R0 "JAVA_HOME"\r
+ IfErrors 0 FoundVM\r
+\r
+ ClearErrors\r
+ ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"\r
+ ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R0" "JavaHome"\r
+ IfErrors 0 FoundVM\r
+\r
+ ClearErrors\r
+ ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
+ ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$R0" "JavaHome"\r
+ IfErrors NotFound 0\r
+\r
+ FoundVM:\r
+ StrCpy $R0 "$R0\bin\javaw.exe"\r
+ IfFileExists $R0 0 NotFound\r
+\r
+ StrCpy $R1 ""\r
+ Call GetParameters\r
+ Pop $R1\r
+\r
+ SetOverwrite ifdiff\r
+ SetOutPath $TEMP\r
+ File "..\..\target\${JARFILE}"\r
+ File "..\..\target\BrowserLauncher2-1.2.jar"\r
+ File "..\..\target\commons-beanutils-1.7.0.jar"\r
+ File "..\..\target\Jama-1.0.2.jar"\r
+ File "..\..\target\commons-cli-1.1.jar"\r
+ File "..\..\target\xmlcli-1.2.1.jar"\r
+ File "..\..\target\asm-all-2.2.3.jar"\r
+ File "..\..\target\commons-logging-1.0.3.jar"\r
+ StrCpy $R0 '$R0 -Dexecution.directory="$EXEDIR" -jar "${JARFILE}" $R1'\r
+\r
+ !ifdef SPLASH_IMAGE\r
+ SetOutPath $TEMP\r
+ File /oname=spltmp.bmp "${SPLASH_IMAGE}"\r
+ Splash::show 4000 "$TEMP\spltmp"\r
+ Delete "$TEMP\spltmp.bmp"\r
+ !endif\r
+\r
+ ExecWait "$R0"\r
+ Delete "${JARFILE}"\r
+ Delete "BrowserLauncher2-1.2.jar"\r
+ Delete "commons-beanutils-1.7.0.jar"\r
+ Delete "Jama-1.0.2.jar"\r
+ Delete "commons-cli-1.1.jar"\r
+ Delete "xmlcli-1.2.1.jar"\r
+ Delete "asm-all-2.2.3.jar"\r
+ Delete "commons-logging-1.0.3.jar"\r
+\r
+ Quit\r
+\r
+ NotFound:\r
+ Sleep 800\r
+ MessageBox MB_ICONEXCLAMATION|MB_YESNO \\r
+ 'Could not find a Java Runtime Environment installed on your computer. \\r
+ $\nWithout it you cannot run "${APPNAME}". \\r
+ $\n$\nWould you like to visit the Java website to download it?' \\r
+ IDNO +2\r
+ ExecShell open "http://java.sun.com/getjava"\r
+ Quit\r
+SectionEnd\r
+\r
+Function GetParameters\r
+ Push $R0\r
+ Push $R1\r
+ Push $R2\r
+ StrCpy $R0 $CMDLINE 1\r
+ StrCpy $R1 '"'\r
+ StrCpy $R2 1\r
+ StrCmp $R0 '"' loop\r
+ StrCpy $R1 ' '\r
+ loop:\r
+ StrCpy $R0 $CMDLINE 1 $R2\r
+ StrCmp $R0 $R1 loop2\r
+ StrCmp $R0 "" loop2\r
+ IntOp $R2 $R2 + 1\r
+ Goto loop\r
+ loop2:\r
+ IntOp $R2 $R2 + 1\r
+ StrCpy $R0 $CMDLINE 1 $R2\r
+ StrCmp $R0 " " loop2\r
+ StrCpy $R0 $CMDLINE "" $R2\r
+ Pop $R2\r
+ Pop $R1\r
+ Exch $R0\r
+FunctionEnd
\ No newline at end of file