mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-10-04 02:56:31 +08:00
Use of APP_ASSOCIATE in url_scheme
CURA-11288
This commit is contained in:
parent
581d1bf3b9
commit
ddfd7d6a06
@ -144,6 +144,49 @@ SectionEnd
|
|||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
Section UrlProtocol
|
||||||
|
|
||||||
|
!macro APP_ASSOCIATE extension progid description commandname command
|
||||||
|
WriteRegStr HKCR "${extension}" "" "${description}"
|
||||||
|
WriteRegStr HKCR "${extension}" "URL Protocol" ""
|
||||||
|
WriteRegStr HKCR "${extension}\DefaultIcon" "" "${commandname},1"
|
||||||
|
WriteRegStr HKCR "${extension}\shell" "" "open"
|
||||||
|
WriteRegStr HKCR "${extension}\shell\open\command" "" '"${command}" "%1"'
|
||||||
|
!insertmacro APP_ASSOCIATE_SHORTCUT "${extension}" "${progid}" "${description}" "${command}"
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
WriteRegStr HKCR "cura" "" "URL:cura"
|
||||||
|
WriteRegStr HKCR "cura" "URL Protocol" ""
|
||||||
|
WriteRegStr HKCR "cura\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE},1"
|
||||||
|
WriteRegStr HKCR "cura\shell" "" "open"
|
||||||
|
WriteRegStr HKCR "cura\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" "%1"'
|
||||||
|
|
||||||
|
WriteRegStr HKCR "slicer" "" "URL:slicer"
|
||||||
|
WriteRegStr HKCR "slicer" "URL Protocol" ""
|
||||||
|
WriteRegStr HKCR "slicer\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE},1"
|
||||||
|
WriteRegStr HKCR "slicer\shell" "" "open"
|
||||||
|
WriteRegStr HKCR "slicer\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" "%1"'
|
||||||
|
|
||||||
|
; Set the uninstall section flag for this section
|
||||||
|
SetSectionFlags ${SECTION_UNINSTALL}
|
||||||
|
|
||||||
|
; Define file associations for 'cura' protocol
|
||||||
|
StrCpy $0 "cura"
|
||||||
|
StrCpy $1 "URL:cura"
|
||||||
|
StrCpy $2 "CURA Protocol"
|
||||||
|
StrCpy $3 "$INSTDIR\${MAIN_APP_EXE},1"
|
||||||
|
Call APP_ASSOCIATE
|
||||||
|
|
||||||
|
; Define file associations for 'slicer' protocol
|
||||||
|
StrCpy $0 "slicer"
|
||||||
|
StrCpy $1 "URL:slicer"
|
||||||
|
StrCpy $2 "SLICER Protocol"
|
||||||
|
StrCpy $3 "$INSTDIR\${MAIN_APP_EXE},1"
|
||||||
|
Call APP_ASSOCIATE
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
######################################################################
|
||||||
|
|
||||||
Section Uninstall
|
Section Uninstall
|
||||||
${INSTALL_TYPE}{% for files in mapped_out_paths.values() %}{% for file in files %}
|
${INSTALL_TYPE}{% for files in mapped_out_paths.values() %}{% for file in files %}
|
||||||
Delete "{{ file[1] }}"{% endfor %}{% endfor %}{% for rem_dir in rmdir_paths %}
|
Delete "{{ file[1] }}"{% endfor %}{% endfor %}{% for rem_dir in rmdir_paths %}
|
||||||
@ -187,23 +230,15 @@ RmDir "$SMPROGRAMS\{{ app_name }}"
|
|||||||
!insertmacro APP_UNASSOCIATE "stl" "Cura.model"
|
!insertmacro APP_UNASSOCIATE "stl" "Cura.model"
|
||||||
!insertmacro APP_UNASSOCIATE "3mf" "Cura.project"
|
!insertmacro APP_UNASSOCIATE "3mf" "Cura.project"
|
||||||
|
|
||||||
|
; Unassociate file associations for 'cura' protocol
|
||||||
|
StrCpy $0 "cura"
|
||||||
|
Call APP_UNASSOCIATE
|
||||||
|
|
||||||
|
; Unassociate file associations for 'slicer' protocol
|
||||||
|
StrCpy $0 "slicer"
|
||||||
|
Call APP_UNASSOCIATE
|
||||||
|
|
||||||
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
|
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
|
||||||
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
|
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
######################################################################
|
|
||||||
|
|
||||||
Section UrlProtocol
|
|
||||||
WriteRegStr HKCR "cura" "" "URL:cura"
|
|
||||||
WriteRegStr HKCR "cura" "URL Protocol" ""
|
|
||||||
WriteRegStr HKCR "cura\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE},1"
|
|
||||||
WriteRegStr HKCR "cura\shell" "" "open"
|
|
||||||
WriteRegStr HKCR "cura\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" "%1"'
|
|
||||||
|
|
||||||
WriteRegStr HKCR "slicer" "" "URL:slicer"
|
|
||||||
WriteRegStr HKCR "slicer" "URL Protocol" ""
|
|
||||||
WriteRegStr HKCR "slicer\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE},1"
|
|
||||||
WriteRegStr HKCR "slicer\shell" "" "open"
|
|
||||||
WriteRegStr HKCR "slicer\shell\open\command" "" '"$INSTDIR\${MAIN_APP_EXE}" "%1"'
|
|
||||||
|
|
||||||
SectionEnd
|
|
Loading…
x
Reference in New Issue
Block a user