]> git.street.me.uk Git - andy/viking.git/blobdiff - win32/installer/viking-installer.nsi
[WINDOWS] Enable optional install of GPSBabel 1.5.1
[andy/viking.git] / win32 / installer / viking-installer.nsi
index b75566fc590f56dec8d82d1ba95107ff0cf4578b..9e01fce1975c8b881bf0ce2ab6676e2216ecac65 100644 (file)
@@ -9,6 +9,8 @@ Var name
 
 ;--------------------------------
 ;Configuration
 
 ;--------------------------------
 ;Configuration
+;Needs to be 4 numbers:  W.X.Y.Z
+!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
@@ -26,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
@@ -46,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}"
@@ -111,6 +113,7 @@ VIAddVersionKey "FileDescription" "Viking Installer"
 
   !insertmacro MUI_LANGUAGE "English"
   !insertmacro MUI_LANGUAGE "French"
 
   !insertmacro MUI_LANGUAGE "English"
   !insertmacro MUI_LANGUAGE "French"
+  !insertmacro MUI_LANGUAGE "Spanish"
 
 ;--------------------------------
 ;Translations
 
 ;--------------------------------
 ;Translations
@@ -278,16 +281,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" ".vik" "Viking 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
@@ -319,54 +327,15 @@ 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\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"
+
     Goto done
 
   cant_uninstall:
     Goto done
 
   cant_uninstall:
@@ -392,6 +361,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