; 10 02 2003: Tom van Gemert ; Template voor het genereren van een installer. ; speciaal voor het genereren van EasyPlayer installers. ; Trimedia Interactive Projects ; ------------------------------- ; Start !define MUI_PRODUCT "EasyPoint 3" !define MUI_FILE "EasyPoint" !define MUI_VERSION "" !define MUI_BRANDINGTEXT "Installation EasyPoint 3" CRCCheck On ; Bij deze moeten we waarschijnlijk een absoluut pad gaan gebruiken ; dit moet effe uitgetest worden. !include "Nsis\Contrib\Modern UI\System.nsh" ;-------------------------------- ;General OutFile "Install EasyPoint 3.exe" ShowInstDetails "nevershow" ShowUninstDetails "nevershow" ; standaard compressie is zlib, uncomment de volgende regel voor hogere compressie echter veel langzamer ; SetCompressor "bzip2" !define MUI_ICON "data/insticon.ico" !define MUI_UNICON "data/unsticon.ico" !define MUI_SPECIALBITMAP "EPBitmap.bmp" ;-------------------------------- ;Folder selection page InstallDir "$PROGRAMFILES\${MUI_FILE}" ;-------------------------------- ;Modern UI Configuration !define MUI_WELCOMEPAGE !define MUI_LICENSEPAGE !define MUI_DIRECTORYPAGE !define MUI_ABORTWARNING !define MUI_UNINSTALLER !define MUI_UNCONFIRMPAGE !define MUI_FINISHPAGE ;-------------------------------- ;Language !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Modern UI System !insertmacro MUI_SYSTEM ;-------------------------------- ;Data LicenseData "Lees_mij.txt" ;-------------------------------- ;Installer Sections Section "install" Installation info ;Add files SetOutPath "$INSTDIR" File "easypoint.exe" File "easypoint.ini" File "easyplayer.exe" File "easyplayer.ini" File "Lees_mij.txt" File "Installer.txt" File "bitmap.bmp" File "easypoint.bmp" SetOutPath "$INSTDIR" file /r Audio SetOutPath "$INSTDIR" file /r Data SetOutPath "$INSTDIR" file /r EPTemp SetOutPath "$INSTDIR" file /r Graphics SetOutPath "$INSTDIR" file /r Installer SetOutPath "$INSTDIR" file /r Mpg SetOutPath "$INSTDIR" file /r Nsis SetOutPath "$INSTDIR" file /r Pdf SetOutPath "$INSTDIR" file /r playlists SetOutPath "$INSTDIR" file /r xtras ;create desktop shortcut CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" ;create start-menu items CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}" CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0 ;write uninstall information to the registry WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe" ;associate EPP extension with EasyPoint.exe (in registry) WriteRegStr HKEY_CLASSES_ROOT ".epp" "" "EasyPoint Presentation File" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Presentation File\Shell\Open\Command" "" "$INSTDIR\EasyPoint.exe %1" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Presentation File\DefaultIcon" "" "$INSTDIR\Data\epp.ico" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Presentation File\ProgramPath" "" "$INSTDIR" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Presentation File" "" "EasyPoint is software developped by Trimedia Interactive Projects www.trimedia.nl" WriteINIStr "win.ini" "Extensions" ".epp" '"$INSTDIR\EasyPoint.exe ^.epp"' ;connect EPD extension (EasyPoint database) with EPD.ico WriteRegStr HKEY_CLASSES_ROOT ".epd" "" "EasyPoint Database" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Database\DefaultIcon" "" "$INSTDIR\Data\epd.ico" WriteRegStr HKEY_CLASSES_ROOT "EasyPoint Database" "" "EasyPoint is software developped by Trimedia Interactive Projects www.trimedia.nl" WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;Delete Files RMDir /r "$INSTDIR\*.*" ;Remove the installation directory RMDir "$INSTDIR" ;Delete Start Menu Shortcuts Delete "$DESKTOP\${MUI_PRODUCT}.lnk" Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*" RmDir "$SMPROGRAMS\${MUI_PRODUCT}" ;Delete Uninstaller And Unistall Registry Entries DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" ;Delete EPP extension association with EasyPoint.exe (in registry) DeleteRegKey HKEY_CLASSES_ROOT ".epp" DeleteRegKey HKEY_CLASSES_ROOT "EasyPoint Presentation File" DeleteINIstr "win.ini" "Extensions" ".epp" ;Delete EPD extension entries from registry DeleteRegKey HKEY_CLASSES_ROOT ".epd" DeleteRegKey HKEY_CLASSES_ROOT "EasyPoint Database" !insertmacro MUI_UNFINISHHEADER SectionEnd ;-------------------------------- ;MessageBox Section ;Function that calls a messagebox when installation finished correctly Function .onInstSuccess MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}. Use the desktop icon to start the program." FunctionEnd Function un.onUninstSuccess MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}." FunctionEnd ;eof