;NSIS Setup Script for WHFC ;-------------------------------- ; ; Layout should be ; C:\src\install\whfc.exe ; C:\src\install\\regmon.exe ; C:\src\install\\whfcmon.dll ; C:\src\install\GPL.txt ; C:\src\install\langdll\ !include "MUI.nsh" !define VERSION "1.2.4" !define INST "C:\src\install" ; - Where to find executables. !define TARGET "nt" ; - Uncomment to build nt setup script. ;!define TARGET "win95" ; - Uncomment to build Win95/98 setup script. Name "WHFC ${VERSION}" OutFile "whfc-${VERSION}-${TARGET}_setup.exe" InstallDir "$PROGRAMFILES\WHFC" InstallDirRegKey HKCU "Software\WHFC" "" SetCompressor /SOLID lzma InstType "Full" InstType "No language extensions" !define MUI_ABORTWARNING !define MUI_FINISHPAGE_RUN "$INSTDIR\whfc.exe" !define MUI_FINISHPAGE_LINK "Visit the WHFC webpage for the latest news and FAQs" !define MUI_FINISHPAGE_LINK_LOCATION "http://whfc.uli-eckhardt.de/" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "..\GPL.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_LANGUAGE "English" ;LoadLanguageFile "French.nlf" ;LoadLanguageFile "German.nlf" ShowUninstDetails show ;-------------------------------- ;Installer Sections Section "!Program Files" SetShellVarContext all SetDetailsPrint textonly DetailPrint "Installing WHFC Core Files..." SetDetailsPrint listonly SectionIn 1 2 RO SetOutPath "$INSTDIR" File "${INST}\whfc.exe" File "${INST}\${TARGET}\regmon.exe" File "${INST}\GPL.txt" SetOutPath "$SYSDIR" File "${INST}\${TARGET}\whfcmon.dll" Exec '"$INSTDIR\regmon.exe" /REGSERVER' ;Store install folder WriteRegStr HKCU "Software\WHFC" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKEY_LOCAL_MACHINE "Software\WHFC" "LangDLLPath" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\WHFC" "DisplayName" "WHFC ${VERSION} (remove only)" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\WHFC" "UninstallString" '"$INSTDIR\uninst.exe"' SectionEnd Section "Language supplements" SectionSetText 3 "Language extension for german, spanish, france and italy" SetShellVarContext all SetDetailsPrint textonly DetailPrint "Installing WHFC language supplements..." SetDetailsPrint listonly SectionIn 1 SetOutPath "$INSTDIR" File "${INST}\langdll\whfclang.de" File "${INST}\langdll\whfclang.es" File "${INST}\langdll\whfclang.fr" File "${INST}\langdll\whfclang.it" SectionEnd Section "Start Menu Shortcuts" SetDetailsPrint textonly DetailPrint "Installing Start Menu ..." SetDetailsPrint listonly SectionIn 1 2 CreateDirectory "$SMPROGRAMS\WHFC" CreateShortCut "$SMPROGRAMS\WHFC\Uninstall WHFC ${VERSION}.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0 CreateShortCut "$SMPROGRAMS\WHFC\Regmon.lnk" "$INSTDIR\regmon.exe" "" "$INSTDIR\regmon.exe" 0 CreateShortCut "$SMPROGRAMS\WHFC\Whfc ${VERSION}.lnk" "$INSTDIR\whfc.exe" "" "$INSTDIR\whfc.exe" 0 SectionEnd Section "Desktop shortcut" SetDetailsPrint textonly DetailPrint "Installing Desktop Shortcut ..." SetDetailsPrint listonly SectionIn 1 2 CreateShortCut "$DESKTOP\WHFC.lnk" "$INSTDIR\whfc.exe" SectionEnd Section "Uninstall" SetShellVarContext all Exec '"$INSTDIR\regmon.exe" /UNREGSERVER' RMDir /r "$INSTDIR" ; remove shortcuts, if any. Delete "$DESKTOP\WHFC.lnk" Delete "$SYSDIR\whfcmon.dll" RMDir /r "$SMPROGRAMS\WHFC" DeleteRegKey HKEY_CLASSES_ROOT "CLSID\{28067B20-8Db7-11D1-A2B9-00A0246A936A}" DeleteRegKey HKEY_CLASSES_ROOT "WHFC.OleSrv" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\WHFC" DeleteRegKey HKEY_LOCAL_MACHINE "System\CurrentControlSet\Control\Print\Monitors\WHFCMon" DeleteRegKey HKEY_LOCAL_MACHINE "Software\WHFC" DeleteRegKey HKEY_CURRENT_USER "Software\WHFC" SectionEnd