-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installer Script.nsis.nsi
executable file
·277 lines (233 loc) · 10.7 KB
/
Installer Script.nsis.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Cipher"
!define PRODUCT_VERSION "1.1"
!define PRODUCT_PUBLISHER "Dominick Johnson"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Cipher.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "Files\Icon.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "Files\Licence_Plaintext.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\exe.win32-3.2\Cipher.exe"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME}_Setup_${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\Cipher"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section ;Grants all users full access to install dir. Otherwise, I get "Access Denied" errors
CreateDirectory "$SMPROGRAMS\Cipher"
AccessControl::GrantOnFile \
"$INSTDIR" "(BU)" "FullAccess"
SectionEnd
Section "Cipher" SEC01 ;Compiled Program
SetOverwrite try
SetOutPath "$INSTDIR\exe.win32-3.2"
File "build\exe.win32-3.2\library.zip"
File "build\exe.win32-3.2\numpy.core.multiarray.pyd"
File "build\exe.win32-3.2\numpy.core.scalarmath.pyd"
File "build\exe.win32-3.2\numpy.core.umath.pyd"
File "build\exe.win32-3.2\numpy.core._dotblas.pyd"
File "build\exe.win32-3.2\numpy.fft.fftpack_lite.pyd"
File "build\exe.win32-3.2\numpy.lib._compiled_base.pyd"
File "build\exe.win32-3.2\numpy.linalg.lapack_lite.pyd"
File "build\exe.win32-3.2\numpy.random.mtrand.pyd"
File "build\exe.win32-3.2\pyexpat.pyd"
File "build\exe.win32-3.2\pyside-python3.2.dll"
File "build\exe.win32-3.2\PySide.QtCore.pyd"
File "build\exe.win32-3.2\PySide.QtGui.pyd"
File "build\exe.win32-3.2\python32.dll"
File "build\exe.win32-3.2\QtCore4.dll"
File "build\exe.win32-3.2\QtGui4.dll"
File "build\exe.win32-3.2\select.pyd"
File "build\exe.win32-3.2\shiboken-python3.2.dll"
File "build\exe.win32-3.2\unicodedata.pyd"
File "build\exe.win32-3.2\_ctypes.pyd"
File "build\exe.win32-3.2\_hashlib.pyd"
File "build\exe.win32-3.2\_multiprocessing.pyd"
File "build\exe.win32-3.2\_socket.pyd"
File "build\exe.win32-3.2\_ssl.pyd"
File "build\exe.win32-3.2\bz2.pyd"
File "build\exe.win32-3.2\Cipher.exe"
SetOutPath "$INSTDIR\exe.win32-3.2\Files"
File "build\exe.win32-3.2\Files\About.txt"
File "build\exe.win32-3.2\Files\Cipher Info.txt"
File "build\exe.win32-3.2\Files\Dictionary.txt"
File "build\exe.win32-3.2\Files\Icon.ico"
File "build\exe.win32-3.2\Files\Licence.txt"
File "build\exe.win32-3.2\Files\Logo.png"
File "build\exe.win32-3.2\Files\Missing_Dependancies.html"
File "build\exe.win32-3.2\Files\Attributions.txt"
SetOutPath "$INSTDIR\exe.win32-3.2\Files\ButtonIcons"
File "build\exe.win32-3.2\Files\ButtonIcons\About.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Bug.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Contact.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Copy.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Cut.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Exit.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Green Check.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Info.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Minus.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Open.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Paste.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Plus.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Red X.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Redo.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Save As.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Save.png"
File "build\exe.win32-3.2\Files\ButtonIcons\Undo.png"
CreateShortCut "$SMPROGRAMS\Cipher\Cipher.lnk" "$INSTDIR\exe.win32-3.2\Cipher.exe"
CreateShortCut "$DESKTOP\Cipher.lnk" "$INSTDIR\exe.win32-3.2\Cipher.exe"
SectionEnd
Section "Source" SEC02
SetOutPath "$INSTDIR\source"
file "Cipher.pyw"
SetOutPath "$INSTDIR\source\Cipher"
File "Cipher\Contact.py"
File "Cipher\EnglishChecker.py"
File "Cipher\GuiElements.py"
File "Cipher\LetterMath.py"
File "Cipher\Options.py"
File "Cipher\Utilities.py"
File "Cipher\Update.py"
File "Cipher\__init__.py"
SetOutPath "$INSTDIR\source\Cipher\Encryption"
File "Cipher\Encryption\Ceasar.py"
File "Cipher\Encryption\Enigma.py"
File "Cipher\Encryption\Hide.py"
File "Cipher\Encryption\HillCipher.py"
File "Cipher\Encryption\NullCipher.py"
File "Cipher\Encryption\OneTimePad.py"
File "Cipher\Encryption\Playfair.py"
File "Cipher\Encryption\Railfence.py"
File "Cipher\Encryption\Substitution.py"
File "Cipher\Encryption\Transposition.py"
File "Cipher\Encryption\Vinegre.py"
File "Cipher\Encryption\__init__.py"
SetOutPath "$INSTDIR\source\Cipher\Encryption\RSA"
File "Cipher\Encryption\RSA\Interface.py"
File "Cipher\Encryption\RSA\KeyGenerator.py"
File "Cipher\Encryption\RSA\__init__.py"
SetOutPath "$INSTDIR\source\Cipher"
SetOutPath "$INSTDIR\source\Cipher\ImportExport"
File "Cipher\ImportExport\DJCK.py"
File "Cipher\ImportExport\Misc.py"
File "Cipher\ImportExport\RTF.py"
File "Cipher\ImportExport\TXT.py"
File "Cipher\ImportExport\__init__.py"
CreateShortCut "$SMPROGRAMS\Cipher\Veiw Source.lnk" "$INSTDIR\Source"
CreateShortCut "$SMPROGRAMS\Cipher\Run from Source.lnk" "$INSTDIR\Source\Cipher.pyw"
File "Files\1-1000 - Backup.txt"
File "Files\1-1000.txt"
File "Files\About.txt"
File "Files\Cipher Info.txt"
File "Files\Dictionary.txt"
File "Files\Icon.ico"
File "Files\Licence.txt"
File "Files\Logo.png"
File "Files\Missing_Dependancies.html"
File "Files\Attributions.txt"
SetOutPath "$INSTDIR\source\Files\ButtonIcons"
File "Files\ButtonIcons\About.png"
File "Files\ButtonIcons\Bug.png"
File "Files\ButtonIcons\Contact.png"
File "Files\ButtonIcons\Copy.png"
File "Files\ButtonIcons\Cut.png"
File "Files\ButtonIcons\Exit.png"
File "Files\ButtonIcons\Green Check.png"
File "Files\ButtonIcons\Info.png"
File "Files\ButtonIcons\Minus.png"
File "Files\ButtonIcons\Open.png"
File "Files\ButtonIcons\Paste.png"
File "Files\ButtonIcons\Plus.png"
File "Files\ButtonIcons\Red X.png"
File "Files\ButtonIcons\Redo.png"
File "Files\ButtonIcons\Save As.png"
File "Files\ButtonIcons\Save.png"
File "Files\ButtonIcons\Undo.png"
SectionEnd
Section -AdditionalIcons
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\Cipher\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
;note, reg keys in format: root_key subkey key_name value
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Cipher.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\AppMainExe.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "The Main (Compiled) Program. Required."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "The source code for the program. Not Required."
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\Log.txt"
Delete "$INSTDIR\source\Files\ButtonIcons\*.*"
Delete "$INSTDIR\source\Files\*.*"
Delete "$INSTDIR\source\Cipher\__pycache__\*.*"
Delete "$INSTDIR\source\Cipher\ImportExport\__pycache__\*.*"
Delete "$INSTDIR\source\Cipher\ImportExport\*.*"
Delete "$INSTDIR\source\Cipher\Encryption\RSA\__pycache__\*.*"
Delete "$INSTDIR\source\Cipher\Encryption\RSA\*.*"
Delete "$INSTDIR\source\Cipher\Encryption\__pycache__\*.*"
Delete "$INSTDIR\source\Cipher\Encryption\*.*"
Delete "$INSTDIR\source\Cipher\*.*"
Delete "$INSTDIR\source\*.*"
Delete "$INSTDIR\exe.win32-3.2\Files\ButtonIcons\*.*"
Delete "$INSTDIR\exe.win32-3.2\Files\*.*"
Delete "$INSTDIR\exe.win32-3.2\*.*"
Delete "$DESKTOP\Cipher.lnk"
Delete "$SMPROGRAMS\Cipher\*.*"
RMDir "$SMPROGRAMS\Cipher"
RMDir "$INSTDIR\source\Files\ButtonIcons"
RMDir "$INSTDIR\source\Files"
RMDir "$INSTDIR\source\Cipher\ImportExport\__pycache__"
RMDir "$INSTDIR\source\Cipher\ImportExport"
RMDir "$INSTDIR\source\Cipher\Encryption\RSA"
RMDir "$INSTDIR\source\Cipher\Encryption\__pycache__"
RMDir "$INSTDIR\source\Cipher\Encryption"
RMDir "$INSTDIR\source\Cipher\__pycache__"
RMDir "$INSTDIR\source\Cipher"
RMDir "$INSTDIR\exe.win32-3.2\Files\ButtonIcons"
RMDir "$INSTDIR\exe.win32-3.2\Files"
RMDir "$INSTDIR\exe.win32-3.2"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd