From e6e39fbe98611c85910b6819c5f294fc4c85ec7f Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Wed, 20 Jan 2021 16:17:49 +0530 Subject: [PATCH] Add nsis script to add/remove context menu entry --- build/win/installer.nsh | 19 +++++++++++++++++++ electron-builder.json | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 build/win/installer.nsh diff --git a/build/win/installer.nsh b/build/win/installer.nsh new file mode 100644 index 00000000..381790b6 --- /dev/null +++ b/build/win/installer.nsh @@ -0,0 +1,19 @@ +!macro customInstall + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper\command" "" `$appExe "%V"` + + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper\command" "" `$appExe "%V"` + + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper\command" "" `$appExe "%V"` +!macroend + +!macro customUnInstall + DeleteRegKey HKCU "Software\Classes\Directory\Background\shell\Hyper" + DeleteRegKey HKCU "Software\Classes\Directory\shell\Hyper" + DeleteRegKey HKCU "Software\Classes\Drive\shell\Hyper" +!macroend diff --git a/electron-builder.json b/electron-builder.json index 4511bab4..6d40d983 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -50,6 +50,9 @@ ], "rfc3161TimeStampServer": "http://timestamp.comodoca.com" }, + "nsis": { + "include": "build/win/installer.nsh" + }, "mac": { "target": { "target": "default",