# Auto-generated by EclipseNSIS Script Wizard # 29.12.2005 01:09:51 !ifndef VERSION !define VERSION "2.1" !endif Name "JabRef ${VERSION}" !define REGKEY "SOFTWARE\$(^Name)" !define COMPANY "JabRef Team" !define URL http://jabref.sourceforge.net/ # MUI defines !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-full.ico" !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\JabRef" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup !define MUI_STARTMENUPAGE_DEFAULT_FOLDER "JabRef" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-full.ico" !define MUI_FINISHPAGE_RUN $INSTDIR/JabRef.exe !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_COMPONENTSPAGE_SMALLDESC # Included files !include Sections.nsh !include MUI.nsh !include fileassoc.nsh # Reserved Files # Variables Var StartMenuGroup # Installer pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE dist/GPL.txt !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES # Installer languages !insertmacro MUI_LANGUAGE English # Installer attributes OutFile JabRefSetup.exe InstallDir "$PROGRAMFILES\JabRef" CRCCheck on XPStyle on ShowInstDetails show VIProductVersion 1.3.0.0 VIAddVersionKey ProductName "JabRef" VIAddVersionKey ProductVersion "${VERSION}" VIAddVersionKey CompanyName "${COMPANY}" VIAddVersionKey CompanyWebsite "${URL}" VIAddVersionKey FileVersion "" VIAddVersionKey FileDescription "" VIAddVersionKey LegalCopyright "" InstallDirRegKey HKLM "${REGKEY}" Path ShowUninstDetails show # Installer sections Section -Main SEC0000 SetOutPath $INSTDIR SetOverwrite on File /r dist\*.* WriteRegStr HKLM "${REGKEY}\Components" Main 1 SectionEnd Section "Associate .bib with JabRef" AssociateBib !insertmacro APP_ASSOCIATE "bib" "JabRef.BibTeX" "BibTeX File" "$INSTDIR\JabRef.exe,0" "Open in JabRef" "$INSTDIR\JabRef.exe $\"%1$\"" SectionEnd LangString DESC_AssociateBib {LANG_ENGLISH} "Will associate files of extension .bib with JabRef." !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${AssociateBib} $(DESC_AssociateBib) !insertmacro MUI_FUNCTION_DESCRIPTION_END Section "un.Associate .bib with JabRef" un.AssociateBib !insertmacro APP_UNASSOCIATE "bib" "JabRef.BibTeX" SectionEnd Section -post SEC0001 WriteRegStr HKLM "${REGKEY}" Path $INSTDIR WriteUninstaller $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_BEGIN Application SetOutPath $SMPROGRAMS\$StartMenuGroup CreateShortCut "$SMPROGRAMS\$StartMenuGroup\Start $(^Name).lnk" $INSTDIR\JabRef.exe CreateShortCut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_END WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 SectionEnd # Macro for selecting uninstaller sections !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID Push $R0 ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}" StrCmp $R0 1 0 next${UNSECTION_ID} !insertmacro SelectSection "${UNSECTION_ID}" Goto done${UNSECTION_ID} next${UNSECTION_ID}: !insertmacro UnselectSection "${UNSECTION_ID}" done${UNSECTION_ID}: Pop $R0 !macroend # Uninstaller sections Section /o un.Main UNSEC0000 Delete /REBOOTOK $INSTDIR\jabref.jar Delete /REBOOTOK $INSTDIR\JabRef.exe Delete /REBOOTOK $INSTDIR\GPL.txt Delete /REBOOTOK $INSTDIR\Credits.txt DeleteRegValue HKLM "${REGKEY}\Components" Main SectionEnd Section un.post UNSEC0001 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Start $(^Name).lnk" Delete /REBOOTOK $INSTDIR\uninstall.exe DeleteRegValue HKLM "${REGKEY}" StartMenuGroup DeleteRegValue HKLM "${REGKEY}" Path DeleteRegKey /ifempty HKLM "${REGKEY}\Components" DeleteRegKey /ifempty HKLM "${REGKEY}" RMDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup RMDir /REBOOTOK $INSTDIR SectionEnd # Installer functions Function .onInit InitPluginsDir FunctionEnd # Uninstaller functions Function un.onInit ReadRegStr $INSTDIR HKLM "${REGKEY}" Path ReadRegStr $StartMenuGroup HKLM "${REGKEY}" StartMenuGroup !insertmacro SELECT_UNSECTION Main ${UNSEC0000} FunctionEnd