; Placeholders for sed: ; ; __VERSION__ product version ; __ARCHITECTURE__ short architecture name (x86 or x64) ; __ARCHTRIPLET__ architecture triplet for searching locally installed files. ; __PROGRAMFILES__ name program files variable (PROGRAMFILES or PROGRAMFILES64) ; __REGVIEW__ registry view (32 or 64) ; __SRCDIR__ top sourcedir ; ; Script generated by the HM NIS Edit Script Wizard. ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "pba-hellobigworld-portable (__ARCHITECTURE__)" !define PRODUCT_VERSION "__VERSION__" !define PRODUCT_PUBLISHER "Clazzes.org" !define PRODUCT_WEB_SITE "https://confluence.clazzes.org/x/aIAo" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\pba-hellobigworld-portable.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" !define PRODUCT_PATH_REGKEY "Software\Clazzes.org\pba-hellobigworld-portable" ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "__SRCDIR__\..\icons\pba-hellobigworld-portable.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ; Language Selection Dialog Settings !define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" !define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" !define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !insertmacro MUI_PAGE_LICENSE "__SRCDIR__\..\doc\LICENSE.txt" ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !define MUI_FINISHPAGE_RUN "$INSTDIR\bin\pba-hellobigworld-portable.exe" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "German" !define ARCHITECTURE "__ARCHITECTURE__" !define PREFIX "/usr/__ARCHTRIPLET__" !define LOCAL_PREFIX "./install-root/usr/__ARCHTRIPLET__" ; MUI end ------ Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "pba-hellobigworld-portable-${PRODUCT_VERSION}-setup-${ARCHITECTURE}.exe" InstallDir "$__PROGRAMFILES__\pba-hellobigworld-portable" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show Var INSTMODE Function .onInit SetRegView __REGVIEW__ ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" IfErrors fromscratch 0 MessageBox MB_OKCANCEL "There is another version of pba-hellobigworld-portable currently installed. Run Uninstaller $0 now?" IDOK +2 IDCANCEL +1 Abort "Installation aborted by the user." ReadRegStr $INSTDIR HKLM "${PRODUCT_PATH_REGKEY}" "instdir" ExecWait '$0 _?=$INSTDIR' StrCpy $INSTMODE "update" goto goon fromscratch: StrCpy $INSTMODE "install" goon: FunctionEnd Section "main" SEC01 SetOutPath "$INSTDIR\bin" File "${LOCAL_PREFIX}/bin/pba-hellobigworld-portable.exe" File "__SRCDIR__/../icons/pba-hellobigworld-portable.ico" #File "${PREFIX}/bin/libintl-8.dll" #File "${PREFIX}/bin/libiconv-2.dll" #File "${PREFIX}/bin/libpng15-15.dll" #File "${PREFIX}/bin/zlib1.dll" #File "${PREFIX}/bin/libgcc_s_sjlj-1.dll" #File "${PREFIX}/bin/libstdc++-6.dll" CreateDirectory "$SMPROGRAMS\pba-hellobigworld-portable" CreateShortCut "$SMPROGRAMS\pba-hellobigworld-portable\pba-hellobigworld-portable.lnk" "$INSTDIR\bin\pba-hellobigworld-portable.exe" CreateShortCut "$DESKTOP\pba-hellobigworld-portable.lnk" "$INSTDIR\bin\pba-hellobigworld-portable.exe" SetOutPath "$INSTDIR\doc" File "__SRCDIR__/../doc/*.txt" SectionEnd Section -AdditionalIcons SetOutPath $INSTDIR WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "IconFile" "$INSTDIR\bin\pba-hellobigworld-portable.ico" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "IconIndex" "0" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "IDList" "" CreateShortCut "$SMPROGRAMS\pba-hellobigworld-portable\pba-hellobigworld-portable Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" "" "$INSTDIR\bin\pba-hellobigworld-portable.ico" CreateShortCut "$SMPROGRAMS\pba-hellobigworld-portable\Uninstall pba-hellobigworld-portable.lnk" "$INSTDIR\uninst.exe" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\pba-hellobigworld-portable.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\pba-hellobigworld-portable.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" WriteRegStr HKLM "${PRODUCT_PATH_REGKEY}" "instdir" "$INSTDIR" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "pba-hellobigworld-portable has been successfully uninstalled." FunctionEnd Function un.onInit SetRegView __REGVIEW__ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Would you like to uninstall pba-hellobigworld-portable and all its components?" IDYES +2 Abort FunctionEnd Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\bin\pba-hellobigworld-portable.exe" Delete "$INSTDIR\bin\*.dll" Delete "$INSTDIR\bin\*.ico" Delete "$SMPROGRAMS\pba-hellobigworld-portable\Uninstall pba-hellobigworld-portable.lnk" Delete "$SMPROGRAMS\pba-hellobigworld-portable\pba-hellobigworld-portable Website.lnk" Delete "$DESKTOP\pba-hellobigworld-portable.lnk" Delete "$SMPROGRAMS\pba-hellobigworld-portable\pba-hellobigworld-portable.lnk" RMDir "$SMPROGRAMS\pba-hellobigworld-portable" RMDir "$INSTDIR\bin" RMDir "$INSTDIR\share" Delete "$INSTDIR\doc\*.txt" RMDir "$INSTDIR\doc" RMDir "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" DeleteRegKey HKLM "${PRODUCT_PATH_REGKEY}" SetAutoClose true SectionEnd