1 ; =====================================================
\r
2 ; mono.nsi - Mono Setup wizard for windows
\r
3 ; =====================================================
\r
5 ; (C) Copyright 2003 by Johannes Roith
\r
6 ; (C) Copyright 2003 by Daniel Morgan
\r
9 ; Johannes Roith <johannes@jroith.de>
\r
10 ; Daniel Morgan <danmorg@sc.rr.com>
\r
12 ; This .nsi includes code from the NSIS Archives:
\r
13 ; function StrReplace and VersionCheck
\r
14 ; by Hendri Adriaens
\r
15 ; HendriAdriaens@hotmail.com
\r
17 ; =====================================================
\r
19 ; This script can build a binary setup wizard of mono.
\r
20 ; It is released under the GNU GPL.
\r
22 ; =====================================================
\r
23 ; SET MILESTONE & SOURCE DIR
\r
24 ; =====================================================
\r
27 !define MILESTONE "0.23" ;
\r
28 !define SOURCE_INSTALL_DIR "c:\mono-0.23-setup\install\\*" ;
\r
30 ; =====================================================
\r
32 ; =====================================================
\r
36 ; This adds a Mono-specific Image on the left
\r
37 ; You can choose between the light or dark one.
\r
39 ; If you wish no mono-specifi logo, please outcomment
\r
42 ; "light" is enabled.
\r
44 ; !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"
\r
45 !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"
\r
47 ; =====================================================
\r
49 ; =====================================================
\r
51 ; 1. Build mono. The install directory must not contain
\r
52 ; anything else - everything gets packed in!!!
\r
54 ; 2. In your install directory, delete the *.a files.
\r
55 ; Most people won't need them and it saves ~ 4 MB.
\r
57 ; 3. Get latest nsis from cvs or a development snapshot
\r
58 ; from http://nsis.sf.net
\r
60 ; 4. Adapt the MILESTONE
\r
62 ; 5. Adapt the SOURCE_INSTALL_DIR above to match your
\r
63 ; install directory. Do not remove \\* at the end!!
\r
65 ; 6. Open this script in makensisw.exe
\r
67 ; 7. The output file is mono-[MILESTONE]-win32-1.exe
\r
73 ; =====================================================
\r
74 ; MONO & REGISTRY / DETECTING MONO
\r
75 ; =====================================================
\r
78 ; This setup creates several Registry Keys:
\r
80 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
\r
81 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot
\r
82 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory
\r
83 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir
\r
85 ; =====================================================
\r
87 ; To get the current Mono Install Directory:
\r
90 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
\r
92 ; =====================================================
\r
94 ; To get the current Mono assembly Directory:
\r
97 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
\r
99 ; =====================================================
\r
100 ; Do not edit below
\r
101 ; =====================================================
\r
104 ; =====================================================
\r
105 ; GENERAL SETTING - NEED NOT TO BE CHANGED
\r
106 ; =====================================================
\r
108 !define NAME "Mono" ;
\r
109 !define TARGET_INSTALL_DIR "c:\mono-${MILESTONE}" ;
\r
110 !define OUTFILE "mono-${MILESTONE}-win32-1.exe" ;
\r
112 ; =====================================================
\r
114 ; =====================================================
\r
116 !define MUI_PRODUCT "${NAME}"
\r
117 !define MUI_VERSION "${MILESTONE}"
\r
118 !define FULLNAME "${MUI_PRODUCT} ${MUI_VERSION}"
\r
119 !define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"
\r
120 !define MUI_ICON "${NSISDIR}\Contrib\Icons\setup.ico"
\r
121 !define MUI_UNICON "${NSISDIR}\Contrib\Icons\normal-uninstall.ico"
\r
122 !define MUI_WELCOMEPAGE
\r
123 !define MUI_DIRECTORYPAGE
\r
124 !define MUI_DIRECTORYSELECTIONPAGE
\r
125 !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
\r
126 !insertmacro MUI_SYSTEM
\r
127 !insertmacro MUI_LANGUAGE "ENGLISH"
\r
130 OutFile "${OUTFILE}"
\r
131 InstallDir "${TARGET_INSTALL_DIR}"
\r
134 ;========================
\r
136 ;========================
\r
138 Section "Uninstall"
\r
140 MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
\r
142 Delete $INSTDIR\Uninst.exe ; delete Uninstaller
\r
143 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List
\r
145 MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
\r
149 DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}
\r
150 MessageBox MB_YESNO "Mono ${MILESTONE} has been removed. Should the wrappers and the Mono registry key be removed also? This could disable other Mono installations as well, but will remove Mono ${MILESTONE} 100%." IDNO GoNext2
\r
152 ; Complete Uninstall
\r
154 DeleteRegKey HKLM SOFTWARE\Mono
\r
155 Delete $WINDIR\monobasepath.bat
\r
156 Delete $WINDIR\mcs.bat
\r
157 Delete $WINDIR\mbas.bat
\r
158 Delete $WINDIR\mint.bat
\r
159 Delete $WINDIR\mono.bat
\r
160 Delete $WINDIR\monodis.bat
\r
161 Delete $WINDIR\monoilasm.bat
\r
162 Delete $WINDIR\sqlsharp.bat
\r
163 Delete $WINDIR\secutil.bat
\r
164 Delete $WINDIR\cert2spc.bat
\r
165 Delete $WINDIR\monoresgen.bat
\r
166 Delete $WINDIR\monosn.bat
\r
176 ; Warn people if a newer Mono is already installed
\r
178 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
\r
183 StrCmp $0 0 NoAskInstall
\r
184 StrCmp $0 2 NoAskInstall
\r
185 MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
\r
189 SetOutPath $INSTDIR
\r
190 File /r "${SOURCE_INSTALL_DIR}"
\r
191 WriteUninstaller Uninst.exe
\r
193 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR
\r
194 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib
\r
195 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc\mono
\r
196 ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
\r
197 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}
\r
199 ; Mono Uninstall Entry in Windows Software List in the Control panel
\r
200 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"
\r
201 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe
\r
203 ;original string is like C:\mono-0.20\install
\r
204 StrCpy $5 $INSTDIR
\r
206 Push "\" ;search for this string
\r
207 Push "/" ;replace with this string
\r
209 ;resulting string which is like C:/mono-0.20/install
\r
212 ;========================
\r
213 ; Write the wrapper files
\r
214 ;========================
\r
216 ; create bin/mono wrapper to be used if the user has cygwin
\r
217 FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"
\r
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
\r
225 FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"
\r
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
\r
233 FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"
\r
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
\r
241 FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"
\r
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
\r
249 FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"
\r
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
\r
257 FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"
\r
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
\r
265 FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"
\r
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
\r
273 FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"
\r
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
\r
281 FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"
\r
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
\r
289 FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"
\r
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
\r
297 FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"
\r
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 "$$@"'
305 ; These wrappers are copied to the windows directory.
\r
308 ;========================
\r
309 ; Write the path file
\r
310 ;========================
\r
312 FileOpen $0 "$WINDIR\monobasepath.bat" "w"
\r
313 FileWrite $0 "set MONO_BASEPATH=$INSTDIR$\r$\n"
\r
314 FileWrite $0 "set MONO_PATH=%MONO_BASEPATH%\lib$\r$\n"
\r
315 FileWrite $0 "set MONO_CFG_DIR=%MONO_BASEPATH%\etc\mono"
\r
319 ;========================
\r
320 ; Write the mcs file
\r
321 ;========================
\r
323 FileOpen $0 "$WINDIR\mcs.bat" "w"
\r
325 FileWrite $0 "@echo off$\r$\n"
\r
326 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
327 FileWrite $0 "set MONOARGS=$\r$\n"
\r
328 FileWrite $0 ":loop$\r$\n"
\r
329 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
330 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
331 FileWrite $0 "shift$\r$\n"
\r
332 FileWrite $0 "goto loop$\r$\n"
\r
333 FileWrite $0 ":done$\r$\n"
\r
334 FileWrite $0 "setlocal$\r$\n"
\r
335 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
336 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\mcs.exe %MONOARGS%$\r$\n"
\r
337 FileWrite $0 "endlocal$\r$\n"
\r
341 ;========================
\r
342 ; Write the mbas file
\r
343 ;========================
\r
345 FileOpen $0 "$WINDIR\mbas.bat" "w"
\r
347 FileWrite $0 "@echo off$\r$\n"
\r
348 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
349 FileWrite $0 "set MONOARGS=$\r$\n"
\r
350 FileWrite $0 ":loop$\r$\n"
\r
351 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
352 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
353 FileWrite $0 "shift$\r$\n"
\r
354 FileWrite $0 "goto loop$\r$\n"
\r
355 FileWrite $0 ":done$\r$\n"
\r
356 FileWrite $0 "setlocal$\r$\n"
\r
357 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
358 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\mbas.exe %MONOARGS%$\r$\n"
\r
359 FileWrite $0 "endlocal$\r$\n"
\r
363 ;========================
\r
364 ; Write the mint file
\r
365 ;========================
\r
367 FileOpen $0 "$WINDIR\mint.bat" "w"
\r
369 FileWrite $0 "@echo off$\r$\n"
\r
370 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
371 FileWrite $0 "set MONOARGS=$\r$\n"
\r
372 FileWrite $0 ":loop$\r$\n"
\r
373 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
374 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
375 FileWrite $0 "shift$\r$\n"
\r
376 FileWrite $0 "goto loop$\r$\n"
\r
377 FileWrite $0 ":done$\r$\n"
\r
378 FileWrite $0 "setlocal$\r$\n"
\r
379 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
380 FileWrite $0 "%MONO_BASEPATH%\bin\mint.exe %MONOARGS%$\r$\n"
\r
381 FileWrite $0 "endlocal$\r$\n"
\r
385 ;========================
\r
386 ; Write the mono file
\r
387 ;========================
\r
389 FileOpen $0 "$WINDIR\mono.bat" "w"
\r
391 FileWrite $0 "@echo off$\r$\n"
\r
392 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
393 FileWrite $0 "set MONOARGS=$\r$\n"
\r
394 FileWrite $0 ":loop$\r$\n"
\r
395 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
396 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
397 FileWrite $0 "shift$\r$\n"
\r
398 FileWrite $0 "goto loop$\r$\n"
\r
399 FileWrite $0 ":done$\r$\n"
\r
400 FileWrite $0 "setlocal$\r$\n"
\r
401 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
402 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONOARGS%$\r$\n"
\r
403 FileWrite $0 "endlocal$\r$\n"
\r
407 ;========================
\r
409 ;========================
\r
411 FileOpen $0 "$WINDIR\monodis.bat" "w"
\r
413 FileWrite $0 "@echo off$\r$\n"
\r
414 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
415 FileWrite $0 "set MONOARGS=$\r$\n"
\r
416 FileWrite $0 ":loop$\r$\n"
\r
417 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
418 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
419 FileWrite $0 "shift$\r$\n"
\r
420 FileWrite $0 "goto loop$\r$\n"
\r
421 FileWrite $0 ":done$\r$\n"
\r
422 FileWrite $0 "setlocal$\r$\n"
\r
423 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
424 FileWrite $0 "%MONO_BASEPATH%\bin\monodis.exe %MONOARGS%$\r$\n"
\r
425 FileWrite $0 "endlocal$\r$\n"
\r
429 ;========================
\r
431 ;========================
\r
433 FileOpen $0 "$WINDIR\monoilasm.bat" "w"
\r
435 FileWrite $0 "@echo off$\r$\n"
\r
436 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
437 FileWrite $0 "set MONOARGS=$\r$\n"
\r
438 FileWrite $0 ":loop$\r$\n"
\r
439 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
440 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
441 FileWrite $0 "shift$\r$\n"
\r
442 FileWrite $0 "goto loop$\r$\n"
\r
443 FileWrite $0 ":done$\r$\n"
\r
444 FileWrite $0 "setlocal$\r$\n"
\r
445 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
446 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\monoilasm.exe %MONOARGS%$\r$\n"
\r
447 FileWrite $0 "endlocal$\r$\n"
\r
452 ;========================
\r
453 ; Write the sqlsharp file
\r
454 ;========================
\r
456 FileOpen $0 "$WINDIR\sqlsharp.bat" "w"
\r
458 FileWrite $0 "@echo off$\r$\n"
\r
459 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
460 FileWrite $0 "set MONOARGS=$\r$\n"
\r
461 FileWrite $0 ":loop$\r$\n"
\r
462 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
463 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
464 FileWrite $0 "shift$\r$\n"
\r
465 FileWrite $0 "goto loop$\r$\n"
\r
466 FileWrite $0 ":done$\r$\n"
\r
467 FileWrite $0 "setlocal$\r$\n"
\r
468 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
469 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\sqlsharp.exe %MONOARGS%$\r$\n"
\r
470 FileWrite $0 "endlocal$\r$\n"
\r
474 ;========================
\r
475 ; Write the secutil file
\r
476 ;========================
\r
478 FileOpen $0 "$WINDIR\secutil.bat" "w"
\r
480 FileWrite $0 "@echo off$\r$\n"
\r
481 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
482 FileWrite $0 "set MONOARGS=$\r$\n"
\r
483 FileWrite $0 ":loop$\r$\n"
\r
484 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
485 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
486 FileWrite $0 "shift$\r$\n"
\r
487 FileWrite $0 "goto loop$\r$\n"
\r
488 FileWrite $0 ":done$\r$\n"
\r
489 FileWrite $0 "setlocal$\r$\n"
\r
490 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
491 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\secutil.exe %MONOARGS%$\r$\n"
\r
492 FileWrite $0 "endlocal$\r$\n"
\r
496 ;========================
\r
497 ; Write the cert2spc file
\r
498 ;========================
\r
500 FileOpen $0 "$WINDIR\cert2spc.bat" "w"
\r
502 FileWrite $0 "@echo off$\r$\n"
\r
503 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
504 FileWrite $0 "set MONOARGS=$\r$\n"
\r
505 FileWrite $0 ":loop$\r$\n"
\r
506 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
507 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
508 FileWrite $0 "shift$\r$\n"
\r
509 FileWrite $0 "goto loop$\r$\n"
\r
510 FileWrite $0 ":done$\r$\n"
\r
511 FileWrite $0 "setlocal$\r$\n"
\r
512 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
513 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\cert2spc.exe %MONOARGS%$\r$\n"
\r
514 FileWrite $0 "endlocal$\r$\n"
\r
519 ;========================
\r
520 ; Write the monoresgen file
\r
521 ;========================
\r
523 FileOpen $0 "$WINDIR\monoresgen.bat" "w"
\r
525 FileWrite $0 "@echo off$\r$\n"
\r
526 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
527 FileWrite $0 "set MONOARGS=$\r$\n"
\r
528 FileWrite $0 ":loop$\r$\n"
\r
529 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
530 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
531 FileWrite $0 "shift$\r$\n"
\r
532 FileWrite $0 "goto loop$\r$\n"
\r
533 FileWrite $0 ":done$\r$\n"
\r
534 FileWrite $0 "setlocal$\r$\n"
\r
535 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
536 FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\monoresgen.exe %MONOARGS%$\r$\n"
\r
537 FileWrite $0 "endlocal$\r$\n"
\r
541 ;========================
\r
542 ; Write the monosn file
\r
543 ;========================
\r
545 FileOpen $0 "$WINDIR\monosn.bat" "w"
\r
547 FileWrite $0 "@echo off$\r$\n"
\r
548 FileWrite $0 "call monobasepath.bat$\r$\n"
\r
549 FileWrite $0 "set MONOARGS=$\r$\n"
\r
550 FileWrite $0 ":loop$\r$\n"
\r
551 FileWrite $0 "if x%1 == x goto :done$\r$\n"
\r
552 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
\r
553 FileWrite $0 "shift$\r$\n"
\r
554 FileWrite $0 "goto loop$\r$\n"
\r
555 FileWrite $0 ":done$\r$\n"
\r
556 FileWrite $0 "setlocal$\r$\n"
\r
557 FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'
\r
558 FileWrite $0 "%MONO_BASEPATH%\bin\monosn.exe %MONOARGS%$\r$\n"
\r
559 FileWrite $0 "endlocal$\r$\n"
\r
566 ; function StrReplace
\r
567 ; by Hendri Adriaens
\r
568 ; HendriAdriaens@hotmail.com
\r
569 ; found in the NSIS Archives
\r
570 function StrReplace
\r
571 Exch $0 ;this will replace wrong characters
\r
573 Exch $1 ;needs to be replaced
\r
576 Exch $2 ;the orginal string
\r
578 Push $4 ;temp character
\r
579 Push $5 ;temp string
\r
580 Push $6 ;length of string that need to be replaced
\r
581 Push $7 ;length of string that will replace
\r
582 Push $R0 ;tempstring
\r
583 Push $R1 ;tempstring
\r
584 Push $R2 ;tempstring
\r
592 StrCmp $4 "" ExitLoop
\r
593 StrCmp $4 $1 Replace
\r
598 StrCpy $R1 $2 "" $R2
\r
617 Function VersionCheck
\r
618 Exch $0 ;second versionnumber
\r
620 Exch $1 ;first versionnumber
\r
621 Push $R0 ;counter for $0
\r
622 Push $R1 ;counter for $1
\r
624 Push $4 ;temp string for $0
\r
625 Push $5 ;temp string for $1
\r
633 StrCmp $3 "" DotFound0
\r
634 StrCmp $3 "." DotFound0
\r
642 StrCmp $3 "" DotFound1
\r
643 StrCmp $3 "." DotFound1
\r
647 Strcmp $4 "" 0 Not4
\r
651 StrCmp $5 "" Ver2More
\r
652 IntCmp $4 $5 Start Ver2Less Ver2More
\r