From c8a8939fd728a859433fb8c4d3411158de4bba9b Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Fri, 14 Aug 2015 14:16:25 +0000 Subject: [PATCH] Nsis Installers : write file associations registry keys to titleblocks git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4113 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- packaging/windows/QET.nsi | 11 +++++++++-- packaging/windows/QET64.nsi | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packaging/windows/QET.nsi b/packaging/windows/QET.nsi index ba4d2b69a..535b4b039 100644 --- a/packaging/windows/QET.nsi +++ b/packaging/windows/QET.nsi @@ -13,8 +13,7 @@ !include FileFunc.nsh !insertmacro GetParameters !insertmacro GetOptions - - + ; MUI Settings ;-------------------------------- @@ -206,6 +205,12 @@ Section "" WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "BrowserFlags" 0x00000008 WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\DefaultIcon" "" "$final_element_ico" WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\"" + WriteRegStr HKEY_CLASSES_ROOT ".titleblock" "" "qet_titleblock_file" + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file" "" "Titleblock QET" + WriteRegDWORD HKEY_CLASSES_ROOT "qet_titleblock_file" "EditFlags" 0x00000000 + WriteRegDWORD HKEY_CLASSES_ROOT "qet_titleblock_file" "BrowserFlags" 0x00000008 + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file\DefaultIcon" "" "$final_titleblock_ico" + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\"" SetShellVarContext all ; all users ; shortcuts in the start menu @@ -301,6 +306,8 @@ Section "Uninstall" DeleteRegKey HKEY_CLASSES_ROOT "qet_diagram_file" DeleteRegKey HKEY_CLASSES_ROOT ".elmt" DeleteRegKey HKEY_CLASSES_ROOT "qet_element_file" + DeleteRegKey HKEY_CLASSES_ROOT ".titleblock" + DeleteRegKey HKEY_CLASSES_ROOT "qet_titleblock_file" IfFileExists "$INSTDIR" 0 NoErrorMsg ;MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist diff --git a/packaging/windows/QET64.nsi b/packaging/windows/QET64.nsi index 11aedad68..75223b22d 100644 --- a/packaging/windows/QET64.nsi +++ b/packaging/windows/QET64.nsi @@ -216,6 +216,12 @@ Section "" WriteRegDWORD HKEY_CLASSES_ROOT "qet_element_file" "BrowserFlags" 0x00000008 WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\DefaultIcon" "" "$final_element_ico" WriteRegStr HKEY_CLASSES_ROOT "qet_element_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\"" + WriteRegStr HKEY_CLASSES_ROOT ".titleblock" "" "qet_titleblock_file" + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file" "" "Titleblock QET" + WriteRegDWORD HKEY_CLASSES_ROOT "qet_titleblock_file" "EditFlags" 0x00000000 + WriteRegDWORD HKEY_CLASSES_ROOT "qet_titleblock_file" "BrowserFlags" 0x00000008 + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file\DefaultIcon" "" "$final_titleblock_ico" + WriteRegStr HKEY_CLASSES_ROOT "qet_titleblock_file\shell\open\command" "" "$\"$final_qet_exe$\" $\"%1$\"" SetShellVarContext all ; all users ; shortcuts in the start menu @@ -319,6 +325,8 @@ Section "Uninstall" DeleteRegKey HKEY_CLASSES_ROOT "qet_diagram_file" DeleteRegKey HKEY_CLASSES_ROOT ".elmt" DeleteRegKey HKEY_CLASSES_ROOT "qet_element_file" + DeleteRegKey HKEY_CLASSES_ROOT ".titleblock" + DeleteRegKey HKEY_CLASSES_ROOT "qet_titleblock_file" IfFileExists "$INSTDIR" 0 NoErrorMsg ;MessageBox MB_OK "Note: $INSTDIR could not be removed!" IDOK 0 ; skipped if file doesn't exist