]> git.street.me.uk Git - andy/viking.git/blobdiff - win32/installer/viking-installer.nsi
[WINDOWS] .vik file registration is automatic, .gpx is optional
[andy/viking.git] / win32 / installer / viking-installer.nsi
index 13820907c056c7531542b2f1fdf5b7bb45ce0038..80303808027827197e5fdea34edd164fbe723a32 100644 (file)
@@ -10,7 +10,7 @@ Var name
 ;--------------------------------
 ;Configuration
 ;Needs to be 4 numbers:  W.X.Y.Z
 ;--------------------------------
 ;Configuration
 ;Needs to be 4 numbers:  W.X.Y.Z
-!define VIKING_VERSION  "1.3.2.1"
+!define VIKING_VERSION  "1.5.0.0"
 
 ;The name var is set in .onInit
 Name $name
 
 ;The name var is set in .onInit
 Name $name
@@ -28,6 +28,8 @@ SetDateSave on
 !include "Sections.nsh"
 !include "WinVer.nsh"
 !include "LogicLib.nsh"
 !include "Sections.nsh"
 !include "WinVer.nsh"
 !include "LogicLib.nsh"
+;; http://nsis.sourceforge.net/File_Association
+!include "FileAssociation.nsh"
 
 !include "FileFunc.nsh"
 !insertmacro GetParameters
 
 !include "FileFunc.nsh"
 !insertmacro GetParameters
@@ -48,8 +50,6 @@ SetDateSave on
 !define HKLM_APP_PATHS_KEY                     "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\viking.exe"
 !define VIKING_UNINST_EXE                      "viking-uninst.exe"
 
 !define HKLM_APP_PATHS_KEY                     "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\viking.exe"
 !define VIKING_UNINST_EXE                      "viking-uninst.exe"
 
-!define DOWNLOADER_URL                         "http://downloads.sourceforge.net/viking/"
-
 ;--------------------------------
 ;Version resource
 VIProductVersion "${VIKING_VERSION}"
 ;--------------------------------
 ;Version resource
 VIProductVersion "${VIKING_VERSION}"
@@ -257,6 +257,8 @@ Section $(VIKING_SECTION_TITLE) SecViking
     WriteUninstaller "$INSTDIR\${VIKING_UNINST_EXE}"
     SetOverwrite off
 
     WriteUninstaller "$INSTDIR\${VIKING_UNINST_EXE}"
     SetOverwrite off
 
+    ; Always associate Viking file type
+    ${registerExtension} "$INSTDIR\viking.exe" ".vik" "Viking File"
   done:
 SectionEnd ; end of default Viking section
 
   done:
 SectionEnd ; end of default Viking section
 
@@ -281,16 +283,21 @@ SectionGroup /e $(VIKING_SHORTCUTS_SECTION_TITLE) SecShortcuts
   SectionEnd
 SectionGroupEnd
 
   SectionEnd
 SectionGroupEnd
 
+;--------------------------------
+;File association
 
 
+Section $(VIKING_FILE_ASSOCIATION_SECTION_TITLE) SecFileAssociation
+  ${registerExtension} "$INSTDIR\viking.exe" ".gpx" "GPX File"
+SectionEnd
 
 
-
-
-
-
-
-
-
-
+;--------------------------------
+; GPSBabel Install Section
+;
+Section $(VIKING_GPSBABEL_SECTION_TITLE) SecGPSBabel
+  File "bin\Optional\GPSBabel-1.5.1-Setup.exe"
+  ExecWait '"$INSTDIR\GPSBabel-1.5.1-Setup.exe" /SILENT'
+  Delete "$INSTDIR\GPSBabel-1.5.1-Setup.exe"
+SectionEnd
 
 ;--------------------------------
 ;Uninstaller Section
 
 ;--------------------------------
 ;Uninstaller Section
@@ -322,55 +329,16 @@ Section Uninstall
 
   cont_uninstall:
 
 
   cont_uninstall:
 
