; 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 "fancyhttpd (__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\fancyhttpd.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\fancyhttpd" ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "__SRCDIR__\..\icons\fancyhttpd.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\fancyhttpd.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 "fancyhttpd-${PRODUCT_VERSION}-setup-${ARCHITECTURE}.exe" InstallDir "$__PROGRAMFILES__\fancyhttpd" 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 fancyhttpd 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/fancyhttpd.exe" File "__SRCDIR__/../icons/fancyhttpd.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\fancyhttpd" CreateShortCut "$SMPROGRAMS\fancyhttpd\fancyhttpd.lnk" "$INSTDIR\bin\fancyhttpd.exe" CreateShortCut "$DESKTOP\fancyhttpd.lnk" "$INSTDIR\bin\fancyhttpd.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\fancyhttpd.ico" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "IconIndex" "0" WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "IDList" "" CreateShortCut "$SMPROGRAMS\fancyhttpd\fancyhttpd Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" "" "$INSTDIR\bin\fancyhttpd.ico" CreateShortCut "$SMPROGRAMS\fancyhttpd\Uninstall fancyhttpd.lnk" "$INSTDIR\uninst.exe" SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\fancyhttpd.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\fancyhttpd.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 "fancyhttpd has been successfully uninstalled." FunctionEnd Function un.onInit SetRegView __REGVIEW__ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Would you like to uninstall fancyhttpd and all its components?" IDYES +2 Abort FunctionEnd Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\bin\fancyhttpd.exe" Delete "$INSTDIR\bin\*.dll" Delete "$INSTDIR\bin\*.ico" Delete "$SMPROGRAMS\fancyhttpd\Uninstall fancyhttpd.lnk" Delete "$SMPROGRAMS\fancyhttpd\fancyhttpd Website.lnk" Delete "$DESKTOP\fancyhttpd.lnk" Delete "$SMPROGRAMS\fancyhttpd\fancyhttpd.lnk" RMDir "$SMPROGRAMS\fancyhttpd" 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