; install.nsi ;-------------------------------- !include "MUI.nsh" ; The name of the installer - used throughout the installer Name "Your Installer Name" ; The file to write - where to put the finished installer OutFile "D:\some_path\your_executable.exe" ; The default installation directory InstallDir $PROGRAMFILES\YOUR_MAPSET_NAME ;-------------------------------- ;Interface Settings ;-------------------------------- !define MUI_ABORTWARNING ;-------------------------------- ;Pages ;-------------------------------- ; Generic welcome screen (optional) !insertmacro MUI_PAGE_WELCOME ; Custom welcome screen (optional) !define MUI_WELCOMEPAGE_TITLE "Please Note:" !define MUI_WELCOMEPAGE_TEXT "Your welcome message.\r\nNote how to add line returns.\r\n" !insertmacro MUI_PAGE_WELCOME ; Installation directory dialog !insertmacro MUI_PAGE_DIRECTORY ; Installation !insertmacro MUI_PAGE_INSTFILES ; Readme (optional) !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\your_readme_file.txt" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Languages ;-------------------------------- !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ; The stuff to install ;-------------------------------- Section "Install" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Source files for creating installation File /a "D:\some_path\*.*" ; Write the installation path into the registry WriteRegStr HKLM "SOFTWARE\YOUR_MAPSET_NAME" "Install_Dir" "$INSTDIR" WriteRegStr HKLM "SOFTWARE\YOUR_MAPSET_NAME" "Version" "1.01" ; Write the MapSource configuration into the registry WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Products\YOUR_MAPSET_NUMBER" "LOC" "$INSTDIR\" WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Products\YOUR_MAPSET_NUMBER" "BMAP" "$INSTDIR\YOUR_MAPSET_NAME.img" WriteRegStr HKLM "SOFTWARE\Garmin\MapSource\Products\YOUR_MAPSET_NUMBER" "TDB" "$INSTDIR\YOUR_MAPSET_NAME.tdb" ; Write the uninstall keys for Windows WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YOUR_MAPSET_NAME" "DisplayName" "Your mapset description" WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YOUR_MAPSET_NAME" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YOUR_MAPSET_NAME" "NoModify" 1 WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YOUR_MAPSET_NAME" "NoRepair" 1 WriteUninstaller "uninstall.exe" SectionEnd ;-------------------------------- ; Uninstaller ;-------------------------------- Section "Uninstall" ; Remove registry keys DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YOUR_MAPSET_NAME" DeleteRegKey HKLM "SOFTWARE\YOUR_MAPSET_NAME" DeleteRegKey HKLM "SOFTWARE\Garmin\MapSource\Products\YOUR_MAPSET_NUMBER" ; Remove files and uninstaller Delete $INSTDIR\*.* Delete $INSTDIR\uninstall.exe ; Remove directories used RMDir "$INSTDIR" SectionEnd