1 ; =====================================================
2 ; mono.nsi - Mono Setup wizard for windows
3 ; =====================================================
5 ; (C) Copyright 2003 by Johannes Roith
6 ; (C) Copyright 2003 by Daniel Morgan
9 ; Johannes Roith <johannes@jroith.de>
10 ; Daniel Morgan <danmorg@sc.rr.com>
12 ; This .nsi includes code from the NSIS Archives:
13 ; function StrReplace and VersionCheck
15 ; HendriAdriaens@hotmail.com
17 ; =====================================================
19 ; This script can build a binary setup wizard of mono.
20 ; It is released under the GNU GPL.
22 ; =====================================================
23 ; SET MILESTONE & SOURCE DIR
24 ; =====================================================
27 ; !define MILESTONE "0.26" ;
28 ; !define SOURCE_INSTALL_DIR "/usr/monodist\\*" ;
30 ; =====================================================
32 ; =====================================================
36 ; This adds a Mono-specific Image on the left
37 ; You can choose between the light or dark one.
39 ; If you wish no mono-specifi logo, please outcomment
44 ; !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"
45 !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"
47 ; =====================================================
49 ; =====================================================
51 ; 1. Build mono to a clean directory prefix.
53 ; 2. In your install directory, delete the *.a files.
54 ; Most people won't need them and it saves ~ 4 MB.
56 ; 3. Type "make win32setup"
58 ; 4. The output file is mono-[MILESTONE]-win32-1.exe
64 ; =====================================================
65 ; MONO & REGISTRY / DETECTING MONO
66 ; =====================================================
69 ; This setup creates several Registry Keys:
71 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
72 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot
73 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory
74 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir
76 ; =====================================================
78 ; To get the current Mono Install Directory:
81 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
83 ; =====================================================
85 ; To get the current Mono assembly Directory:
88 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
90 ; =====================================================
92 ; =====================================================
95 ; =====================================================
96 ; GENERAL SETTING - NEED NOT TO BE CHANGED
97 ; =====================================================
100 !define TARGET_INSTALL_DIR "$PROGRAMFILES\Mono-${MILESTONE}" ;
101 !define OUTFILE "mono-${MILESTONE}-win32-1.exe" ;
103 ; =====================================================
105 ; =====================================================
107 !define MUI_PRODUCT "${NAME}"
108 !define MUI_VERSION "${MILESTONE}"
109 !define FULLNAME "${MUI_PRODUCT} ${MUI_VERSION}"
110 !define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"
111 !define MUI_ICON "${NSISDIR}\Contrib\Icons\setup.ico"
112 !define MUI_UNICON "${NSISDIR}\Contrib\Icons\normal-uninstall.ico"
113 !define MUI_WELCOMEPAGE
114 !define MUI_DIRECTORYPAGE
115 !define MUI_DIRECTORYSELECTIONPAGE
116 !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
117 !insertmacro MUI_SYSTEM
118 !insertmacro MUI_LANGUAGE "ENGLISH"
122 InstallDir "${TARGET_INSTALL_DIR}"
125 ;========================
127 ;========================
131 MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
133 Delete $INSTDIR\Uninst.exe ; delete Uninstaller
134 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List
136 MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
140 DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}
142 ; If the Default-Key is the current Milestone, we just remove the wrappers
144 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
145 StrCmp $0 ${MILESTONE} DeleteWrappers
147 MessageBox MB_YESNO "Mono ${MILESTONE} has been removed, but the default installation of Mono differs form this version. Should the wrappers and the Mono registry key be still be removed? This could disable other Mono installations." IDNO GoNext2
153 DeleteRegKey HKLM SOFTWARE\Mono
154 Delete $WINDIR\monobasepath.bat
155 Delete $WINDIR\mcs.bat
156 Delete $WINDIR\mbas.bat
157 Delete $WINDIR\mint.bat
158 Delete $WINDIR\mono.bat
159 Delete $WINDIR\monodis.bat
160 Delete $WINDIR\monoilasm.bat
161 Delete $WINDIR\sqlsharp.bat
162 Delete $WINDIR\secutil.bat
163 Delete $WINDIR\cert2spc.bat
164 Delete $WINDIR\monoresgen.bat
165 Delete $WINDIR\monosn.bat
166 Delete $WINDIR\cilc.bat
176 ; Warn people if a newer Mono is already installed
178 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
183 StrCmp $0 0 NoAskInstall
184 StrCmp $0 2 NoAskInstall
185 MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
190 File /r "${SOURCE_INSTALL_DIR}"
191 WriteUninstaller Uninst.exe
193 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR
194 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib
195 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc\mono
196 ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
197 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}
199 ; Mono Uninstall Entry in Windows Software List in the Control panel
200 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"
201 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe
203 ;original string is like C:\mono-0.20\install
206 Push "\" ;search for this string
207 Push "/" ;replace with this string
209 ;resulting string which is like C:/mono-0.20/install
212 ;========================
213 ; Write the wrapper files
214 ;========================
216 ; create bin/mono wrapper to be used if the user has cygwin
217 FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"
218 FileWrite $0 "#!/bin/sh$\r$\n"
219 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
220 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
221 FileWrite $0 '$6/bin/mono.exe "$$@"'
224 ; create bin/mint wrapper to be used if the user has cygwin
225 FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"
226 FileWrite $0 "#!/bin/sh$\r$\n"
227 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
228 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
229 FileWrite $0 '$6/bin/mint.exe "$$@"'
232 ; create bin/mcs wrapper to be used if the user has cygwin
233 FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"
234 FileWrite $0 "#!/bin/sh$\r$\n"
235 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
236 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
237 FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'
240 ; create bin/mbas wrapper to be used if the user has cygwin
241 FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"
242 FileWrite $0 "#!/bin/sh$\r$\n"
243 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
244 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
245 FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'
248 ; create bin/sqlsharp wrapper to be used if the user has cygwin
249 FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"
250 FileWrite $0 "#!/bin/sh$\r$\n"
251 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
252 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
253 FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'
256 ; create bin/monodis wrapper to be used if the user has cygwin
257 FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"
258 FileWrite $0 "#!/bin/sh$\r$\n"
259 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
260 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
261 FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'
264 ; create bin/monoresgen wrapper to be used if the user has cygwin
265 FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"
266 FileWrite $0 "#!/bin/sh$\r$\n"
267 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
268 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
269 FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'
272 ; create bin/monoilasm wrapper to be used if the user has cygwin
273 FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"
274 FileWrite $0 "#!/bin/sh$\r$\n"
275 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
276 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
277 FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'
280 ; create bin/monosn wrapper to be used if the user has cygwin
281 FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"
282 FileWrite $0 "#!/bin/sh$\r$\n"
283 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
284 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
285 FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'
288 ; create bin/secutil wrapper to be used if the user has cygwin
289 FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"
290 FileWrite $0 "#!/bin/sh$\r$\n"
291 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
292 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
293 FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'
296 ; create bin/cert2spc wrapper to be used if the user has cygwin
297 FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"
298 FileWrite $0 "#!/bin/sh$\r$\n"
299 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
300 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
301 FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'
304 ; create bin/cilc wrapper to be used if the user has cygwin
305 FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"
306 FileWrite $0 "#!/bin/sh$\r$\n"
307 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
308 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
309 FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'
313 ; These wrappers are copied to the windows directory.
316 ;========================
317 ; Write the path file
318 ;========================
320 FileOpen $0 "$WINDIR\monobasepath.bat" "w"
321 FileWrite $0 'set MONO_BASEPATH="$INSTDIR"$\r$\n'
322 FileWrite $0 'set MONO_PATH=$INSTDIR\lib$\r$\n'
323 FileWrite $0 'set MONO_CFG_DIR="$INSTDIR\etc\mono"'
327 ;========================
329 ;========================
331 FileOpen $0 "$WINDIR\mcs.bat" "w"
333 FileWrite $0 "@echo off$\r$\n"
334 FileWrite $0 "call monobasepath.bat$\r$\n"
335 FileWrite $0 "set MONOARGS=$\r$\n"
336 FileWrite $0 ":loop$\r$\n"
337 FileWrite $0 "if x%1 == x goto :done$\r$\n"
338 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
339 FileWrite $0 "shift$\r$\n"
340 FileWrite $0 "goto loop$\r$\n"
341 FileWrite $0 ":done$\r$\n"
342 FileWrite $0 "setlocal$\r$\n"
343 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
344 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mcs.exe" %MONOARGS%$\r$\n'
345 FileWrite $0 "endlocal$\r$\n"
349 ;========================
350 ; Write the mbas file
351 ;========================
353 FileOpen $0 "$WINDIR\mbas.bat" "w"
355 FileWrite $0 "@echo off$\r$\n"
356 FileWrite $0 "call monobasepath.bat$\r$\n"
357 FileWrite $0 "set MONOARGS=$\r$\n"
358 FileWrite $0 ":loop$\r$\n"
359 FileWrite $0 "if x%1 == x goto :done$\r$\n"
360 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
361 FileWrite $0 "shift$\r$\n"
362 FileWrite $0 "goto loop$\r$\n"
363 FileWrite $0 ":done$\r$\n"
364 FileWrite $0 "setlocal$\r$\n"
365 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
366 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mbas.exe" %MONOARGS%$\r$\n'
367 FileWrite $0 "endlocal$\r$\n"
371 ;========================
372 ; Write the mint file
373 ;========================
375 FileOpen $0 "$WINDIR\mint.bat" "w"
377 FileWrite $0 "@echo off$\r$\n"
378 FileWrite $0 "call monobasepath.bat$\r$\n"
379 FileWrite $0 "set MONOARGS=$\r$\n"
380 FileWrite $0 ":loop$\r$\n"
381 FileWrite $0 "if x%1 == x goto :done$\r$\n"
382 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
383 FileWrite $0 "shift$\r$\n"
384 FileWrite $0 "goto loop$\r$\n"
385 FileWrite $0 ":done$\r$\n"
386 FileWrite $0 "setlocal$\r$\n"
387 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
388 FileWrite $0 '"$INSTDIR\bin\mint.exe" %MONOARGS%$\r$\n'
389 FileWrite $0 "endlocal$\r$\n"
393 ;========================
394 ; Write the mono file
395 ;========================
397 FileOpen $0 "$WINDIR\mono.bat" "w"
399 FileWrite $0 "@echo off$\r$\n"
400 FileWrite $0 "call monobasepath.bat$\r$\n"
401 FileWrite $0 "set MONOARGS=$\r$\n"
402 FileWrite $0 ":loop$\r$\n"
403 FileWrite $0 "if x%1 == x goto :done$\r$\n"
404 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
405 FileWrite $0 "shift$\r$\n"
406 FileWrite $0 "goto loop$\r$\n"
407 FileWrite $0 ":done$\r$\n"
408 FileWrite $0 "setlocal$\r$\n"
409 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
410 FileWrite $0 '"$INSTDIR\bin\mono.exe" %MONOARGS%$\r$\n'
411 FileWrite $0 "endlocal$\r$\n"
414 ;========================
416 ;========================
418 FileOpen $0 "$WINDIR\monodis.bat" "w"
420 FileWrite $0 "@echo off$\r$\n"
421 FileWrite $0 "call monobasepath.bat$\r$\n"
422 FileWrite $0 "set MONOARGS=$\r$\n"
423 FileWrite $0 ":loop$\r$\n"
424 FileWrite $0 "if x%1 == x goto :done$\r$\n"
425 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
426 FileWrite $0 "shift$\r$\n"
427 FileWrite $0 "goto loop$\r$\n"
428 FileWrite $0 ":done$\r$\n"
429 FileWrite $0 "setlocal$\r$\n"
430 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
431 FileWrite $0 '"$INSTDIR\bin\monodis.exe" %MONOARGS%$\r$\n'
432 FileWrite $0 "endlocal$\r$\n"
436 ;========================
438 ;========================
440 FileOpen $0 "$WINDIR\monoilasm.bat" "w"
442 FileWrite $0 "@echo off$\r$\n"
443 FileWrite $0 "call monobasepath.bat$\r$\n"
444 FileWrite $0 "set MONOARGS=$\r$\n"
445 FileWrite $0 ":loop$\r$\n"
446 FileWrite $0 "if x%1 == x goto :done$\r$\n"
447 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
448 FileWrite $0 "shift$\r$\n"
449 FileWrite $0 "goto loop$\r$\n"
450 FileWrite $0 ":done$\r$\n"
451 FileWrite $0 "setlocal$\r$\n"
452 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
453 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoilasm.exe" %MONOARGS%$\r$\n'
454 FileWrite $0 "endlocal$\r$\n"
459 ;========================
460 ; Write the sqlsharp file
461 ;========================
463 FileOpen $0 "$WINDIR\sqlsharp.bat" "w"
465 FileWrite $0 "@echo off$\r$\n"
466 FileWrite $0 "call monobasepath.bat$\r$\n"
467 FileWrite $0 "set MONOARGS=$\r$\n"
468 FileWrite $0 ":loop$\r$\n"
469 FileWrite $0 "if x%1 == x goto :done$\r$\n"
470 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
471 FileWrite $0 "shift$\r$\n"
472 FileWrite $0 "goto loop$\r$\n"
473 FileWrite $0 ":done$\r$\n"
474 FileWrite $0 "setlocal$\r$\n"
475 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
476 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\sqlsharp.exe" %MONOARGS%$\r$\n'
477 FileWrite $0 "endlocal$\r$\n"
481 ;========================
482 ; Write the secutil file
483 ;========================
485 FileOpen $0 "$WINDIR\secutil.bat" "w"
487 FileWrite $0 "@echo off$\r$\n"
488 FileWrite $0 "call monobasepath.bat$\r$\n"
489 FileWrite $0 "set MONOARGS=$\r$\n"
490 FileWrite $0 ":loop$\r$\n"
491 FileWrite $0 "if x%1 == x goto :done$\r$\n"
492 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
493 FileWrite $0 "shift$\r$\n"
494 FileWrite $0 "goto loop$\r$\n"
495 FileWrite $0 ":done$\r$\n"
496 FileWrite $0 "setlocal$\r$\n"
497 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
498 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\secutil.exe" %MONOARGS%$\r$\n'
499 FileWrite $0 "endlocal$\r$\n"
503 ;========================
504 ; Write the cert2spc file
505 ;========================
507 FileOpen $0 "$WINDIR\cert2spc.bat" "w"
509 FileWrite $0 "@echo off$\r$\n"
510 FileWrite $0 "call monobasepath.bat$\r$\n"
511 FileWrite $0 "set MONOARGS=$\r$\n"
512 FileWrite $0 ":loop$\r$\n"
513 FileWrite $0 "if x%1 == x goto :done$\r$\n"
514 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
515 FileWrite $0 "shift$\r$\n"
516 FileWrite $0 "goto loop$\r$\n"
517 FileWrite $0 ":done$\r$\n"
518 FileWrite $0 "setlocal$\r$\n"
519 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
520 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cert2spec.exe" %MONOARGS%$\r$\n'
521 FileWrite $0 "endlocal$\r$\n"
526 ;========================
527 ; Write the monoresgen file
528 ;========================
530 FileOpen $0 "$WINDIR\monoresgen.bat" "w"
532 FileWrite $0 "@echo off$\r$\n"
533 FileWrite $0 "call monobasepath.bat$\r$\n"
534 FileWrite $0 "set MONOARGS=$\r$\n"
535 FileWrite $0 ":loop$\r$\n"
536 FileWrite $0 "if x%1 == x goto :done$\r$\n"
537 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
538 FileWrite $0 "shift$\r$\n"
539 FileWrite $0 "goto loop$\r$\n"
540 FileWrite $0 ":done$\r$\n"
541 FileWrite $0 "setlocal$\r$\n"
542 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
543 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoresgen.exe" %MONOARGS%$\r$\n'
544 FileWrite $0 "endlocal$\r$\n"
548 ;========================
549 ; Write the monosn file
550 ;========================
552 FileOpen $0 "$WINDIR\monosn.bat" "w"
554 FileWrite $0 "@echo off$\r$\n"
555 FileWrite $0 "call monobasepath.bat$\r$\n"
556 FileWrite $0 "set MONOARGS=$\r$\n"
557 FileWrite $0 ":loop$\r$\n"
558 FileWrite $0 "if x%1 == x goto :done$\r$\n"
559 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
560 FileWrite $0 "shift$\r$\n"
561 FileWrite $0 "goto loop$\r$\n"
562 FileWrite $0 ":done$\r$\n"
563 FileWrite $0 "setlocal$\r$\n"
564 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
565 FileWrite $0 '"$INSTDIR\bin\monosn.exe" %MONOARGS%$\r$\n'
566 FileWrite $0 "endlocal$\r$\n"
570 ;========================
571 ; Write the cilc file
572 ;========================
574 FileOpen $0 "$WINDIR\cilc.bat" "w"
577 FileWrite $0 "@echo off$\r$\n"
578 FileWrite $0 "call monobasepath.bat$\r$\n"
579 FileWrite $0 "set MONOARGS=$\r$\n"
580 FileWrite $0 ":loop$\r$\n"
581 FileWrite $0 "if x%1 == x goto :done$\r$\n"
582 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
583 FileWrite $0 "shift$\r$\n"
584 FileWrite $0 "goto loop$\r$\n"
585 FileWrite $0 ":done$\r$\n"
586 FileWrite $0 "setlocal$\r$\n"
587 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
588 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cilc.exe" %MONOARGS%$\r$\n'
589 FileWrite $0 "endlocal$\r$\n"
596 ; function StrReplace
598 ; HendriAdriaens@hotmail.com
599 ; found in the NSIS Archives
601 Exch $0 ;this will replace wrong characters
603 Exch $1 ;needs to be replaced
606 Exch $2 ;the orginal string
608 Push $4 ;temp character
610 Push $6 ;length of string that need to be replaced
611 Push $7 ;length of string that will replace
622 StrCmp $4 "" ExitLoop
647 Function VersionCheck
648 Exch $0 ;second versionnumber
650 Exch $1 ;first versionnumber
651 Push $R0 ;counter for $0
652 Push $R1 ;counter for $1
654 Push $4 ;temp string for $0
655 Push $5 ;temp string for $1
663 StrCmp $3 "" DotFound0
664 StrCmp $3 "." DotFound0
672 StrCmp $3 "" DotFound1
673 StrCmp $3 "." DotFound1
681 StrCmp $5 "" Ver2More
682 IntCmp $4 $5 Start Ver2Less Ver2More