-
Notifications
You must be signed in to change notification settings - Fork 0
/
Filecalibur.nsi
173 lines (149 loc) · 5.85 KB
/
Filecalibur.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
!define VERSION "0.8.0"
!define NAME "Filecalibur"
!define UNINSTREG "Software\Microsoft\Windows\CurrentVersion\Uninstall\Filecalibur"
!define QTPATH "C:\Qt_201806\5.11.1\mingw53_32\bin\"
!include "MUI2.nsh"
!include "logiclib.nsh"
!include "WinVer.nsh"
Name "${NAME} ${VERSION}"
OutFile "Filecalibur.exe"
InstallDir "$PROGRAMFILES32\Filecalibur"
InstallDirRegKey HKLM "Software\Filecalibur" "Install_Dir"
RequestExecutionLevel admin
!define MUI_ABORTWARNING
!define MUI_ICON "src\files\Logo_128.ico"
; Show the dialogs
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "At least Windows 7 is required."
Quit
${EndIf}
FunctionEnd
; Copy the files
Section "Filecalibur" Filecalibur
SetOutPath "$INSTDIR"
File ${QTPATH}libgcc_s_dw2-1.dll
File ${QTPATH}libstdc++-6.dll
File ${QTPATH}libwinpthread-1.dll
File ${QTPATH}Qt5Core.dll
File ${QTPATH}Qt5Gui.dll
File ${QTPATH}Qt5Network.dll
File ${QTPATH}Qt5Widgets.dll
File build-Filecalibur-Desktop_Qt_5_11_1_MinGW_32bit-Release\release\Filecalibur.exe
File src\files\Logo_128.ico
File src\files\license.txt
SetOutPath "$INSTDIR\platforms"
File ${QTPATH}..\plugins\platforms\qminimal.dll
File ${QTPATH}..\plugins\platforms\qoffscreen.dll
File ${QTPATH}..\plugins\platforms\qwindows.dll
SetOutPath "$INSTDIR\hashdeep"
File progs\hashdeep\CHANGES.txt
File progs\hashdeep\COPYING.txt
File progs\hashdeep\FILEFORMAT.txt
File progs\hashdeep\hashdeep.exe
File progs\hashdeep\HASHDEEP.txt
File progs\hashdeep\hashdeep64.exe
File progs\hashdeep\md5deep.exe
File progs\hashdeep\MD5DEEP.txt
File progs\hashdeep\md5deep64.exe
File progs\hashdeep\sha1deep.exe
File progs\hashdeep\sha1deep64.exe
File progs\hashdeep\sha256deep.exe
File progs\hashdeep\sha256deep64.exe
File progs\hashdeep\tigerdeep.exe
File progs\hashdeep\tigerdeep64.exe
File progs\hashdeep\whirlpooldeep.exe
File progs\hashdeep\whirlpooldeep64.exe
SetOutPath "$INSTDIR\winmerge"
File progs\winmerge\WinMerge-2.14.0-Setup.exe
; Start menu link
createDirectory "$SMPROGRAMS\Filecalibur"
createShortCut "$SMPROGRAMS\Filecalibur\Filecalibur.lnk" "$INSTDIR\Filecalibur.exe" "" "$INSTDIR\Logo_128.ico"
createShortCut "$DESKTOP\Filecalibur.lnk" "$INSTDIR\Filecalibur.exe" "" "$INSTDIR\Logo_128.ico"
; Save installation path in registry
WriteRegStr HKLM SOFTWARE\Filecalibur "Install_Dir" "$INSTDIR"
; This is required for correct information in the uninstal page
WriteRegStr HKLM "${UNINSTREG}" "DisplayName" "${NAME}"
WriteRegStr HKLM "${UNINSTREG}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "${UNINSTREG}" "Publisher" "A. Untergasser"
WriteRegStr HKLM "${UNINSTREG}" "URLInfoAbout" "https://github.com/untergasser/filecalibur/"
WriteRegStr HKLM "${UNINSTREG}" "DisplayIcon" '"$INSTDIR\Logo_128.ico"'
WriteRegStr HKLM "${UNINSTREG}" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "${UNINSTREG}" "NoModify" 1
WriteRegDWORD HKLM "${UNINSTREG}" "NoRepair" 1
WriteUninstaller "uninstall.exe"
MessageBox MB_YESNO "Install WinMerge?" /SD IDYES IDNO endInstWinMerge
ExecWait "$INSTDIR\winmerge\WinMerge-2.14.0-Setup.exe"
Goto endInstWinMerge
endInstWinMerge:
SectionEnd
; Remove all files
Section "Uninstall"
; Get install directory from registry
ReadRegStr $INSTDIR HKLM SOFTWARE\Filecalibur "Install_Dir"
; Clean Registry
DeleteRegKey HKLM "${UNINSTREG}"
DeleteRegKey HKLM SOFTWARE\Filecalibur
; Delete all files
Delete "$DESKTOP\Filecalibur.lnk"
Delete "$SMPROGRAMS\Filecalibur\Filecalibur.lnk"
Delete "$INSTDIR\hashdeep\CHANGES.txt"
Delete "$INSTDIR\hashdeep\COPYING.txt"
Delete "$INSTDIR\hashdeep\FILEFORMAT.txt"
Delete "$INSTDIR\hashdeep\hashdeep.exe"
Delete "$INSTDIR\hashdeep\HASHDEEP.txt"
Delete "$INSTDIR\hashdeep\hashdeep64.exe"
Delete "$INSTDIR\hashdeep\md5deep.exe"
Delete "$INSTDIR\hashdeep\MD5DEEP.txt"
Delete "$INSTDIR\hashdeep\md5deep64.exe"
Delete "$INSTDIR\hashdeep\sha1deep.exe"
Delete "$INSTDIR\hashdeep\sha1deep64.exe"
Delete "$INSTDIR\hashdeep\sha256deep.exe"
Delete "$INSTDIR\hashdeep\sha256deep64.exe"
Delete "$INSTDIR\hashdeep\tigerdeep.exe"
Delete "$INSTDIR\hashdeep\tigerdeep64.exe"
Delete "$INSTDIR\hashdeep\whirlpooldeep.exe"
Delete "$INSTDIR\hashdeep\whirlpooldeep64.exe"
Delete "$INSTDIR\rsync\cygwin1.dll"
Delete "$INSTDIR\rsync\cyggcc_s-1.dll"
Delete "$INSTDIR\rsync\cygiconv-2.dll"
Delete "$INSTDIR\rsync\license.txt"
Delete "$INSTDIR\rsync\NEWS.txt"
Delete "$INSTDIR\rsync\rsync.exe"
Delete "$INSTDIR\rsync\rsync.html"
Delete "$INSTDIR\winmerge\WinMerge-2.14.0-Setup.exe"
Delete "$INSTDIR\platforms\qminimal.dll"
Delete "$INSTDIR\platforms\qoffscreen.dll"
Delete "$INSTDIR\platforms\qwindows.dll"
Delete "$INSTDIR\icudt52.dll"
Delete "$INSTDIR\icuin52.dll"
Delete "$INSTDIR\icuuc52.dll"
Delete "$INSTDIR\libgcc_s_dw2-1.dll"
Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\libwinpthread-1.dll"
Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\Qt5Gui.dll"
Delete "$INSTDIR\Qt5Network.dll"
Delete "$INSTDIR\Qt5Widgets.dll"
Delete "$INSTDIR\Filecalibur.exe"
Delete "$INSTDIR\Logo_128.ico"
Delete "$INSTDIR\license.txt"
Delete "$INSTDIR\uninstall.exe"
; Remove Directories
RMDir "$INSTDIR\hashdeep"
RMDir "$INSTDIR\rsync"
RMDir "$INSTDIR\winmerge"
RMDir "$INSTDIR\platforms"
RMDir "$INSTDIR"
RMDir "$SMPROGRAMS\Filecalibur"
MessageBox MB_YESNO "Uninstall WinMerge?" /SD IDYES IDNO endUnInstWinMerge
ExecWait "$INSTDIR\..\WinMerge\unins000.exe"
Goto endUnInstWinMerge
endUnInstWinMerge:
SectionEnd