-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathanymeal.nsi
176 lines (140 loc) · 5.94 KB
/
anymeal.nsi
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
!include "MUI2.nsh"
; The name of the installer
Name "AnyMeal"
SetCompressor lzma
SetCompress force
; The file to write
OutFile "anymeal-installer-1.33.exe"
; The default installation directory
InstallDir $PROGRAMFILES\AnyMeal
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\NSIS_AnyMeal" "Install_Dir"
;--------------------------------
; Pages
!define MUI_ICON "anymeal\anymeal.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "anymeal\header.bmp"
!define MUI_WELCOMEPAGE_TITLE "AnyMeal"
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
; The stuff to install
Section "AnyMeal (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "anymeal\.libs\anymeal.exe"
File "anymeal\anymeal.ico"
File "LICENSE"
File "C:\msys64\mingw64\bin\libbrotlicommon.dll"
File "C:\msys64\mingw64\bin\libbrotlidec.dll"
File "C:\msys64\mingw64\bin\libbz2-1.dll"
File "C:\msys64\mingw64\bin\libdouble-conversion.dll"
File "C:\msys64\mingw64\bin\libfreetype-6.dll"
File "C:\msys64\mingw64\bin\libgcc_s_seh-1.dll"
File "C:\msys64\mingw64\bin\libglib-2.0-0.dll"
File "C:\msys64\mingw64\bin\libgraphite2.dll"
File "C:\msys64\mingw64\bin\libharfbuzz-0.dll"
File "C:\msys64\mingw64\bin\libiconv-2.dll"
File "C:\msys64\mingw64\bin\libicudt*.dll"
File "C:\msys64\mingw64\bin\libicuin*.dll"
File "C:\msys64\mingw64\bin\libicuuc*.dll"
File "C:\msys64\mingw64\bin\libintl-8.dll"
File "C:\msys64\mingw64\bin\libmd4c.dll"
File "C:\msys64\mingw64\bin\libpcre-1.dll"
File "C:\msys64\mingw64\bin\libpcre2-8-0.dll"
File "C:\msys64\mingw64\bin\libpcre2-16-0.dll"
File "C:\msys64\mingw64\bin\libb2-1.dll"
File "C:\msys64\mingw64\bin\libpng16-16.dll"
File "C:\msys64\mingw64\bin\libsqlite3-0.dll"
File "C:\msys64\mingw64\bin\libstdc++-6.dll"
File "C:\msys64\mingw64\bin\libwinpthread-1.dll"
File "C:\msys64\mingw64\bin\libzstd.dll"
File "C:\msys64\mingw64\bin\Qt6Core.dll"
File "C:\msys64\mingw64\bin\Qt6Gui.dll"
File "C:\msys64\mingw64\bin\Qt6Svg.dll"
File "C:\msys64\mingw64\bin\Qt6PrintSupport.dll"
File "C:\msys64\mingw64\bin\Qt6Widgets.dll"
File "C:\msys64\mingw64\bin\zlib1.dll"
SetOutPath "$INSTDIR\platforms"
File "C:\msys64\mingw64\share\qt6\plugins\platforms\qwindows.dll"
SetOutPath "$INSTDIR\imageformats"
File "C:\msys64\mingw64\share\qt6\plugins\imageformats\qsvg.dll"
SetOutPath "$INSTDIR\styles"
File "C:\msys64\mingw64\share\qt6\plugins\styles\qmodernwindowsstyle.dll"
SetOutPath "$INSTDIR\locale\de"
File "anymeal\locale\de\anymeal_qt.qm"
SetOutPath "$INSTDIR\locale\fr"
File "anymeal\locale\fr\anymeal_qt.qm"
SetOutPath "$INSTDIR\locale\nl"
File "anymeal\locale\nl\anymeal_qt.qm"
SetOutPath "$INSTDIR\locale\it"
File "anymeal\locale\it\anymeal_qt.qm"
SetOutPath "$INSTDIR\locale\sl"
File "anymeal\locale\sl\anymeal_qt.qm"
SetOutPath $INSTDIR
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\NSIS_AnyMeal" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "DisplayName" "AnyMeal"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "DisplayIcon" '"$INSTDIR\anymeal.ico"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "Publisher" "Jan Wedekind"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "DisplayVersion" "1.33"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "EstimatedSize" 76099
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\AnyMeal"
CreateShortCut "$SMPROGRAMS\AnyMeal\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\AnyMeal\AnyMeal.lnk" "$INSTDIR\anymeal.exe" "" "$INSTDIR\anymeal.exe" 0
SectionEnd
Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\AnyMeal.lnk" "$INSTDIR\anymeal.exe" "" "$INSTDIR\anymeal.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyMeal"
DeleteRegKey HKLM "SOFTWARE\NSIS_AnyMeal"
; Remove files and uninstaller
Delete "$INSTDIR\styles\*.dll"
Delete "$INSTDIR\imageformats\*.dll"
Delete "$INSTDIR\platforms\*.dll"
Delete "$INSTDIR\locale\sl\*.qm"
Delete "$INSTDIR\locale\it\*.qm"
Delete "$INSTDIR\locale\nl\*.qm"
Delete "$INSTDIR\locale\de\*.qm"
Delete "$INSTDIR\locale\fr\*.qm"
Delete "$INSTDIR\*.dll"
Delete $INSTDIR\LICENSE
Delete $INSTDIR\anymeal.exe
Delete $INSTDIR\anymeal.ico
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\AnyMeal\*.*"
Delete "$DESKTOP\AnyMeal.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\AnyMeal"
RMDir "$INSTDIR\locale\sl"
RMDir "$INSTDIR\locale\it"
RMDir "$INSTDIR\locale\nl"
RMDir "$INSTDIR\locale\de"
RMDir "$INSTDIR\locale\fr"
RMDir "$INSTDIR\locale"
RMDir "$INSTDIR\styles"
RMDir "$INSTDIR\imageformats"
RMDir "$INSTDIR\platforms"
RMDir "$INSTDIR"
SectionEnd