1
; Script generated by the HM NIS Edit Script Wizard.
3
; HM NIS Edit Wizard helper defines
4
!define PRODUCT_NAME "Adeona"
5
!define PRODUCT_VERSION "v0.2.1"
6
!define PRODUCT_PUBLISHER "University of Washington"
7
!define PRODUCT_WEB_SITE "http://adeona.cs.washington.edu"
11
; MUI 1.67 compatible ------
13
!include nsDialogs.nsh
14
;!include LogicLib.nsh
17
!define MUI_ABORTWARNING
18
!define MUI_ICON "adeona_globeonly_trans.ico"
19
!define MUI_UNICON "adeona_globeonly_trans.ico"
20
!define MUI_WELCOMEFINISHPAGE_BITMAP "adeona_inst_globe.bmp"
21
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
22
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "adeona_inst_globe.bmp"
23
!define MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH
24
!define MUI_HEADERIMAGE
25
!define MUI_HEADERIMAGE_BITMAP "adeona_inst_globe_small.bmp"
26
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
27
!define MUI_HEADERIMAGE_RIGHT
28
;!define MUI_FINISHPAGE_TITLE "Installation successful."
29
;!define MUI_FINISHPAGE_TEXT_LARGE
30
;!define MUI_FINISHPAGE_TEXT "IMPORTANT: Please don't forget to make a backup copy of your location-finding credentials,\r\n\r\n\
31
; \t adeona-retrievecredentials.ost\r\n\r\n\
32
; A copy has been created on your Desktop. You can simply e-mail it to yourself, put it in a USB Memory Stick or, \
33
; even write down the contents on a piece of paper since the contents have been protected by the password you gave \
34
; during the installation process.\r\n\r\n\
35
; NOTE: Adeona has pseudorandomly scheduled updates and there may not be any location information stored in OpenDHT \
36
; yet. Please wait about 30 minutes before trying to do a retrieval.\r\n\r\n\
37
; For questions, comments and suggestions, please send an e-mail to adeona@cs.washington.edu\r\n\r\n\
38
; Thank you for using Adeona!"
41
!insertmacro MUI_PAGE_WELCOME
43
!define MUI_LICENSEPAGE_CHECKBOX
44
!insertmacro MUI_PAGE_LICENSE "..\..\License.txt"
45
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE myComponentLeave
46
!insertmacro MUI_PAGE_COMPONENTS
48
!insertmacro MUI_PAGE_DIRECTORY
50
!insertmacro MUI_PAGE_INSTFILES
52
Page custom passwordPage passwordPageEnd
54
Page custom FinishPage
57
!insertmacro MUI_UNPAGE_INSTFILES
60
!insertmacro MUI_LANGUAGE "English"
67
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
68
OutFile "AdeonaSetup.exe"
69
InstallDir "$PROGRAMFILES\Adeona"
71
ShowUnInstDetails show
72
RequestExecutionLevel admin
83
Section "-common installation stuff"
85
CreateDirectory "$INSTDIR\resources"
86
CreateDirectory "$INSTDIR\logs"
87
SetOutPath "$INSTDIR\resources"
89
; File "packagefiles\resources\options.adeona"
90
File "..\..\resources\landmarks.adeona"
91
File "..\..\resources\gateways.adeona"
92
File "..\..\resources\options.adeona"
95
File "packagefiles\cygcrypto-0.9.8.dll"
96
File "packagefiles\cygrunsrv.exe"
97
File "packagefiles\cygwin1.dll"
100
; FileOpen $0 "$INSTDIR\resources\options.adeona" w
101
;; FileWrite $0 "LOG_FILENAME = $INSTDIR\logs\adeona.log$\n"
102
; FileWrite $0 "CTXT_QUEUE_SIZE = 1$\n"
103
; FileWrite $0 "SERVER_NAME = opendht.nyuld.net$\n"
104
; FileWrite $0 "SERVER_PORT = 5852$\n"
105
; FileWrite $0 "SCHED_LAMBDA = 0.001$\n"
106
; FileWrite $0 "NUM_DHTKEYS_TOTRY = 2$\n"
107
; FileWrite $0 "USE_TRACEROUTES = 1$\n"
108
; ; FileWrite $0 "LANDMARKS_FILENAME = $INSTDIR\resources\landmarks.adeona$\n"
109
; FileWrite $0 "MAX_SLEEPTIME = 300$\n"
110
; ;FileWrite $0 "GATEWAYS_FILENAME = $INSTDIR\resources\gateways.adeona$\n"
111
; FileWrite $0 "USE_WEBCAMIMG = 0$\n" ; set USE_WEBCAMING to be zero, since this fails in Windows always, yes?
112
; FileWrite $0 "GWUPDATE_URL = adeona.cs.washington.edu/gateways.adeona$\n"
113
; FileWrite $0 "USE_GWUPDATE = 1$\n"
114
; ; FileWrite $0 "WEBCAMPROG_PATH = $INSTDIR\resources\isightcapture.exe$\n"
117
; Creat Start Menu entry
119
CreateDirectory "$SMPROGRAMS\Adeona"
120
CreateShortCut "$SMPROGRAMS\Adeona\Uninstall Adeona.lnk" "$INSTDIR\Uninstall.exe"
123
Section "Adeona Client" SEC01
124
StrCpy $clientflag "true"
126
SetOutPath "$INSTDIR"
128
File "..\..\adeona-client.exe"
129
File "..\..\adeona-init.exe"
130
File "packagefiles\InitAdeona.bat"
131
File "packagefiles\StartAdeona.bat"
132
File "packagefiles\StopAdeona.bat"
139
Section "Adeona Recovery Tools" SEC02
140
CreateDirectory "$INSTDIR\resources"
141
CreateDirectory "$INSTDIR\logs"
142
SetOutPath "$INSTDIR\resources"
144
; File "packagefiles\resources\options.adeona"
145
File "..\..\resources\gateways.adeona"
147
SetOutPath "$INSTDIR"
148
File "packagefiles\adeona-retrieve.bat"
149
File "packagefiles\AdeonaRecovery.exe"
150
File "..\..\adeona-retrieve.exe"
153
CreateDirectory "$SMPROGRAMS\Adeona"
154
CreateShortCut "$SMPROGRAMS\Adeona\Run Adeona Recovery.lnk" "$INSTDIR\AdeonaRecovery.exe"
157
LangString DESC_Section1 ${LANG_ENGLISH} "The Adeona Client periodically sends private updates \
158
regarding the current location of your laptop to a remote storage facility on the Internet."
159
LangString DESC_Section2 ${LANG_ENGLISH} "The Adeona Recovery tools help one retrieve updates sent \
160
by a laptop. $\n$\nThis is all that is required to perform retrieval of updates sent from a machine."
162
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
163
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_Section1)
164
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_Section2)
165
!insertmacro MUI_FUNCTION_DESCRIPTION_END
168
WriteUninstaller "$INSTDIR\Uninstall.exe"
172
Function myComponentLeave
173
SectionGetFlags ${SEC01} $0
174
IntOp $1 $0 & ${SF_SELECTED}
175
SectionGetFlags ${SEC02} $2
176
IntOp $3 $2 & ${SF_SELECTED}
179
MessageBox MB_OK "Please select at least one component." IDOK true3
181
Abort ; forces to stay on this page
187
Function passwordPage
189
!insertmacro MUI_HEADER_TEXT "Initializing the Adeona client" "Choose a password"
191
SectionGetFlags ${SEC01} $0
193
IntOp $1 $0 & ${SF_SELECTED}
198
nsDialogs::Create /NOUNLOAD 1018
201
${If} $Dialog == error
205
${NSD_CreateLabel} 0 0 100% 26u "To protect your location finding credentials, please pick a password for Adeona. \
206
It does not need to be the same as your login password."
209
${NSD_CreateLabel} 0 30u 40% 24u "Adeona password:"
211
${NSD_CreatePassword} 45% 30u 50% 12u ""
214
${NSD_SetFocus} $passwordbox
216
${NSD_CreateLabel} 0 50u 40% 24u "Please re-enter your Adeona password for verification:"
218
${NSD_CreatePassword} 45% 53u 50% 12u ""
225
Function passwordPageEnd
226
${NSD_GetText} $passwordbox $password
227
${NSD_GetText} $passwordboxver $passwordver
228
${If} $password == ""
229
MessageBox MB_OK "Password is empty. To ensure privacy of your device tracking updates, please specify a password." IDOK true2
231
Abort ; forces to stay on this page
233
${If} $password != $passwordver
234
MessageBox MB_OK "Passwords do not match. Please try again." IDOK true
236
Abort ; forces to stay on this page
241
ExecWait '"$INSTDIR\InitAdeona.bat" "$INSTDIR" "$password"'
243
CopyFiles "$INSTDIR\adeona-retrievecredentials.ost" "$DESKTOP\"
248
nsDialogs::Create /NOUNLOAD 1018
256
SectionGetFlags ${SEC01} $0
258
IntOp $1 $0 & ${SF_SELECTED}
260
!insertmacro MUI_HEADER_TEXT "Setup complete" "Remember to backup your owner credentials."
261
${NSD_CreateLabel} 0 0 100% 100% "IMPORTANT: Please don't forget to make a backup copy of your location-finding credentials,$\r$\n$\r$\n\
262
$\t adeona-retrievecredentials.ost$\r$\n$\r$\n\
263
A copy has been created on your Desktop. You can simply e-mail it to yourself, put it in a USB Memory Stick or, \
264
even write down the contents on a piece of paper since the contents have been protected by the password you gave \
265
during the installation process.$\r$\n$\r$\n$\r$\n\
266
NOTE: Adeona has pseudorandomly scheduled updates and there may not be any location information stored in OpenDHT \
267
yet. Please wait about 1 hour before trying to do a retrieval.$\r$\n$\r$\n\
268
For questions, comments and suggestions,please visit our website at http://adeona.cs.washington.edu/contact.html $\r$\n$\r$\n\
269
Thank you for using Adeona!"
272
!insertmacro MUI_HEADER_TEXT "Installation complete" ""
273
${NSD_CreateLabel} 0 0 100% 100% "Installation is complete. You can now use the Adeona Recovery tools."
280
;Function .onInstSuccess
281
; MessageBox MB_OK "Installation successful. Click OK to read important instructions regarding recovery."
282
; Exec '"notepad.exe Conclusion.txt' ; view readme or whatever, if you want.
285
Function un.onUninstSuccess
287
MessageBox MB_ICONINFORMATION|MB_OK "Adeona was successfully removed from your computer."
291
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove Adeona and all of its components?" IDYES +2
296
SetOutPath "$INSTDIR" ; Something very strange with working directory for StopAdeona.bat
297
ExecWait '"$INSTDIR\StopAdeona.bat"'
298
SetOutPath "$PROGRAMFILES"
300
Delete "$INSTDIR\resources\*"
301
RMDir "$INSTDIR\resources"
302
Delete "$INSTDIR\logs\*"
303
RMDir "$INSTDIR\logs"
307
Delete "$SMPROGRAMS\Adeona\Run Adeona Recovery.lnk"
308
Delete "$SMPROGRAMS\Adeona\Uninstall Adeona.lnk"
309
RMDir "$SMPROGRAMS\Adeona"