1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Added SLF files association

This commit is contained in:
Martin Tůma 2018-08-12 13:30:20 +02:00
parent f49e0223b2
commit c3deab5369
6 changed files with 120 additions and 148 deletions

View File

@ -278,7 +278,8 @@ macx {
icons/plt.icns \
icons/rte.icns \
icons/wpt.icns \
icons/loc.icns
icons/loc.icns \
icons/slf.icns
QMAKE_BUNDLE_DATA += LOCALE MAPS ICONS CSV
}
win32 {
@ -292,7 +293,8 @@ win32 {
icons/plt.ico \
icons/rte.ico \
icons/wpt.ico \
icons/loc.ico
icons/loc.ico \
icons/slf.ico
DEFINES += _USE_MATH_DEFINES
}

View File

@ -83,6 +83,22 @@
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>slf</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/slf+xml</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>icons/slf.icns</string>
<key>CFBundleTypeName</key>
<string>Sigma Log Format</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
@ -267,6 +283,27 @@
<string>application/loc+xml</string>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>com.sigmasport.slf</string>
<key>UTTypeReferenceURL</key>
<string>https://www.sigmasport.com</string>
<key>UTTypeDescription</key>
<string>Sigma Log Format</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>slf</string>
</array>
<key>public.mime-type</key>
<string>application/slf+xml</string>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>com.thisisant.fit</string>

View File

@ -11,4 +11,4 @@ Icon=gpxsee
Terminal=false
Type=Application
Categories=Graphics;Viewer;Maps;Qt;
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/loc+xml;
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/loc+xml;application/slf+xml;

View File

@ -2,6 +2,19 @@
!include "x64.nsh"
!include "WinVer.nsh"
; Macros
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
; The name of the installer
Name "GPXSee"
; Program version
@ -32,17 +45,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
; Registry key for uninstaller
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
; File types registry entries
!define REGGPX "GPXSee.gpx"
!define REGTCX "GPXSee.tcx"
!define REGKML "GPXSee.kml"
!define REGFIT "GPXSee.fit"
!define REGIGC "GPXSee.igc"
!define REGNMEA "GPXSee.nmea"
!define REGPLT "GPXSee.plt"
!define REGRTE "GPXSee.rte"
!define REGWPT "GPXSee.wpt"
!define REGLOC "GPXSee.loc"
; Start menu page configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
@ -115,47 +117,17 @@ Section "GPXSee" SEC_APP
; Associate file formats
DetailPrint "Associating file types..."
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".kml" "" "${REGKML}"
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".fit" "" "${REGFIT}"
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".igc" "" "${REGIGC}"
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".plt" "" "${REGPLT}"
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".rte" "" "${REGRTE}"
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,10"
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".loc" "" "${REGLOC}"
WriteRegStr HKCR "${REGLOC}" "" "Geocaching.com Waypoint File"
WriteRegStr HKCR "${REGLOC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
WriteRegStr HKCR "${REGLOC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
!insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
!insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
!insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd
@ -272,26 +244,17 @@ Section "Uninstall"
RMDir "$SMPROGRAMS\$StartMenuFolder"
; Remove GPX file association
DeleteRegKey HKCR "${REGGPX}"
DeleteRegKey HKCR ".gpx"
DeleteRegKey HKCR "${REGTCX}"
DeleteRegKey HKCR ".tcx"
DeleteRegKey HKCR "${REGKML}"
DeleteRegKey HKCR ".kml"
DeleteRegKey HKCR "${REGFIT}"
DeleteRegKey HKCR ".fit"
DeleteRegKey HKCR "${REGIGC}"
DeleteRegKey HKCR ".igc"
DeleteRegKey HKCR "${REGNMEA}"
DeleteRegKey HKCR ".nmea"
DeleteRegKey HKCR "${REGPLT}"
DeleteRegKey HKCR ".plt"
DeleteRegKey HKCR "${REGRTE}"
DeleteRegKey HKCR ".rte"
DeleteRegKey HKCR "${REGWPT}"
DeleteRegKey HKCR ".wpt"
DeleteRegKey HKCR "${REGLOC}"
DeleteRegKey HKCR ".loc"
!insertmacro FILE_ASSOCIATION_REMOVE "gpx"
!insertmacro FILE_ASSOCIATION_REMOVE "tcx"
!insertmacro FILE_ASSOCIATION_REMOVE "kml"
!insertmacro FILE_ASSOCIATION_REMOVE "fit"
!insertmacro FILE_ASSOCIATION_REMOVE "igc"
!insertmacro FILE_ASSOCIATION_REMOVE "nmea"
!insertmacro FILE_ASSOCIATION_REMOVE "plt"
!insertmacro FILE_ASSOCIATION_REMOVE "rte"
!insertmacro FILE_ASSOCIATION_REMOVE "wpt"
!insertmacro FILE_ASSOCIATION_REMOVE "loc"
!insertmacro FILE_ASSOCIATION_REMOVE "slf"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd
@ -322,4 +285,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -29,6 +29,13 @@
<glob pattern="*.loc"/>
</mime-type>
<mime-type type="application/slf+xml">
<comment>Sigma Log Format</comment>
<sub-class-of type="application/xml"/>
<generic-icon name="application-xml"/>
<glob pattern="*.slf"/>
</mime-type>
<mime-type type="application/vnd.ant.fit">
<comment>Flexible and Interoperable Data Transfer</comment>
<sub-class-of type="application/octet-stream"/>

View File

@ -2,6 +2,19 @@
!include "x64.nsh"
!include "WinVer.nsh"
; Macros
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
; The name of the installer
Name "GPXSee"
; Program version
@ -32,17 +45,6 @@ InstallDirRegKey HKLM "Software\GPXSee" "Install_Dir"
; Registry key for uninstaller
!define REGENTRY "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPXSee"
; File types registry entries
!define REGGPX "GPXSee.gpx"
!define REGTCX "GPXSee.tcx"
!define REGKML "GPXSee.kml"
!define REGFIT "GPXSee.fit"
!define REGIGC "GPXSee.igc"
!define REGNMEA "GPXSee.nmea"
!define REGPLT "GPXSee.plt"
!define REGRTE "GPXSee.rte"
!define REGWPT "GPXSee.wpt"
!define REGLOC "GPXSee.loc"
; Start menu page configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
@ -122,47 +124,17 @@ Section "GPXSee" SEC_APP
; Associate file formats
DetailPrint "Associating file types..."
WriteRegStr HKCR ".gpx" "" "${REGGPX}"
WriteRegStr HKCR "${REGGPX}" "" "GPS Exchange Format"
WriteRegStr HKCR "${REGGPX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,3"
WriteRegStr HKCR "${REGGPX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".tcx" "" "${REGTCX}"
WriteRegStr HKCR "${REGTCX}" "" "Training Center XML"
WriteRegStr HKCR "${REGTCX}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,4"
WriteRegStr HKCR "${REGTCX}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".kml" "" "${REGKML}"
WriteRegStr HKCR "${REGKML}" "" "Keyhole Markup Language"
WriteRegStr HKCR "${REGKML}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,5"
WriteRegStr HKCR "${REGKML}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".fit" "" "${REGFIT}"
WriteRegStr HKCR "${REGFIT}" "" "Flexible and Interoperable Data Transfer"
WriteRegStr HKCR "${REGFIT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,6"
WriteRegStr HKCR "${REGFIT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".igc" "" "${REGIGC}"
WriteRegStr HKCR "${REGIGC}" "" "Flight Recorder Data Format"
WriteRegStr HKCR "${REGIGC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,7"
WriteRegStr HKCR "${REGIGC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".nmea" "" "${REGNMEA}"
WriteRegStr HKCR "${REGNMEA}" "" "NMEA 0183 data"
WriteRegStr HKCR "${REGNMEA}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,8"
WriteRegStr HKCR "${REGNMEA}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".plt" "" "${REGPLT}"
WriteRegStr HKCR "${REGPLT}" "" "OziExplorer Track Point File"
WriteRegStr HKCR "${REGPLT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,9"
WriteRegStr HKCR "${REGPLT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".rte" "" "${REGRTE}"
WriteRegStr HKCR "${REGRTE}" "" "OziExplorer Route File"
WriteRegStr HKCR "${REGRTE}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,10"
WriteRegStr HKCR "${REGRTE}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".wpt" "" "${REGWPT}"
WriteRegStr HKCR "${REGWPT}" "" "OziExplorer Waypoint File"
WriteRegStr HKCR "${REGWPT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,1"
WriteRegStr HKCR "${REGWPT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".loc" "" "${REGLOC}"
WriteRegStr HKCR "${REGLOC}" "" "Geocaching.com Waypoint File"
WriteRegStr HKCR "${REGLOC}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,2"
WriteRegStr HKCR "${REGLOC}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!insertmacro FILE_ASSOCIATION_ADD "gpx" "GPS Exchange Format" 4
!insertmacro FILE_ASSOCIATION_ADD "tcx" "Training Center XML" 5
!insertmacro FILE_ASSOCIATION_ADD "kml" "Keyhole Markup Language" 6
!insertmacro FILE_ASSOCIATION_ADD "fit" "Flexible and Interoperable Data Transfer" 7
!insertmacro FILE_ASSOCIATION_ADD "igc" "Flight Recorder Data Format" 8
!insertmacro FILE_ASSOCIATION_ADD "nmea" "NMEA 0183 data" 9
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track Point File" 10
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 11
!insertmacro FILE_ASSOCIATION_ADD "wpt" "OziExplorer Waypoint File" 1
!insertmacro FILE_ASSOCIATION_ADD "loc" "Geocaching.com Waypoint File" 2
!insertmacro FILE_ASSOCIATION_ADD "slf" "Sigma Log File" 3
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd
@ -275,26 +247,17 @@ Section "Uninstall"
RMDir "$SMPROGRAMS\$StartMenuFolder"
; Remove File associations
DeleteRegKey HKCR "${REGGPX}"
DeleteRegKey HKCR ".gpx"
DeleteRegKey HKCR "${REGTCX}"
DeleteRegKey HKCR ".tcx"
DeleteRegKey HKCR "${REGKML}"
DeleteRegKey HKCR ".kml"
DeleteRegKey HKCR "${REGFIT}"
DeleteRegKey HKCR ".fit"
DeleteRegKey HKCR "${REGIGC}"
DeleteRegKey HKCR ".igc"
DeleteRegKey HKCR "${REGNMEA}"
DeleteRegKey HKCR ".nmea"
DeleteRegKey HKCR "${REGPLT}"
DeleteRegKey HKCR ".plt"
DeleteRegKey HKCR "${REGRTE}"
DeleteRegKey HKCR ".rte"
DeleteRegKey HKCR "${REGWPT}"
DeleteRegKey HKCR ".wpt"
DeleteRegKey HKCR "${REGLOC}"
DeleteRegKey HKCR ".loc"
!insertmacro FILE_ASSOCIATION_REMOVE "gpx"
!insertmacro FILE_ASSOCIATION_REMOVE "tcx"
!insertmacro FILE_ASSOCIATION_REMOVE "kml"
!insertmacro FILE_ASSOCIATION_REMOVE "fit"
!insertmacro FILE_ASSOCIATION_REMOVE "igc"
!insertmacro FILE_ASSOCIATION_REMOVE "nmea"
!insertmacro FILE_ASSOCIATION_REMOVE "plt"
!insertmacro FILE_ASSOCIATION_REMOVE "rte"
!insertmacro FILE_ASSOCIATION_REMOVE "wpt"
!insertmacro FILE_ASSOCIATION_REMOVE "loc"
!insertmacro FILE_ASSOCIATION_REMOVE "slf"
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
SectionEnd