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.24" ;
28 !define SOURCE_INSTALL_DIR
"c:\mono-0.23-setup\install\\*" ;
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. The install directory must not contain
52 ; anything else - everything gets packed in!!!
54 ; 2. In your install directory, delete the *.a files.
55 ; Most people won't need them and it saves ~ 4 MB.
57 ; 3. Get latest nsis from cvs or a development snapshot
58 ; from http://nsis.sf.net
60 ; 4. Adapt the MILESTONE
62 ; 5. Adapt the SOURCE_INSTALL_DIR above to match your
63 ; install directory. Do not remove \\* at the end!!
65 ; 6. Open this script in makensisw.exe
67 ; 7. The output file is mono-[MILESTONE]-win32-1.exe
73 ; =====================================================
74 ; MONO & REGISTRY / DETECTING MONO
75 ; =====================================================
78 ; This setup creates several Registry Keys:
80 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
81 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot
82 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory
83 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir
85 ; =====================================================
87 ; To get the current Mono Install Directory:
90 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
92 ; =====================================================
94 ; To get the current Mono assembly Directory:
97 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
99 ; =====================================================
101 ; =====================================================
104 ; =====================================================
105 ; GENERAL SETTING - NEED NOT TO BE CHANGED
106 ; =====================================================
108 !define NAME
"Mono" ;
109 !define TARGET_INSTALL_DIR
"$PROGRAMFILES\Mono-${MILESTONE}" ;
110 !define OUTFILE
"mono-${MILESTONE}-win32-1.exe" ;
112 ; =====================================================
114 ; =====================================================
116 !define MUI_PRODUCT
"${NAME}"
117 !define MUI_VERSION
"${MILESTONE}"
118 !define FULLNAME
"${MUI_PRODUCT} ${MUI_VERSION}"
119 !define MUI_UI
"${NSISDIR}\Contrib\UIs\modern2.exe"
120 !define MUI_ICON
"${NSISDIR}\Contrib\Icons\setup.ico"
121 !define MUI_UNICON
"${NSISDIR}\Contrib\Icons\normal-uninstall.ico"
122 !define MUI_WELCOMEPAGE
123 !define MUI_DIRECTORYPAGE
124 !define MUI_DIRECTORYSELECTIONPAGE
125 !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
126 !insertmacro MUI_SYSTEM
127 !insertmacro MUI_LANGUAGE
"ENGLISH"
131 InstallDir "${TARGET_INSTALL_DIR}"
134 ;========================
136 ;========================
140 MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
142 Delete $INSTDIR\Uninst
.exe
; delete Uninstaller
143 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono
-${MILESTONE} ; Remove Entry in Software List
145 MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
149 DeleteRegKey HKLM SOFTWARE\Mono\
${MILESTONE}
151 ; If the Default-Key is the current Milestone, we just remove the wrappers
153 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
154 StrCmp $0 ${MILESTONE} DeleteWrappers
156 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
162 DeleteRegKey HKLM SOFTWARE\Mono
163 Delete $WINDIR\monobasepath
.bat
164 Delete $WINDIR\mcs
.bat
165 Delete $WINDIR\mbas
.bat
166 Delete $WINDIR\mint
.bat
167 Delete $WINDIR\mono
.bat
168 Delete $WINDIR\monodis
.bat
169 Delete $WINDIR\monoilasm
.bat
170 Delete $WINDIR\sqlsharp
.bat
171 Delete $WINDIR\secutil
.bat
172 Delete $WINDIR\cert2spc
.bat
173 Delete $WINDIR\monoresgen
.bat
174 Delete $WINDIR\monosn
.bat
175 Delete $WINDIR\cilc
.bat
185 ; Warn people if a newer Mono is already installed
187 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
192 StrCmp $0 0 NoAskInstall
193 StrCmp $0 2 NoAskInstall
194 MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
199 File /r
"${SOURCE_INSTALL_DIR}"
200 WriteUninstaller Uninst
.exe
202 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\
${MILESTONE} SdkInstallRoot
$INSTDIR
203 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\
${MILESTONE} FrameworkAssemblyDirectory
$INSTDIR\lib
204 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\
${MILESTONE} MonoConfigDir
$INSTDIR\etc\mono
205 ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
206 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
${MILESTONE}
208 ; Mono Uninstall Entry in Windows Software List in the Control panel
209 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono
-${MILESTONE} DisplayName
"Mono ${MILESTONE}"
210 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono
-${MILESTONE} UninstallString
$INSTDIR\uninst
.exe
212 ;original string is like C:\mono-0.20\install
215 Push "\" ;search for this string
216 Push "/" ;replace with this string
218 ;resulting string which is like C:/mono-0.20/install
221 ;========================
222 ; Write the wrapper files
223 ;========================
225 ; create bin/mono wrapper to be used if the user has cygwin
226 FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"
227 FileWrite $0 "#!/bin/sh$\r$\n"
228 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
229 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
230 FileWrite $0 '$6/bin/mono.exe "$$@"'
233 ; create bin/mint wrapper to be used if the user has cygwin
234 FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"
235 FileWrite $0 "#!/bin/sh$\r$\n"
236 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
237 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
238 FileWrite $0 '$6/bin/mint.exe "$$@"'
241 ; create bin/mcs wrapper to be used if the user has cygwin
242 FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"
243 FileWrite $0 "#!/bin/sh$\r$\n"
244 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
245 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
246 FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'
249 ; create bin/mbas wrapper to be used if the user has cygwin
250 FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"
251 FileWrite $0 "#!/bin/sh$\r$\n"
252 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
253 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
254 FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'
257 ; create bin/sqlsharp wrapper to be used if the user has cygwin
258 FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"
259 FileWrite $0 "#!/bin/sh$\r$\n"
260 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
261 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
262 FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'
265 ; create bin/monodis wrapper to be used if the user has cygwin
266 FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"
267 FileWrite $0 "#!/bin/sh$\r$\n"
268 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
269 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
270 FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'
273 ; create bin/monoresgen wrapper to be used if the user has cygwin
274 FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"
275 FileWrite $0 "#!/bin/sh$\r$\n"
276 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
277 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
278 FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'
281 ; create bin/monoilasm wrapper to be used if the user has cygwin
282 FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"
283 FileWrite $0 "#!/bin/sh$\r$\n"
284 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
285 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
286 FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'
289 ; create bin/monosn wrapper to be used if the user has cygwin
290 FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"
291 FileWrite $0 "#!/bin/sh$\r$\n"
292 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
293 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
294 FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'
297 ; create bin/secutil wrapper to be used if the user has cygwin
298 FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"
299 FileWrite $0 "#!/bin/sh$\r$\n"
300 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
301 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
302 FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'
305 ; create bin/cert2spc wrapper to be used if the user has cygwin
306 FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"
307 FileWrite $0 "#!/bin/sh$\r$\n"
308 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
309 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
310 FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'
313 ; create bin/cilc wrapper to be used if the user has cygwin
314 FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"
315 FileWrite $0 "#!/bin/sh$\r$\n"
316 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
317 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
318 FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'
322 ; These wrappers are copied to the windows directory.
325 ;========================
326 ; Write the path file
327 ;========================
329 FileOpen $0 "$WINDIR\monobasepath.bat" "w"
330 FileWrite $0 'set MONO_BASEPATH="$INSTDIR"$\r$\n'
331 FileWrite $0 'set MONO_PATH=$INSTDIR\lib$\r$\n'
332 FileWrite $0 'set MONO_CFG_DIR="$INSTDIR\etc\mono"'
336 ;========================
338 ;========================
340 FileOpen $0 "$WINDIR\mcs.bat" "w"
342 FileWrite $0 "@echo off$\r$\n"
343 FileWrite $0 "call monobasepath.bat$\r$\n"
344 FileWrite $0 "set MONOARGS=$\r$\n"
345 FileWrite $0 ":loop$\r$\n"
346 FileWrite $0 "if x%1 == x goto :done$\r$\n"
347 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
348 FileWrite $0 "shift$\r$\n"
349 FileWrite $0 "goto loop$\r$\n"
350 FileWrite $0 ":done$\r$\n"
351 FileWrite $0 "setlocal$\r$\n"
352 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
353 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mcs.exe" %MONOARGS%$\r$\n'
354 FileWrite $0 "endlocal$\r$\n"
358 ;========================
359 ; Write the mbas file
360 ;========================
362 FileOpen $0 "$WINDIR\mbas.bat" "w"
364 FileWrite $0 "@echo off$\r$\n"
365 FileWrite $0 "call monobasepath.bat$\r$\n"
366 FileWrite $0 "set MONOARGS=$\r$\n"
367 FileWrite $0 ":loop$\r$\n"
368 FileWrite $0 "if x%1 == x goto :done$\r$\n"
369 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
370 FileWrite $0 "shift$\r$\n"
371 FileWrite $0 "goto loop$\r$\n"
372 FileWrite $0 ":done$\r$\n"
373 FileWrite $0 "setlocal$\r$\n"
374 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
375 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mbas.exe" %MONOARGS%$\r$\n'
376 FileWrite $0 "endlocal$\r$\n"
380 ;========================
381 ; Write the mint file
382 ;========================
384 FileOpen $0 "$WINDIR\mint.bat" "w"
386 FileWrite $0 "@echo off$\r$\n"
387 FileWrite $0 "call monobasepath.bat$\r$\n"
388 FileWrite $0 "set MONOARGS=$\r$\n"
389 FileWrite $0 ":loop$\r$\n"
390 FileWrite $0 "if x%1 == x goto :done$\r$\n"
391 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
392 FileWrite $0 "shift$\r$\n"
393 FileWrite $0 "goto loop$\r$\n"
394 FileWrite $0 ":done$\r$\n"
395 FileWrite $0 "setlocal$\r$\n"
396 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
397 FileWrite $0 '"$INSTDIR\bin\mint.exe" %MONOARGS%$\r$\n'
398 FileWrite $0 "endlocal$\r$\n"
402 ;========================
403 ; Write the mono file
404 ;========================
406 FileOpen $0 "$WINDIR\mono.bat" "w"
408 FileWrite $0 "@echo off$\r$\n"
409 FileWrite $0 "call monobasepath.bat$\r$\n"
410 FileWrite $0 "set MONOARGS=$\r$\n"
411 FileWrite $0 ":loop$\r$\n"
412 FileWrite $0 "if x%1 == x goto :done$\r$\n"
413 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
414 FileWrite $0 "shift$\r$\n"
415 FileWrite $0 "goto loop$\r$\n"
416 FileWrite $0 ":done$\r$\n"
417 FileWrite $0 "setlocal$\r$\n"
418 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
419 FileWrite $0 '"$INSTDIR\bin\mono.exe" %MONOARGS%$\r$\n'
420 FileWrite $0 "endlocal$\r$\n"
423 ;========================
425 ;========================
427 FileOpen $0 "$WINDIR\monodis.bat" "w"
429 FileWrite $0 "@echo off$\r$\n"
430 FileWrite $0 "call monobasepath.bat$\r$\n"
431 FileWrite $0 "set MONOARGS=$\r$\n"
432 FileWrite $0 ":loop$\r$\n"
433 FileWrite $0 "if x%1 == x goto :done$\r$\n"
434 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
435 FileWrite $0 "shift$\r$\n"
436 FileWrite $0 "goto loop$\r$\n"
437 FileWrite $0 ":done$\r$\n"
438 FileWrite $0 "setlocal$\r$\n"
439 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
440 FileWrite $0 '"$INSTDIR\bin\monodis.exe" %MONOARGS%$\r$\n'
441 FileWrite $0 "endlocal$\r$\n"
445 ;========================
447 ;========================
449 FileOpen $0 "$WINDIR\monoilasm.bat" "w"
451 FileWrite $0 "@echo off$\r$\n"
452 FileWrite $0 "call monobasepath.bat$\r$\n"
453 FileWrite $0 "set MONOARGS=$\r$\n"
454 FileWrite $0 ":loop$\r$\n"
455 FileWrite $0 "if x%1 == x goto :done$\r$\n"
456 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
457 FileWrite $0 "shift$\r$\n"
458 FileWrite $0 "goto loop$\r$\n"
459 FileWrite $0 ":done$\r$\n"
460 FileWrite $0 "setlocal$\r$\n"
461 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
462 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoilasm.exe" %MONOARGS%$\r$\n'
463 FileWrite $0 "endlocal$\r$\n"
468 ;========================
469 ; Write the sqlsharp file
470 ;========================
472 FileOpen $0 "$WINDIR\sqlsharp.bat" "w"
474 FileWrite $0 "@echo off$\r$\n"
475 FileWrite $0 "call monobasepath.bat$\r$\n"
476 FileWrite $0 "set MONOARGS=$\r$\n"
477 FileWrite $0 ":loop$\r$\n"
478 FileWrite $0 "if x%1 == x goto :done$\r$\n"
479 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
480 FileWrite $0 "shift$\r$\n"
481 FileWrite $0 "goto loop$\r$\n"
482 FileWrite $0 ":done$\r$\n"
483 FileWrite $0 "setlocal$\r$\n"
484 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
485 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\sqlsharp.exe" %MONOARGS%$\r$\n'
486 FileWrite $0 "endlocal$\r$\n"
490 ;========================
491 ; Write the secutil file
492 ;========================
494 FileOpen $0 "$WINDIR\secutil.bat" "w"
496 FileWrite $0 "@echo off$\r$\n"
497 FileWrite $0 "call monobasepath.bat$\r$\n"
498 FileWrite $0 "set MONOARGS=$\r$\n"
499 FileWrite $0 ":loop$\r$\n"
500 FileWrite $0 "if x%1 == x goto :done$\r$\n"
501 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
502 FileWrite $0 "shift$\r$\n"
503 FileWrite $0 "goto loop$\r$\n"
504 FileWrite $0 ":done$\r$\n"
505 FileWrite $0 "setlocal$\r$\n"
506 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
507 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\secutil.exe" %MONOARGS%$\r$\n'
508 FileWrite $0 "endlocal$\r$\n"
512 ;========================
513 ; Write the cert2spc file
514 ;========================
516 FileOpen $0 "$WINDIR\cert2spc.bat" "w"
518 FileWrite $0 "@echo off$\r$\n"
519 FileWrite $0 "call monobasepath.bat$\r$\n"
520 FileWrite $0 "set MONOARGS=$\r$\n"
521 FileWrite $0 ":loop$\r$\n"
522 FileWrite $0 "if x%1 == x goto :done$\r$\n"
523 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
524 FileWrite $0 "shift$\r$\n"
525 FileWrite $0 "goto loop$\r$\n"
526 FileWrite $0 ":done$\r$\n"
527 FileWrite $0 "setlocal$\r$\n"
528 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
529 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cert2spec.exe" %MONOARGS%$\r$\n'
530 FileWrite $0 "endlocal$\r$\n"
535 ;========================
536 ; Write the monoresgen file
537 ;========================
539 FileOpen $0 "$WINDIR\monoresgen.bat" "w"
541 FileWrite $0 "@echo off$\r$\n"
542 FileWrite $0 "call monobasepath.bat$\r$\n"
543 FileWrite $0 "set MONOARGS=$\r$\n"
544 FileWrite $0 ":loop$\r$\n"
545 FileWrite $0 "if x%1 == x goto :done$\r$\n"
546 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
547 FileWrite $0 "shift$\r$\n"
548 FileWrite $0 "goto loop$\r$\n"
549 FileWrite $0 ":done$\r$\n"
550 FileWrite $0 "setlocal$\r$\n"
551 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
552 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoresgen.exe" %MONOARGS%$\r$\n'
553 FileWrite $0 "endlocal$\r$\n"
557 ;========================
558 ; Write the monosn file
559 ;========================
561 FileOpen $0 "$WINDIR\monosn.bat" "w"
563 FileWrite $0 "@echo off$\r$\n"
564 FileWrite $0 "call monobasepath.bat$\r$\n"
565 FileWrite $0 "set MONOARGS=$\r$\n"
566 FileWrite $0 ":loop$\r$\n"
567 FileWrite $0 "if x%1 == x goto :done$\r$\n"
568 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
569 FileWrite $0 "shift$\r$\n"
570 FileWrite $0 "goto loop$\r$\n"
571 FileWrite $0 ":done$\r$\n"
572 FileWrite $0 "setlocal$\r$\n"
573 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
574 FileWrite $0 '"$INSTDIR\bin\monosn.exe" %MONOARGS%$\r$\n'
575 FileWrite $0 "endlocal$\r$\n"
579 ;========================
580 ; Write the cilc file
581 ;========================
583 FileOpen $0 "$WINDIR\cilc.bat" "w"
586 FileWrite $0 "@echo off$\r$\n"
587 FileWrite $0 "call monobasepath.bat$\r$\n"
588 FileWrite $0 "set MONOARGS=$\r$\n"
589 FileWrite $0 ":loop$\r$\n"
590 FileWrite $0 "if x%1 == x goto :done$\r$\n"
591 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
592 FileWrite $0 "shift$\r$\n"
593 FileWrite $0 "goto loop$\r$\n"
594 FileWrite $0 ":done$\r$\n"
595 FileWrite $0 "setlocal$\r$\n"
596 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
597 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cilc.exe" %MONOARGS%$\r$\n'
598 FileWrite $0 "endlocal$\r$\n"
605 ; function StrReplace
607 ; HendriAdriaens@hotmail.com
608 ; found in the NSIS Archives
610 Exch $0 ;this will replace wrong characters
612 Exch $1 ;needs to be replaced
615 Exch $2 ;the orginal string
617 Push $4 ;temp character
619 Push $6 ;length of string that need to be replaced
620 Push $7 ;length of string that will replace
631 StrCmp $4 "" ExitLoop
656 Function VersionCheck
657 Exch $0 ;second versionnumber
659 Exch $1 ;first versionnumber
660 Push $R0 ;counter for $0
661 Push $R1 ;counter for $1
663 Push $4 ;temp string for $0
664 Push $5 ;temp string for $1
672 StrCmp $3 "" DotFound0
673 StrCmp $3 "." DotFound0
681 StrCmp $3 "" DotFound1
682 StrCmp $3 "." DotFound1
690 StrCmp $5 "" Ver2More
691 IntCmp $4 $5 Start Ver2Less Ver2More