Skip to content

Commit

Permalink
geo URI Windows desktop integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Jan 21, 2025
1 parent 3dd21ad commit e27bc43
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/windows/gpxsee64.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
DeleteRegKey HKCR ".${EXT}"
!macroend

; URI association
!macro URI_ASSOCIATION_ADD PROTO DESC
WriteRegStr HKCR "${PROTO}" "" "${DESC}"
WriteRegStr HKCR "${PROTO}" "URL Protocol" ""
WriteRegStr HKCR "${PROTO}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,0"
WriteRegStr HKCR "${PROTO}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend

!macro URI_ASSOCIATION_REMOVE PROTO
DeleteRegKey HKCR "${PROTO}"
!macroend

; Translations
!macro LOCALIZATION LANG CODE
Section "${LANG}"
Expand Down Expand Up @@ -200,6 +212,8 @@ Section "GPXSee" SEC_APP
!insertmacro FILE_ASSOCIATION_ADD "plt" "OziExplorer Track File" 33
!insertmacro FILE_ASSOCIATION_ADD "rte" "OziExplorer Route File" 34

!insertmacro URI_ASSOCIATION_ADD "geo" "geo URI"

WriteRegStr HKCR "Applications\GPXSee.exe\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
WriteRegStr HKCR ".gpx\OpenWithList" "GPXSee.exe" ""
WriteRegStr HKCR ".tcx\OpenWithList" "GPXSee.exe" ""
Expand Down Expand Up @@ -426,6 +440,8 @@ Section "Uninstall"
!insertmacro FILE_ASSOCIATION_REMOVE "000"
!insertmacro FILE_ASSOCIATION_REMOVE "031"

!insertmacro URI_ASSOCIATION_REMOVE "geo"

DeleteRegValue HKCR ".gpx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".tcx\OpenWithList" "GPXSee.exe"
DeleteRegValue HKCR ".kml\OpenWithList" "GPXSee.exe"
Expand Down

0 comments on commit e27bc43

Please sign in to comment.