Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file association for .qgs/.qgz on Windows #5621

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cmake/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,25 @@ Section "-Core installation"

!insertmacro MUI_STARTMENU_WRITE_END

WriteRegStr HKCR '.qgs' '' 'QField'
WriteRegStr HKCR '.qgz' '' 'QField'
WriteRegStr HKCR '.qgs\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.qgz\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.kml\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.kmz\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.gpkg\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.geojson\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.mbtiles\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.tif\OpenWithProgids' 'QField' ''
WriteRegStr HKCR '.tiff\OpenWithProgids' 'QField' ''
WriteRegStr HKCR 'QField' '' 'QField'
WriteRegStr HKCR 'QField\shell' '' 'open'
WriteRegStr HKCR 'QField\DefaultIcon' '' '$INSTDIR\usr\bin\qfield.exe,0'
WriteRegStr HKCR 'QField\shell\open\command' '' '"$INSTDIR\usr\bin\qfield.exe" "%1"'
WriteRegStr HKCR 'QField\shell\edit' '' 'Edit'
WriteRegStr HKCR 'QField\shell\edit\command' '' '"$INSTDIR\usr\bin\qfield.exe" "%1"'
System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'

@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@

SectionEnd
Expand Down Expand Up @@ -849,6 +868,8 @@ Section "Uninstall"
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "InstallToDesktop"
;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP "

DeleteRegKey HKCR 'QField'

@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@

;Remove files we installed.
Expand Down
1 change: 1 addition & 0 deletions cmake/Package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if(WIN32)
message(STATUS " + NSIS YES ")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "usr\\\\bin")
set(CPACK_NSIS_DISPLAY_NAME "QField")

list(APPEND CPACK_GENERATOR "NSIS")
endif()

Expand Down
Loading