diff --git a/electron/icons/icon.ico b/electron/icons/icon.ico new file mode 100644 index 000000000..40c76171d Binary files /dev/null and b/electron/icons/icon.ico differ diff --git a/electron/package.json b/electron/package.json index e76b9172a..7f1c978e4 100644 --- a/electron/package.json +++ b/electron/package.json @@ -54,6 +54,13 @@ "nsis" ] }, + "nsis": { + "oneClick": true, + "installerIcon": "icons/icon.ico", + "uninstallerIcon": "icons/icon.ico", + "include": "scripts/uninstaller.nsh", + "deleteAppDataOnUninstall": true + }, "artifactName": "jan-${os}-${arch}-${version}.${ext}" }, "scripts": { diff --git a/electron/scripts/uninstaller.nsh b/electron/scripts/uninstaller.nsh new file mode 100644 index 000000000..ad6d91591 --- /dev/null +++ b/electron/scripts/uninstaller.nsh @@ -0,0 +1,18 @@ +!include nsDialogs.nsh + +XPStyle on + +!macro customUnInstall +; Uninstall process execution + ${ifNot} ${isUpdated} + # If you tick Delete fixed folder + MessageBox MB_OKCANCEL "Do you also want to delete the DEFAULT Jan data folder at $PROFILE\jan?" IDOK label_ok IDCANCEL label_cancel + label_ok: + # Delete user data folder + RMDir /r $PROFILE\jan + Goto end + label_cancel: + Goto end + end: + ${endIf} +!macroend \ No newline at end of file