From 554c0b1ab5173b9b1473afe5b03fa2633d82e7eb Mon Sep 17 00:00:00 2001 From: ZoomTen Date: Sun, 21 Apr 2019 12:10:05 +0700 Subject: [PATCH] add windows filetype association to installer --- packaging/windows/nsis/olive.nsi | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packaging/windows/nsis/olive.nsi b/packaging/windows/nsis/olive.nsi index 90e51d8d2..ba367c69b 100644 --- a/packaging/windows/nsis/olive.nsi +++ b/packaging/windows/nsis/olive.nsi @@ -54,6 +54,15 @@ Section "Create Start Menu shortcut" CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe" SectionEnd +Section "Associate *.ove files with Olive" + WriteRegStr HKCR ".ove" "" "OliveEditor.OVEFile" + WriteRegStr HKCR ".ove" "Content Type" "application/vnd.olive-project" + WriteRegStr HKCR "OliveEditor.OVEFile" "" "Olive project file" + WriteRegStr HKCR "OliveEditor.OVEFile\DefaultIcon" "" "$INSTDIR\olive-editor.exe,1" + WriteRegStr HKCR "OliveEditor.OVEFile\shell\open\command" "" "$\"$INSTDIR\olive-editor.exe$\" $\"%1$\"" + System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' +SectionEnd + UninstPage uninstConfirm UninstPage instfiles @@ -63,7 +72,12 @@ Section "uninstall" Delete "$DESKTOP\${APP_NAME}.lnk" rmdir /r "$SMPROGRAMS\${APP_NAME}" - + + DeleteRegKey HKCR ".ove" + DeleteRegKey HKCR "OliveEditor.OVEFile" + DeleteRegKey HKCR "OliveEditor.OVEFile\DefaultIcon" "" + DeleteRegKey HKCR "OliveEditor.OVEFile\shell\open\command" "" + System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)' SectionEnd Function LaunchOlive