-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflowe_setup.nsi
More file actions
88 lines (72 loc) · 3.84 KB
/
Copy pathflowe_setup.nsi
File metadata and controls
88 lines (72 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
; Flowe NSIS Installer
!define APP_NAME "Flowe"
!define APP_VERSION "1.7.5"
!define PUBLISHER "PrivacyChase"
!define APP_URL "https://privacychase.com"
!define INSTALL_DIR "$PROGRAMFILES64\Flowe"
!define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Flowe"
Name "${APP_NAME} ${APP_VERSION}"
OutFile "installers\flowe_${APP_VERSION}_setup.exe"
InstallDir "${INSTALL_DIR}"
InstallDirRegKey HKLM "${UNINSTALL_KEY}" "InstallLocation"
RequestExecutionLevel admin
SetCompressor /SOLID lzma
; Modern UI
!include "MUI2.nsh"
!define MUI_ICON "assets\app_icon.ico"
!define MUI_UNICON "assets\app_icon.ico"
!define MUI_ABORTWARNING
; Welcome page
!define MUI_WELCOMEPAGE_TITLE "Flowe ${APP_VERSION}"
!define MUI_WELCOMEPAGE_TEXT "What's new in v1.7.5:$\r$\n$\r$\n- Transactions rebuilt: month nav, spending summary, grouped by date$\r$\n- Budget tab now includes Transactions as a sub-tab$\r$\n- Snowball, Net Worth, Events each get their own top-level tab$\r$\n- Split calculator total now saves correctly$\r$\n- Font size no longer resets when adding/deleting rows$\r$\n- Status bar and gesture bar overlap fixed on Android/iOS$\r$\n- Debt card field alignment fixed$\r$\n$\r$\nYour data is safe — installing over an existing version will not delete anything."
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\flowe.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Launch Flowe"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Install"
; Kill any running instance before copying files (safe upgrade)
nsExec::ExecToLog 'taskkill /F /IM flowe.exe'
SetOutPath "$INSTDIR"
File /r "build\windows\x64\runner\Release\*.*"
; Start menu shortcut
CreateDirectory "$SMPROGRAMS\Flowe"
CreateShortcut "$SMPROGRAMS\Flowe\Flowe.lnk" "$INSTDIR\flowe.exe"
CreateShortcut "$SMPROGRAMS\Flowe\Uninstall Flowe.lnk" "$INSTDIR\Uninstall.exe"
; Desktop shortcut
CreateShortcut "$DESKTOP\Flowe.lnk" "$INSTDIR\flowe.exe"
; Write uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
; Add/Remove Programs entry
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayName" "${APP_NAME}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayVersion" "${APP_VERSION}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "Publisher" "${PUBLISHER}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "URLInfoAbout" "${APP_URL}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "URLUpdateInfo" "${APP_URL}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "Comments" "Budget, snowball debt payoff, net worth, event split calculator, spending journal. v${APP_VERSION}: rebuilt Transactions, new tab layout, split calculator save fix, font size fix, safe area fixes."
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\flowe.exe"
WriteRegStr HKLM "${UNINSTALL_KEY}" "InstallLocation" "$INSTDIR"
WriteRegStr HKLM "${UNINSTALL_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
WriteRegDWORD HKLM "${UNINSTALL_KEY}" "NoModify" 1
WriteRegDWORD HKLM "${UNINSTALL_KEY}" "NoRepair" 1
SectionEnd
Section "Uninstall"
; Kill running instance before removal
nsExec::ExecToLog 'taskkill /F /IM flowe.exe'
; Only remove the install directory — NEVER touch AppData
; User data lives in %APPDATA%\flowe\flowe\data.json and is NOT touched here
Delete "$INSTDIR\Uninstall.exe"
Delete "$INSTDIR\flowe.exe"
RMDir /r "$INSTDIR\data"
RMDir /r "$INSTDIR\flutter_assets"
RMDir "$INSTDIR"
Delete "$DESKTOP\Flowe.lnk"
RMDir /r "$SMPROGRAMS\Flowe"
DeleteRegKey HKLM "${UNINSTALL_KEY}"
; Inform user data is preserved
MessageBox MB_OK "Flowe has been uninstalled.$\r$\nYour data is still saved at:$\r$\n%APPDATA%\flowe\flowe\data.json$\r$\nDelete that folder manually if you want to remove all data."
SectionEnd