|
1 | 1 | ; AutoNote NSIS uninstaller customization |
2 | | -; Shows a dialog asking the user what to retain when uninstalling. |
| 2 | +; |
| 3 | +; Cleans up files created by the app during uninstall. The custom page-based |
| 4 | +; "choose what to keep" dialog was removed because it trips electron-builder's |
| 5 | +; multi-pass NSIS compile (warnings 6010/6020/8000, which CI escalates to |
| 6 | +; errors). Default behavior now: remove everything the app created. |
3 | 7 |
|
4 | | -!include "MUI2.nsh" |
5 | | - |
6 | | -Var KeepNotes |
7 | | -Var KeepSettings |
8 | | -Var KeepVenv |
9 | | - |
10 | | -; ── Custom uninstall page ────────────────────────────────────────────────────── |
11 | | -Function un.customUninstallPage |
12 | | - nsDialogs::Create 1018 |
13 | | - Pop $0 |
14 | | - |
15 | | - ${NSD_CreateLabel} 0 0 100% 24u "Choose what to keep after uninstalling AutoNote:" |
16 | | - Pop $0 |
17 | | - |
18 | | - ${NSD_CreateCheckBox} 16u 32u 100% 14u "Keep generated notes and downloaded files (~AutoNote folder)" |
19 | | - Pop $KeepNotes |
20 | | - ${NSD_Check} $KeepNotes |
21 | | - |
22 | | - ${NSD_CreateCheckBox} 16u 52u 100% 14u "Keep settings and API keys (~/.auto_note/config)" |
23 | | - Pop $KeepSettings |
24 | | - ${NSD_Check} $KeepSettings |
25 | | - |
26 | | - ${NSD_CreateCheckBox} 16u 72u 100% 14u "Keep ML environment (~/.auto_note/venv, ~2 GB)" |
27 | | - Pop $KeepVenv |
28 | | - |
29 | | - ${NSD_CreateLabel} 16u 100u 100% 24u "Unchecked items will be permanently deleted." |
30 | | - Pop $0 |
31 | | - |
32 | | - nsDialogs::Show |
33 | | -FunctionEnd |
34 | | - |
35 | | -Function un.customUninstallPageLeave |
36 | | - ${NSD_GetState} $KeepNotes $KeepNotes |
37 | | - ${NSD_GetState} $KeepSettings $KeepSettings |
38 | | - ${NSD_GetState} $KeepVenv $KeepVenv |
39 | | -FunctionEnd |
40 | | - |
41 | | -; ── Register the custom page ────────────────────────────────────────────────── |
42 | | -!macro customUnInstallPage |
43 | | - UninstPage custom un.customUninstallPage un.customUninstallPageLeave |
44 | | -!macroend |
45 | | - |
46 | | -; ── Cleanup after standard uninstall ────────────────────────────────────────── |
47 | 8 | !macro customUnInstall |
48 | | - ; Delete ML venv if user chose not to keep it |
49 | | - ${If} $KeepVenv != ${BST_CHECKED} |
50 | | - RMDir /r "$PROFILE\.auto_note\venv" |
51 | | - ${EndIf} |
52 | | - |
53 | | - ; Delete settings if user chose not to keep them |
54 | | - ${If} $KeepSettings != ${BST_CHECKED} |
55 | | - ; Remove config, credentials, scripts — but keep venv if retained above |
56 | | - Delete "$PROFILE\.auto_note\config.json" |
57 | | - Delete "$PROFILE\.auto_note\canvas_token.txt" |
58 | | - Delete "$PROFILE\.auto_note\openai_api.txt" |
59 | | - Delete "$PROFILE\.auto_note\anthropic_key.txt" |
60 | | - Delete "$PROFILE\.auto_note\gemini_api.txt" |
61 | | - Delete "$PROFILE\.auto_note\deepseek_api.txt" |
62 | | - Delete "$PROFILE\.auto_note\grok_api.txt" |
63 | | - Delete "$PROFILE\.auto_note\mistral_api.txt" |
64 | | - Delete "$PROFILE\.auto_note\manifest.json" |
65 | | - RMDir /r "$PROFILE\.auto_note\scripts" |
66 | | - ; Only remove the dir if it's empty (venv might still be there) |
67 | | - RMDir "$PROFILE\.auto_note" |
68 | | - ${EndIf} |
69 | | - |
70 | | - ; Delete generated content if user chose not to keep it |
71 | | - ${If} $KeepNotes != ${BST_CHECKED} |
72 | | - RMDir /r "$PROFILE\AutoNote" |
73 | | - ${EndIf} |
| 9 | + ; Remove the ML venv (~2 GB) set up by first-run. |
| 10 | + RMDir /r "$PROFILE\.auto_note\venv" |
| 11 | + |
| 12 | + ; Remove config, credentials, cached scripts, and the manifest. |
| 13 | + Delete "$PROFILE\.auto_note\config.json" |
| 14 | + Delete "$PROFILE\.auto_note\canvas_token.txt" |
| 15 | + Delete "$PROFILE\.auto_note\openai_api.txt" |
| 16 | + Delete "$PROFILE\.auto_note\anthropic_key.txt" |
| 17 | + Delete "$PROFILE\.auto_note\gemini_api.txt" |
| 18 | + Delete "$PROFILE\.auto_note\deepseek_api.txt" |
| 19 | + Delete "$PROFILE\.auto_note\grok_api.txt" |
| 20 | + Delete "$PROFILE\.auto_note\mistral_api.txt" |
| 21 | + Delete "$PROFILE\.auto_note\manifest.json" |
| 22 | + RMDir /r "$PROFILE\.auto_note\scripts" |
| 23 | + RMDir "$PROFILE\.auto_note" |
| 24 | + |
| 25 | + ; Remove generated notes and downloaded course material. |
| 26 | + RMDir /r "$PROFILE\AutoNote" |
74 | 27 | !macroend |
0 commit comments