3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 ; The name of the installer
9 OutFile "c:\lutz\newLISP\newlisp-9303-win-gs-114.exe"
11 ; The default installation directory
12 InstallDir $PROGRAMFILES\newlisp
14 ; The text to prompt the user to enter a directory
15 DirText "This will install the newLISP-GS 1.14 and newLISP 9.3.2 on your computer." \
17 ;;;;;;;;;;;;;;;;;;;;;; subroutines for PATH change in Win32 environment ;;;;;;;;;;;;;;
19 !include "WinMessages.NSH"
22 ; AddToPath - Adds the given dir to the search path.
23 ; Input - head of the stack
24 ; Note - Win9x systems requires reboot
32 # don't add if the path doesn't exist
33 IfFileExists "$0\*.*" "" AddToPath_done
40 StrCmp $2 "" "" AddToPath_done
45 StrCmp $2 "" "" AddToPath_done
46 GetFullPathName /SHORT $3 $0
51 StrCmp $2 "" "" AddToPath_done
56 StrCmp $2 "" "" AddToPath_done
60 StrCmp $1 1 AddToPath_NT
63 FileOpen $1 "$1\autoexec.bat" a
66 IntCmp $2 26 0 +2 +2 # DOS EOF
67 FileSeek $1 -1 END # write over EOF
68 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
74 ReadRegStr $1 HKCU "Environment" "PATH"
75 StrCpy $2 $1 1 -1 # copy last char
76 StrCmp $2 ";" 0 +2 # if last char == ;
77 StrCpy $1 $1 -1 # remove last char
78 StrCmp $1 "" AddToPath_NTdoIt
81 WriteRegExpandStr HKCU "Environment" "PATH" $0
82 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
91 ; RemoveFromPath - Remove a given dir from the path
92 ; Input: head of the stack
94 Function un.RemoveFromPath
103 IntFmt $6 "%c" 26 # DOS EOF
107 StrCmp $1 1 unRemoveFromPath_NT
110 FileOpen $1 "$1\autoexec.bat" r
113 GetFullPathName /SHORT $0 $0
114 StrCpy $0 "SET PATH=%PATH%;$0"
115 Goto unRemoveFromPath_dosLoop
117 unRemoveFromPath_dosLoop:
119 StrCpy $5 $3 1 -1 # read last char
120 StrCmp $5 $6 0 +2 # if DOS EOF
121 StrCpy $3 $3 -1 # remove DOS EOF so we can compare
122 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
123 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
124 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
125 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
127 Goto unRemoveFromPath_dosLoop
128 unRemoveFromPath_dosLoopRemoveLine:
130 Goto unRemoveFromPath_dosLoop
132 unRemoveFromPath_dosLoopEnd:
136 Delete "$1\autoexec.bat"
137 CopyFiles /SILENT $4 "$1\autoexec.bat"
139 Goto unRemoveFromPath_done
142 ReadRegStr $1 HKCU "Environment" "PATH"
143 StrCpy $5 $1 1 -1 # copy last char
144 StrCmp $5 ";" +2 # if last char != ;
145 StrCpy $1 "$1;" # append ;
148 Call un.StrStr ; Find $0; in $1
149 Pop $2 ; pos of our dir
150 StrCmp $2 "" unRemoveFromPath_done
151 ; else, it is in path
156 StrCpy $5 $1 -$4 # $5 is now the part before the path to remove
157 StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove
160 StrCpy $5 $3 1 -1 # copy last char
161 StrCmp $5 ";" 0 +2 # if last char == ;
162 StrCpy $3 $3 -1 # remove last char
164 WriteRegExpandStr HKCU "Environment" "PATH" $3
165 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
167 unRemoveFromPath_done:
177 ###########################################
178 # Utility Functions #
179 ###########################################
183 ; output, top of the stack = 1 if NT or 0 if not
188 ; ($R0 at this point is 1 or 0)
193 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
194 StrCmp $0 "" 0 IsNT_yes
207 !insertmacro IsNT "un."
210 ; input, top of stack = string to search for
211 ; top of stack-1 = string to search in
212 ; output, top of stack (replaces with the portion of the string remaining)
213 ; modifies no other variables.
216 ; Push "this is a long ass string"
220 ; ($R0 at this point is "ass string")
224 Exch $R1 ; st=haystack,old$R1, $R1=needle
225 Exch ; st=old$R1,haystack
226 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
238 StrCpy $R5 $R2 $R3 $R4
244 StrCpy $R1 $R2 "" $R4
252 !insertmacro StrStr ""
253 !insertmacro StrStr "un."
255 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; end subroutines for PATH change ====================
258 LicenseData c:\newlisp\COPYING
260 ComponentText Select components
264 ; The stuff to install
265 Section "newLISP program (required) and DLL"
266 CreateDirectory $INSTDIR\guiserver
267 CreateDirectory $INSTDIR\modules
268 CreateDirectory $INSTDIR\util
269 ; Set output path to the installation directories.
272 File "c:\newlisp\newlisp.exe"
273 File "c:\newlisp\newlisp.dll"
274 File "c:\newlisp\md5-checksums.txt"
275 File "c:\newlisp\newlisp_manual.html"
276 File "c:\newlisp\newlisp_index.html"
277 File "c:\newlisp\manual_frame.html"
278 File "c:\newlisp\CodePatterns.html"
279 File "c:\newlisp\newLISPdoc.html"
280 File "c:\newlisp\newLISP-9.3-Release.html"
281 File "c:\newlisp\COPYING"
282 File "c:\newlisp\guiserver.lsp"
283 File "c:\newlisp\guiserver.jar"
284 File "c:\newlisp\newlisp-edit.lsp"
285 File "c:\newlisp\newlisp-win.ico"
287 SetOutPath $INSTDIR\guiserver
288 File "c:\newlisp\guiserver\index.html"
289 File "c:\newlisp\guiserver\guiserver.lsp.html"
290 File "c:\newlisp\guiserver\allfonts-demo.lsp"
291 File "c:\newlisp\guiserver\animation-demo.lsp"
292 File "c:\newlisp\guiserver\border-layout-demo.lsp"
293 File "c:\newlisp\guiserver\button-demo.lsp"
294 File "c:\newlisp\guiserver\clipboard-demo.lsp"
295 File "c:\newlisp\guiserver\cursor-demo.lsp"
296 File "c:\newlisp\guiserver\drag-demo.lsp"
297 File "c:\newlisp\guiserver\font-demo.lsp"
298 File "c:\newlisp\guiserver\frameless-demo.lsp"
299 File "c:\newlisp\guiserver\html-demo.lsp"
300 File "c:\newlisp\guiserver\image-demo.lsp"
301 File "c:\newlisp\guiserver\mouse-demo.lsp"
302 File "c:\newlisp\guiserver\move-resize-demo.lsp"
303 File "c:\newlisp\guiserver\pinballs-demo.lsp"
304 File "c:\newlisp\guiserver\properties-demo.lsp"
305 File "c:\newlisp\guiserver\rotation-demo.lsp"
306 File "c:\newlisp\guiserver\shapes-demo.lsp"
307 File "c:\newlisp\guiserver\sound-demo.lsp"
308 File "c:\newlisp\guiserver\stroke-demo.lsp"
309 File "c:\newlisp\guiserver\tabs-demo.lsp"
310 File "c:\newlisp\guiserver\textrot-demo.lsp"
311 File "c:\newlisp\guiserver\widgets-demo.lsp"
312 File "c:\newlisp\guiserver\word-count.lsp"
313 File "c:\newlisp\guiserver\uppercase.lsp"
315 SetOutPath $INSTDIR\modules
316 File "c:\newlisp\modules\cgi.lsp"
317 File "c:\newlisp\modules\crypto.lsp"
318 File "c:\newlisp\modules\ftp.lsp"
319 File "c:\newlisp\modules\gmp.lsp"
320 File "c:\newlisp\modules\infix.lsp"
321 File "c:\newlisp\modules\mysql.lsp"
322 File "c:\newlisp\modules\mysql5.lsp"
323 File "c:\newlisp\modules\odbc.lsp"
324 File "c:\newlisp\modules\pop3.lsp"
325 File "c:\newlisp\modules\postscript.lsp"
326 File "c:\newlisp\modules\smtp.lsp"
327 File "c:\newlisp\modules\sqlite3.lsp"
328 File "c:\newlisp\modules\stat.lsp"
329 File "c:\newlisp\modules\unix.lsp"
330 File "c:\newlisp\modules\xmlrpc-client.lsp"
331 File "c:\newlisp\modules\zlib.lsp"
333 SetOutPath $INSTDIR\util
334 File "c:\newlisp\util\httpd-conf.lsp"
335 File "c:\newlisp\util\link.lsp"
336 File "c:\newlisp\util\newlisp.vim"
337 File "c:\newlisp\util\newlispdoc"
338 File "c:\newlisp\util\syntax.cgi"
342 ; Write the installation path into the registry
343 WriteRegStr HKLM SOFTWARE\newLISP "Install_Dir" "$INSTDIR"
345 ; Write the uninstall keys for Windows
346 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\newLISP" "DisplayName" "newLISP (remove only)"
347 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\newLISP" "UninstallString" '"$INSTDIR\uninstall.exe"'
349 WriteUninstaller "uninstall.exe"
350 ; make menu in startmenus
351 CreateDirectory "$SMPROGRAMS\newLISP"
352 CreateShortCut "$SMPROGRAMS\newLISP\newLISP.lnk" "$INSTDIR\newlisp.exe" "" "$INSTDIR\newlisp.exe" 0
353 CreateShortCut "$SMPROGRAMS\newLISP\Manual and Reference.lnk" "$INSTDIR\manual_frame.html" "" "$INSTDIR\manual_frame.html" 0
354 CreateShortCut "$SMPROGRAMS\newLISP\GS Manual and Reference.lnk" "$INSTDIR\guiserver\index.html" "" "$INSTDIR\guiserver\index.html" 0
355 #CreateShortCut "$SMPROGRAMS\newLISP\CodePatterns.lnk" "$INSTDIR\guiserver\CodePatterns.html" "" "$INSTDIR\guiserver\CodePatterns.html" 0
356 CreateShortCut "$SMPROGRAMS\newLISP\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
357 CreateShortCut "$SMPROGRAMS\newLISP\newLISP-GS.lnk" "$INSTDIR\guiserver.jar" "47011 newlisp-edit.lsp /local/newLISP128.png" "$INSTDIR\newlisp-win.ico" 0
358 CreateShortCut "$DESKTOP\newLISP-GS.lnk" "$INSTDIR\guiserver.jar" "47011 newlisp-edit.lsp /local/newLISP128.png" "$INSTDIR\newlisp-win.ico" 0
360 SectionEnd ; end the section
362 Section "Add to path"
369 UninstallText "This will uninstall newLISP. Hit next to continue."
371 ; special uninstall section.
374 ; remove registry keys
375 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\newLISP"
376 DeleteRegKey HKLM SOFTWARE\newLISP
379 Delete $INSTDIR\newlisp.exe
380 Delete $INSTDIR\newlisp.dll
381 Delete $INSTDIR\util\httpd-conf.lsp
382 Delete $INSTDIR\util\link.lsp
383 Delete $INSTDIR\util\newlispdoc
384 Delete $INSTDIR\util\newlisp.vim
385 Delete $INSTDIR\util\syntax.cgi
386 Delete $INSTDIR\md5-checksums.txt
387 Delete $INSTDIR\newlisp_manual.html
388 Delete $INSTDIR\newlisp_index.html
389 Delete $INSTDIR\manual_frame.html
390 Delete $INSTDIR\CodePatterns.html
391 Delete $INSTDIR\newLISPdoc.html
392 Delete $INSTDIR\newLISP-9.3-Release.html
393 Delete $INSTDIR\COPYING
394 Delete $INSTDIR\newlisp.vim
395 Delete $INSTDIR\httpd-conf.lsp
396 Delete $INSTDIR\guiserver.lsp
397 Delete $INSTDIR\guiserver.jar
398 Delete $INSTDIR\newlisp-edit.lsp
399 Delete $INSTDIR\newlisp-win.ico
401 Delete $INSTDIR\guiserver\index.html
402 Delete $INSTDIR\guiserver\guiserver.lsp.html
403 Delete $INSTDIR\guiserver\allfonts-demo.lsp
404 Delete $INSTDIR\guiserver\animation-demo.lsp
405 Delete $INSTDIR\guiserver\border-layout-demo.lsp
406 Delete $INSTDIR\guiserver\button-demo.lsp
407 Delete $INSTDIR\guiserver\clipboard-demo.lsp
408 Delete $INSTDIR\guiserver\cursor-demo.lsp
409 Delete $INSTDIR\guiserver\drag-demo.lsp
410 Delete $INSTDIR\guiserver\font-demo.lsp
411 Delete $INSTDIR\guiserver\frameless-demo.lsp
412 Delete $INSTDIR\guiserver\html-demo.lsp
413 Delete $INSTDIR\guiserver\image-demo.lsp
414 Delete $INSTDIR\guiserver\mouse-demo.lsp
415 Delete $INSTDIR\guiserver\move-resize-demo.lsp
416 Delete $INSTDIR\guiserver\pinballs-demo.lsp
417 Delete $INSTDIR\guiserver\properties-demo.lsp
418 Delete $INSTDIR\guiserver\rotation-demo.lsp
419 Delete $INSTDIR\guiserver\shapes-demo.lsp
420 Delete $INSTDIR\guiserver\sound-demo.lsp
421 Delete $INSTDIR\guiserver\stroke-demo.lsp
422 Delete $INSTDIR\guiserver\tabs-demo.lsp
423 Delete $INSTDIR\guiserver\textrot-demo.lsp
424 Delete $INSTDIR\guiserver\widgets-demo.lsp
425 Delete $INSTDIR\guiserver\word-count.lsp
426 Delete $INSTDIR\guiserver\uppercase.lsp
428 Delete $INSTDIR\modules\cgi.lsp
429 Delete $INSTDIR\modules\crypto.lsp
430 Delete $INSTDIR\modules\ftp.lsp
431 Delete $INSTDIR\modules\gmp.lsp
432 Delete $INSTDIR\modules\infix.lsp
433 Delete $INSTDIR\modules\mysql.lsp
434 Delete $INSTDIR\modules\mysql5.lsp
435 Delete $INSTDIR\modules\odbc.lsp
436 Delete $INSTDIR\modules\pop3.lsp
437 Delete $INSTDIR\modules\postscript.lsp
438 Delete $INSTDIR\modules\smtp.lsp
439 Delete $INSTDIR\modules\sqlite3.lsp
440 Delete $INSTDIR\modules\stat.lsp
441 Delete $INSTDIR\modules\unix.lsp
442 Delete $INSTDIR\modules\xmlrpc-client.lsp
443 Delete $INSTDIR\modules\zlib.lsp
444 ; remove start menu entries
445 Delete "$DESKTOP\newLISP-GS.lnk"
446 Delete "$SMPROGRAMS\newLISP-GS.lnk"
447 Delete "$SMPROGRAMS\newLISP\*.*"
448 RMDir "$SMPROGRAMS\newLISP"
450 ; remove uninstaller, links and install dir
451 Delete $INSTDIR\uninstall.exe
452 RMDir "$INSTDIR\guiserver"
453 RMDir "$INSTDIR\modules"
454 RMDir "$INSTDIR\util"
458 Call un.RemoveFromPath