# Auto-generated by EclipseNSIS Script Wizard # Dec 12, 2006 3:54:07 PM Name Mirth # Defines !define REGKEY "SOFTWARE\$(^Name)" !define VERSION 1.3.0 !define COMPANY "WebReach, Inc." !define URL http://www.webreachinc.com # MUI defines !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico" !define MUI_LICENSEPAGE_RADIOBUTTONS !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM !define MUI_STARTMENUPAGE_NODISABLE !define MUI_STARTMENUPAGE_REGISTRY_KEY Software\Mirth !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup !define MUI_STARTMENUPAGE_DEFAULT_FOLDER Mirth !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" !define MUI_UNFINISHPAGE_NOAUTOCLOSE # Included files !include Sections.nsh !include MUI.nsh # Reserved Files # Variables Var StartMenuGroup # Installer pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE licenses\license-mirth.txt !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup !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 mirth-setup.exe InstallDir $PROGRAMFILES\Mirth CRCCheck on XPStyle on ShowInstDetails show VIProductVersion 1.3.0.0 VIAddVersionKey ProductName Mirth 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\conf SetOverwrite on File setup\conf\dbdrivers.xml File setup\conf\log4j.properties File setup\conf\mirth.properties File setup\conf\mule-boot.xml File setup\conf\version.properties SetOutPath $INSTDIR\lib File /r setup\lib\* SetOutPath $INSTDIR\web File /r setup\web\* SetOutPath $INSTDIR\mirthdb File /r mirthdb\* SetOutPath $INSTDIR\conf File conf\derby-user.xml File conf\derby-channel.xml File conf\derby-configuration.xml File conf\derby-event.xml File conf\derby-message.xml File conf\derby-script.xml File conf\derby-SqlMapConfig.properties File conf\derby-SqlMapConfig.xml File conf\derby-statistic.xml File conf\derby-template.xml SetOutPath $INSTDIR File setup\keystore File setup\launcher.xml File setup\Mirth.bat File setup\mirth-launcher.jar File setup\mirth-server.jar File InstallMirth-NT.bat File mirth.sh File mirth-daemon File StartMirth-NT.bat File StopMirth-NT.bat File UninstallMirth-NT.bat File wrapper.exe File wrapper-x86-32bit SetOutPath $INSTDIR\conf File conf\wrapper.conf SetOutPath $SMPROGRAMS\$StartMenuGroup CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Mirth Server.lnk" $PROGRAMFILES\Mirth WriteRegStr HKLM "${REGKEY}\Components" Main 1 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\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 "$SMPROGRAMS\$StartMenuGroup\Mirth Server.lnk" Delete /REBOOTOK $INSTDIR\conf\wrapper.conf Delete /REBOOTOK $INSTDIR\wrapper-x86-32bit Delete /REBOOTOK $INSTDIR\wrapper.exe Delete /REBOOTOK $INSTDIR\UninstallMirth-NT.bat Delete /REBOOTOK $INSTDIR\StopMirth-NT.bat Delete /REBOOTOK $INSTDIR\StartMirth-NT.bat Delete /REBOOTOK $INSTDIR\mirth-daemon Delete /REBOOTOK $INSTDIR\mirth.sh Delete /REBOOTOK $INSTDIR\InstallMirth-NT.bat Delete /REBOOTOK $INSTDIR\mirth-server.jar Delete /REBOOTOK $INSTDIR\mirth-launcher.jar Delete /REBOOTOK $INSTDIR\Mirth.bat Delete /REBOOTOK $INSTDIR\launcher.xml Delete /REBOOTOK $INSTDIR\keystore Delete /REBOOTOK $INSTDIR\conf\derby-template.xml Delete /REBOOTOK $INSTDIR\conf\derby-statistic.xml Delete /REBOOTOK $INSTDIR\conf\derby-SqlMapConfig.xml Delete /REBOOTOK $INSTDIR\conf\derby-SqlMapConfig.properties Delete /REBOOTOK $INSTDIR\conf\derby-script.xml Delete /REBOOTOK $INSTDIR\conf\derby-message.xml Delete /REBOOTOK $INSTDIR\conf\derby-event.xml Delete /REBOOTOK $INSTDIR\conf\derby-configuration.xml Delete /REBOOTOK $INSTDIR\conf\derby-channel.xml Delete /REBOOTOK $INSTDIR\conf\derby-user.xml RmDir /r /REBOOTOK $INSTDIR\mirthdb RmDir /r /REBOOTOK $INSTDIR\web RmDir /r /REBOOTOK $INSTDIR\lib Delete /REBOOTOK $INSTDIR\conf\version.properties Delete /REBOOTOK $INSTDIR\conf\mule-boot.xml Delete /REBOOTOK $INSTDIR\conf\mirth.properties Delete /REBOOTOK $INSTDIR\conf\log4j.properties Delete /REBOOTOK $INSTDIR\conf\dbdrivers.xml 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 $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