;;------------------------------------------------------------ ;; Squeakland installer ;; based on Start Menu Folder Selection Example Script ;; ;; $Id: squeakland06.nsi 1691 2007-01-10 10:22:07Z propella $ ;;------------------------------------------------------------ ;-------------------------------- ;General !define Product "Squeak" !define ImageName "SqueakPlugin" ;Name and file Name "Squeak Plugin" OutFile "SqueakPluginInstaller.exe" ;Default installation folder InstallDir "$PROGRAMFILES\Squeak\Plugin" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\${Product}" "" ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;-------------------------------- ;Variables for start menu Var MUI_TEMP Var STARTMENU_FOLDER ;-------------------------------- ;Interface Settings ; !define MUI_ABORTWARNING !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "header.bmp" ;-------------------------------- ;Pages !insertmacro MUI_PAGE_LICENSE "License" ; !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${Product}" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "PortugueseBR" ;-------------------------------- ;Netscape Plugin !macro SQUEAK_NS_PLUGIN_INSTALL nsAppName StrCpy $0 "" ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\${nsAppName}" "Path" StrCmp $0 "" "InstallNetscapeNotFound${nsAppName}" 0 CopyFiles "$INSTDIR\NPSqueak.dll" "$0\plugins" DetailPrint "Copy plugin: $INSTDIR\NPSqueak.dll" "InstallNetscapeNotFound${nsAppName}:" !macroend !macro SQUEAK_NS_PLUGIN_UNINSTALL nsAppName StrCpy $0 "" ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\${nsAppName}" "Path" StrCmp $0 "" "UninstallNetscapeNotFound${nsAppName}" 0 Delete "$0\plugins\NPSqueak.dll" DetailPrint "Delete plugin: $INSTDIR\NPSqueak.dll" "UninstallNetscapeNotFound${nsAppName}:" !macroend ;-------------------------------- ;Installer Sections Section "Standard" SecStandard SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File "Squeak.exe" File "${ImageName}.image" FIle "Mpeg3Plugin.dll" File "ImmWin32Plugin.dll" File "KedamaPlugin.dll" File "NPSqueak.dll" File "SqueakOCX.dll" File "localePlugin.dll" File "README.txt" ; File /r "prefs" File "License" ;Store installation folder WriteRegStr HKCU "Software\${Product}" "" $INSTDIR WriteRegStr HKCU "Software\${Product}" "InstallDirectory" $INSTDIR WriteRegStr HKLM "Software\${Product}" "InstallDirectory" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" ;Desktop Icon Configuration CreateShortCut "$DESKTOP\${Product}.lnk" "$INSTDIR\squeak.exe" "${ImageName}.image" ;Start Menu Configuration !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\${Product}.lnk" "$INSTDIR\Squeak.exe" "${ImageName}.image" !insertmacro MUI_STARTMENU_WRITE_END ; File Extension WriteRegStr HKCR ".image" "" "Squeak.Image" WriteRegStr HKCR "Squeak.Image" "" "Squeak Image" WriteRegStr HKCR "Squeak.Image\shell" "" "open" WriteRegStr HKCR "Squeak.Image\DefaultIcon" "" "$INSTDIR\Squeak.exe,0" WriteRegStr HKCR "Squeak.Image\shell\open\command" "" '$INSTDIR\Squeak.exe "%1"' WriteRegStr HKCR ".pr" "" "Squeak.Project" WriteRegStr HKCR ".pr" "Content Type" "application/x-squeak-project" WriteRegStr HKCR "Squeak.Project" "" "Squeak Project" WriteRegStr HKCR "Squeak.Project\shell" "" "open" WriteRegStr HKCR "Squeak.Project\DefaultIcon" "" "$INSTDIR\Squeak.exe,0" WriteRegStr HKCR "Squeak.Project\shell\open\command" "" '"$INSTDIR\Squeak.exe" "$INSTDIR\${ImageName}.image" "%1"' !insertmacro SQUEAK_NS_PLUGIN_INSTALL "netscp.exe" !insertmacro SQUEAK_NS_PLUGIN_INSTALL "netscape.exe" !insertmacro SQUEAK_NS_PLUGIN_INSTALL "Mozilla.exe" !insertmacro SQUEAK_NS_PLUGIN_INSTALL "firefox.exe" !insertmacro SQUEAK_NS_PLUGIN_INSTALL "Opera.exe" ;IE Plugin RegDLL "$INSTDIR\SqueakOCX.dll" SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_SecStandard ${LANG_ENGLISH} "A standard set." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecStandard} $(DESC_SecStandard) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\Squeak.exe" Delete "$INSTDIR\${ImageName}.image" Delete "$INSTDIR\Mpeg3Plugin.dll" Delete "$INSTDIR\ImmWin32Plugin.dll" Delete "$INSTDIR\KedamaPlugin.dll" Delete "$INSTDIR\NPSqueak.dll" Delete "$INSTDIR\SqueakOCX.dll" Delete "$INSTDIR\localePlugin.dll" Delete "README.txt" ; RMDir /r "$INSTDIR\prefs" Delete "$INSTDIR\License" ;Desktop Configuration Delete "$DESKTOP\${Product}.lnk" DeleteRegKey /ifempty HKCU "Software\${Product}" DeleteRegValue HKLM "Software\${Product}" "InstallDirectory" ; File Extension DeleteRegKey HKCR ".image" DeleteRegKey HKCR "Squeak.Image" DeleteRegKey HKCR ".pr" DeleteRegKey HKCR "Squeak.Project" !insertmacro SQUEAK_NS_PLUGIN_UNINSTALL "netscp.exe" !insertmacro SQUEAK_NS_PLUGIN_UNINSTALL "netscape.exe" !insertmacro SQUEAK_NS_PLUGIN_UNINSTALL "Mozilla.exe" !insertmacro SQUEAK_NS_PLUGIN_UNINSTALL "firefox.exe" !insertmacro SQUEAK_NS_PLUGIN_UNINSTALL "Opera.exe" ;IE Plugin UnRegDLL "$INSTDIR\SqueakOCX.dll" ; TODO: Insert error check! ; IfErrors 0 +2 ; Abort "Some file(s) were not removed." ;Start Menu Configuration !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP RMDir /r "$SMPROGRAMS\$MUI_TEMP" Delete "$INSTDIR\Uninstall.exe" RMDir "$INSTDIR" SectionEnd