-    RMDir /r "$INSTDIR\etc"
-    RMDir /r "$INSTDIR\lib"
-    RMDir /r "$INSTDIR\locale"
-    RMDir /r "$INSTDIR\share"
-    Delete "$INSTDIR\AUTHORS.txt"
-    Delete "$INSTDIR\Changelog.txt"
-    Delete "$INSTDIR\COPYING_curl.txt"
-    Delete "$INSTDIR\COPYING_GPL.txt"
-    Delete "$INSTDIR\freetype6.dll"
-    Delete "$INSTDIR\gpsbabel.exe"
-    Delete "$INSTDIR\intl.dll"
-    Delete "$INSTDIR\libatk-1.0-0.dll"
-    Delete "$INSTDIR\libcairo-2.dll"
-    Delete "$INSTDIR\libcurl.dll"
-    Delete "$INSTDIR\libexif-12.dll"
-    Delete "$INSTDIR\libexpat.dll"
-    Delete "$INSTDIR\libexpat-1.dll"
-    Delete "$INSTDIR\libfontconfig-1.dll"
-    Delete "$INSTDIR\libgailutil-18.dll"
-    Delete "$INSTDIR\libgdk_pixbuf-2.0-0.dll"
-    Delete "$INSTDIR\libgdk-win32-2.0-0.dll"
-    Delete "$INSTDIR\libgio-2.0-0.dll"
-    Delete "$INSTDIR\libglib-2.0-0.dll"
-    Delete "$INSTDIR\libgmodule-2.0-0.dll"
-    Delete "$INSTDIR\libgobject-2.0-0.dll"
-    Delete "$INSTDIR\libgthread-2.0-0.dll"
-    Delete "$INSTDIR\libgtk-win32-2.0-0.dll"
-    Delete "$INSTDIR\libjpeg-7.dll"
-    Delete "$INSTDIR\libpango-1.0-0.dll"
-    Delete "$INSTDIR\libpangocairo-1.0-0.dll"
-    Delete "$INSTDIR\libpangoft2-1.0-0.dll"
-    Delete "$INSTDIR\libpangowin32-1.0-0.dll"
-    Delete "$INSTDIR\libpng12-0.dll"
-    Delete "$INSTDIR\libtiff-3.dll"
-    Delete "$INSTDIR\libtiffxx-3.dll"
-    Delete "$INSTDIR\NEWS.txt"
-    Delete "$INSTDIR\README.txt"
-    Delete "$INSTDIR\viking.exe"
-    Delete "$INSTDIR\viking.pdf"
-    Delete "$INSTDIR\zlib1.dll"
-    Delete "$INSTDIR\${VIKING_UNINST_EXE}"
-    Delete "$INSTDIR\install.log"
-
-    ;Try to remove Viking install dir (only if empty)
-    RMDir "$INSTDIR"
+    ;Simply wipe the Viking install dir
+    RMDir /r "$INSTDIR"
 
     ; Shortcuts..
     Delete "$DESKTOP\Viking.lnk"
 
 
     ; Shortcuts..
     Delete "$DESKTOP\Viking.lnk"
 
+    ; File association
+    ${unregisterExtension} ".vik" "Viking File"
+    ${unregisterExtension} ".gpx" "GPX File"
+
     Goto done
 
   cant_uninstall:
     Goto done
 
   cant_uninstall:
@@ -396,6 +364,10 @@ SectionEnd ; end of uninstall section
         $(VIKING_DESKTOP_SHORTCUT_DESC)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} \
         $(VIKING_STARTMENU_SHORTCUT_DESC)
         $(VIKING_DESKTOP_SHORTCUT_DESC)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortcut} \
         $(VIKING_STARTMENU_SHORTCUT_DESC)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssociation} \
+        $(VIKING_FILE_ASSOCIATION_DESC)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecGPSBabel} \
+        $(VIKING_INSTALL_GPSBABEL_DESC)
 
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
 
 !insertmacro MUI_FUNCTION_DESCRIPTION_END