; The file to write OutFile "installJMSK102_030507t.exe" LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf" Name "JMSK" Caption "JMSK-Setup" LicenseText "Lizenzbestimmungen" LicenseData "lizenz.txt" Page license CheckJava Page components Page directory Page instfiles ; The default installation directory InstallDir "$PROGRAMFILES\JMSK" ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM SOFTWARE\JMSK "Install_Dir" ; The text to prompt the user to enter a directory ComponentText "Hiermit installieren Sie JMSK v1.0.2 - The Java Control Utillity for MSK33." ; The text to prompt the user to enter a directory DirText "Installationsverzeichnis:" Function CheckJava ReadRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\" "CurrentVersion" ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$0" "JavaHome" IfErrors nojava java nojava: MessageBox MB_OK 'Es konnte kein Java Runtime Environment gefunden werden! Vor der Installation von JMSK$\nmuss ein JRE (Version 1.3.1 oder höher) installiert werden.' Quit java: FunctionEnd ; The stuff to install Section "JMSK Applikation (benötigt)" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File "JMSK.jar" File "logo.gif" File "props.dat" File "jmsk.ico" CreateDirectory "$INSTDIR\Help" SetFileAttributes "$INSTDIR\Help" NORMAL SetOutPath $INSTDIR\Help" File "Help\*.*" CreateDirectory "$INSTDIR\Help\images" SetFileAttributes "$INSTDIR\Help\images" NORMAL SetOutPath $INSTDIR\Help\images" File "images\*.*" CreateDirectory "$INSTDIR\Messungen" SetOutPath $INSTDIR\Messungen" File "beispiel.mes" CreateDirectory "$INSTDIR\tva" SetOutPath $INSTDIR\tva" File "TVAChannels.tva" CreateDirectory "$INSTDIR\tvd" SetOutPath $INSTDIR\tvd" File "TVDChannels.tvd" CreateDirectory "$INSTDIR\fm" SetOutPath $INSTDIR\fm" File "RadioFreqs.fm" CreateDirectory "$INSTDIR\Messungen" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\JMSK "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMSK" "DisplayName" "JMSK 1.0.2 (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMSK" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" ReadRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\" "CurrentVersion" ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$0" "JavaHome" SetOutPath "$1\bin" File "win32com.dll" SetOutPath "$1\lib\ext" File "comm.jar" SetOutPath "$1\lib" File "javax.comm.properties" SectionEnd ; optional section Section "Start Menu Verknüpfungen" SetOutPath $INSTDIR CreateDirectory "$SMPROGRAMS\JMSK" CreateShortCut "$SMPROGRAMS\JMSK\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\JMSK\JMSK.lnk" "$1\bin\javaw.exe" "-jar JMSK.jar" "$INSTDIR\jmsk.ico" 0 CreateShortCut "$SMPROGRAMS\JMSK\Hilfe.lnk" "$INSTDIR\Help\index.html" SectionEnd ; optional section Section "Desktop Verknüpfung" SetOutPath $INSTDIR CreateShortCut "$DESKTOP\JMSK.lnk" "$1\bin\javaw.exe" "-jar JMSK.jar" "$INSTDIR\jmsk.ico" 0 SectionEnd ; uninstall stuff UninstallText "Hiermit deinstallieren sie JMSK 1.0.2." ; special uninstall section. Section "Uninstall" ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMSK" DeleteRegKey HKLM SOFTWARE\JMSK ; remove files Delete "$INSTDIR\JMSK.jar" Delete "$INSTDIR\props.dat" Delete "$INSTDIR\jmsk.ico" Delete "$INSTDIR\tva\TVAChannels.tva" Delete "$INSTDIR\tvd\TVDChannels.tvd" Delete "$INSTDIR\fm\RadioFreqs.fm" Delete "$INSTDIR\logo.gif" Delete "$INSTDIR\Messungen\TestMessung.mes" Delete "$INSTDIR\Help\images\*.*" Delete "$INSTDIR\Help\*.*" RMdir "$INSTDIR\Help\images" RMdir "$INSTDIR\Help" ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe ; remove shortcuts, if any. Delete "$SMPROGRAMS\JMSK\*.*" Delete "$DESKTOP\JMSK.lnk" ; remove directories used. ReadRegStr $R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\" "CurrentVersion" ReadRegStr $R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$R0" "JavaHome" Delete "$R1\bin\win32com.dll" Delete "$R1\lib\ext\comm.jar" Delete "$R1\lib\javax.comm.properties" SectionEnd ; eof