# Auto-generated by EclipseNSIS Script Wizard # 01.02.2008 13:45:33 Name "Reportal Designer" SetCompressor /SOLID bzip2 # Defines !define REGKEY "SOFTWARE\$(^Name)" !define PRODUCT_NAME "Rxxx" !define VERSION 2.1.0 !define COMPANY xxx !define URL http://www.xxx.de !define LANG_DE "deutsch" !define LANG_EN "english" # MUI defines !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY} !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}" !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_LANGDLL_REGISTRY_ROOT HKLM !define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} !define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage # Included files, plugins, directories !include Sections.nsh !include MUI.nsh !addplugindir .\plugins !addincludedir .\plugins !include defines.nsh !include InstallOptions.nsh # Reserved Files !insertmacro MUI_RESERVEFILE_LANGDLL # Variables Var StartMenuGroup # Installer pages !insertmacro MUI_PAGE_WELCOME Page custom TestStart TestLeave "" !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 !insertmacro MUI_LANGUAGE German # Installer attributes OutFile xxx.exe InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" CRCCheck on XPStyle on ShowInstDetails show VIProductVersion 2.1.0.0 VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "${PRODUCT_NAME}" VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}" VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}" VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "" VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "" InstallDirRegKey HKLM "${REGKEY}" Path ShowUninstDetails show # Installer sections Section -Main SEC0000 SetOutPath $INSTDIR SetOverwrite on #File /r "exportedProject\eclipse\*" #File /r "exportedProject\docs\*.pdf" WriteRegStr HKLM "${REGKEY}\Components" Main 1 SectionEnd Section -post SEC0001 WriteRegStr HKLM "${REGKEY}" Path $INSTDIR SetOutPath $INSTDIR WriteUninstaller $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_BEGIN Application SetOutPath $SMPROGRAMS\$StartMenuGroup CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} (${LANG_DE}).lnk" "$INSTDIR\ReportalDesigner.exe" "-nl de" CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} (${LANG_EN}).lnk" "$INSTDIR\ReportalDesigner.exe" "-nl en" CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} Dokumentation (${LANG_DE}).lnk" "$INSTDIR\Reportal Designer Benutzer Dokumentation.pdf" CreateShortcut "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} Documentation (${LANG_EN}).lnk" "$INSTDIR\Reportal Designer User Documentation.pdf" !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 DeleteRegValue HKLM "${REGKEY}\Components" Main SectionEnd Section -un.post UNSEC0001 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" Delete /REBOOTOK $INSTDIR\uninstall.exe Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} (${LANG_DE}).lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} (${LANG_EN}).lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} Dokumentation (${LANG_DE}).lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\${PRODUCT_NAME} Documentation (${LANG_EN}).lnk" DeleteRegValue HKLM "${REGKEY}" StartMenuGroup DeleteRegValue HKLM "${REGKEY}" Path DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components" DeleteRegKey /IfEmpty HKLM "${REGKEY}" RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup RmDir /r /REBOOTOK $INSTDIR Push $R0 StrCpy $R0 $StartMenuGroup 1 StrCmp $R0 ">" no_smgroup no_smgroup: Pop $R0 SectionEnd # Installer functions Function .onInit InitPluginsDir !insertmacro MUI_LANGDLL_DISPLAY !insertmacro INSTALLOPTIONS_EXTRACT "FileSelection.ini" FunctionEnd var tso Function TestStart # THIS CODE IS WRONG! ----------------------------------------------------- !insertmacro INSTALLOPTIONS_DISPLAY "FileSelection.ini" readINIStr $tso "FileSelection.ini" "Field 1" "State" StrCmp $tso "DirBrowseButton" Dialog NoDialog Dialog: Dialogs::Open "Jar Files (*.jar)|*.jar|" "4" "Choose a file from the list" $EXEDIR ${VAR_6} NoDialog: FunctionEND Function TestLeave FunctionEND # Uninstaller functions Function un.onInit ReadRegStr $INSTDIR HKLM "${REGKEY}" Path !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup !insertmacro MUI_UNGETLANGUAGE !insertmacro SELECT_UNSECTION Main ${UNSEC0000} FunctionEnd # Installer Language Strings # TODO Update the Language Strings with the appropriate translations. LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" LangString ^UninstallLink ${LANG_GERMAN} "Uninstall $(^Name)"