2004-03-01 Larry Ewing <lewing@ximian.com>
[mono-project.git] / monowiz.win32.nsi
blobbd016197618461712a918097d0e52003c9a59cb4
1 ; =================================================================
2 ; mono.nsi - This NSIS script creates Mono Setup wizard for Windows
4 ; Requires NSIS 2.0 (Nullsoft Scriptable Install System)
5 ; From http://nsis.sourceforge.net/site/index.php
6 ; =================================================================
8 ; (C) Copyright 2003 by Johannes Roith
9 ; (C) Copyright 2003, 2004 by Daniel Morgan
11 ; Authors:
12 ; Johannes Roith <johannes@jroith.de>
13 ; Daniel Morgan <danielmorgan@verizon.net>
15 ; This .nsi includes code from the NSIS Archives:
16 ; function StrReplace and VersionCheck
17 ; by Hendri Adriaens
18 ; HendriAdriaens@hotmail.com
20 ; =====================================================
22 ; This script can build a binary setup wizard of mono.
23 ; It is released under the GNU GPL.
25 ; =====================================================
26 ; SET MILESTONE & SOURCE DIR
27 ; =====================================================
28 ; set by makefile!!
30 !define MILESTONE 0.29
31 !define SOURCE_INSTALL_DIR E:\cygwin\home\danmorg\mono029\*.*
33 ; =====================================================
34 ; SET LOGO
35 ; =====================================================
37 ; Beautification:
39 ; This adds a Mono-specific Image on the left
40 ; You can choose between the light or dark one.
42 ; If you wish no mono-specifi logo, please outcomment
43 ; the lines.
45 ; "light" is enabled.
47 ; !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"
48 !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"
50 ; =====================================================
51 ; BUILDING
52 ; =====================================================
54 ; 1. Build mono to a clean directory prefix.
56 ; 2. In your install directory, delete the *.a files.
57 ; Most people won't need them and it saves ~ 4 MB.
59 ; 3. Type "make win32setup"
61 ; 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:
80 ; 1. Get DefaultCLR
81 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
83 ; =====================================================
85 ; To get the current Mono assembly Directory:
87 ; 1. Get DefaultCLR
88 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
90 ; =====================================================
91 ; Do not edit below
92 ; =====================================================
95 ; =====================================================
96 ; GENERAL SETTING - NEED NOT TO BE CHANGED
97 ; =====================================================
99 !define NAME "Mono"
100 !define TARGET_INSTALL_DIR "$PROGRAMFILES\Mono-${MILESTONE}"
101 !define OUTFILE mono-${MILESTONE}-win32-1.exe
103 Name ${NAME}
104 Caption "Mono ${MILESTONE} Setup"
106 !include "MUI.nsh"
107 !include "Sections.nsh"
109 SetCompressor lzma
110 SilentInstall normal
111 ShowInstDetails show
112 SetDateSave on
113 SetDatablockOptimize on
114 CRCCheck on
115 BGGradient 000000 800000 FFFFFF
116 InstallColors FF8080 000030
117 XPStyle on
118 AutoCloseWindow false
120 ; =====================================================
121 ; SCRIPT
122 ; =====================================================
124 #!define MUI_WELCOMEPAGE
125 #!define MUI_DIRECTORYPAGE
126 #!define MUI_DIRECTORYSELECTIONPAGE
128 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Mono for Windows.\r\n\r\n\r\n$_CLICK"
130 !insertmacro MUI_PAGE_WELCOME
131 !insertmacro MUI_PAGE_LICENSE "E:\cygwin\home\danmorg\mono029\license.txt"
132 !insertmacro MUI_PAGE_DIRECTORY
133 !insertmacro MUI_PAGE_INSTFILES
135 !define MUI_FINISHPAGE_LINK "Visit Mono's website for the latest news"
136 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.go-mono.com/"
138 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
140 !insertmacro MUI_PAGE_FINISH
142 !insertmacro MUI_UNPAGE_CONFIRM
143 !insertmacro MUI_UNPAGE_INSTFILES
145 !insertmacro MUI_LANGUAGE "ENGLISH"
147 AutoCloseWindow false
148 ShowInstDetails show
150 OutFile ${OUTFILE}
151 InstallDir "${TARGET_INSTALL_DIR}"
153 ;========================
154 ; Uninstaller
155 ;========================
157 Section "Uninstall"
159 MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
161 Delete $INSTDIR\Uninst.exe ; delete Uninstaller
162 DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List
164 MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
165 RMDir /r $INSTDIR
166 GoNext1:
168 DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}
170 ; If the Default-Key is the current Milestone, we just remove the wrappers
172 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
173 StrCmp $0 ${MILESTONE} DeleteWrappers
175 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
177 DeleteWrappers:
179 ; Complete Uninstall
181 DeleteRegKey HKLM SOFTWARE\Mono
182 Delete $WINDIR\monobasepath.bat
183 Delete $WINDIR\mcs.bat
184 Delete $WINDIR\mbas.bat
185 Delete $WINDIR\mint.bat
186 Delete $WINDIR\mono.bat
187 Delete $WINDIR\monodis.bat
188 Delete $WINDIR\monoilasm.bat
189 Delete $WINDIR\sqlsharp.bat
190 Delete $WINDIR\secutil.bat
191 Delete $WINDIR\cert2spc.bat
192 Delete $WINDIR\monoresgen.bat
193 Delete $WINDIR\monosn.bat
194 Delete $WINDIR\cilc.bat
196 GoNext2:
197 NoUnInstall:
199 SectionEnd
202 Section
204 ; Warn people if a newer Mono is already installed
206 ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
207 Push $0
208 Push ${MILESTONE}
209 Call VersionCheck
210 Pop $0
211 StrCmp $0 0 NoAskInstall
212 StrCmp $0 2 NoAskInstall
213 MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
215 NoAskInstall:
217 DetailPrint "Installing Mono Files..."
218 SetOverwrite on
219 SetOutPath $INSTDIR
220 File /r ${SOURCE_INSTALL_DIR}
222 WriteUninstaller Uninst.exe
224 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR
225 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib
226 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc\mono
227 ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
228 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}
230 ; Mono Uninstall Entry in Windows Software List in the Control panel
231 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"
232 WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe
234 ;original string is like C:\mono-0.20\install
235 StrCpy $5 $INSTDIR
236 Push $5
237 Push "\" ;search for this string
238 Push "/" ;replace with this string
239 Call StrReplace
240 ;resulting string which is like C:/mono-0.20/install
241 Pop $6
243 ;========================
244 ; Write the wrapper files
245 ;========================
247 ; create bin/mono wrapper to be used if the user has cygwin
248 FileOpen $0 "$INSTDIR\bin\mono.exe.sh" "w"
249 FileWrite $0 "#!/bin/sh$\r$\n"
250 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
251 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
252 FileWrite $0 '$6/bin/mono.exe "$$@"'
253 FileClose $0
255 ; create bin/mint wrapper to be used if the user has cygwin
256 FileOpen $0 "$INSTDIR\bin\mint.exe.sh" "w"
257 FileWrite $0 "#!/bin/sh$\r$\n"
258 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
259 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
260 FileWrite $0 '$6/bin/mint.exe "$$@"'
261 FileClose $0
263 ; create bin/mcs wrapper to be used if the user has cygwin
264 FileOpen $0 "$INSTDIR\bin\mcs.exe.sh" "w"
265 FileWrite $0 "#!/bin/sh$\r$\n"
266 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
267 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
268 FileWrite $0 '$6/bin/mono.exe $6/bin/mcs.exe "$$@"'
269 FileClose $0
271 ; create bin/mbas wrapper to be used if the user has cygwin
272 FileOpen $0 "$INSTDIR\bin\mbas.exe.sh" "w"
273 FileWrite $0 "#!/bin/sh$\r$\n"
274 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
275 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
276 FileWrite $0 '$6/bin/mono.exe $6/bin/mbas.exe "$$@"'
277 FileClose $0
279 ; create bin/sqlsharp wrapper to be used if the user has cygwin
280 FileOpen $0 "$INSTDIR\bin\sqlsharp.exe.sh" "w"
281 FileWrite $0 "#!/bin/sh$\r$\n"
282 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
283 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
284 FileWrite $0 '$6/bin/mono.exe $6/bin/sqlsharp.exe "$$@"'
285 FileClose $0
287 ; create bin/monodis wrapper to be used if the user has cygwin
288 FileOpen $0 "$INSTDIR\bin\monodis.exe.sh" "w"
289 FileWrite $0 "#!/bin/sh$\r$\n"
290 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
291 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
292 FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'
293 FileClose $0
295 ; create bin/monoresgen wrapper to be used if the user has cygwin
296 FileOpen $0 "$INSTDIR\bin\monoresgen.exe.sh" "w"
297 FileWrite $0 "#!/bin/sh$\r$\n"
298 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
299 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
300 FileWrite $0 '$6/bin/mono.exe $6/bin/monoresgen.exe "$$@"'
301 FileClose $0
303 ; create bin/monoilasm wrapper to be used if the user has cygwin
304 FileOpen $0 "$INSTDIR\bin\monoilasm.exe.sh" "w"
305 FileWrite $0 "#!/bin/sh$\r$\n"
306 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
307 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
308 FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'
309 FileClose $0
311 ; create bin/monosn wrapper to be used if the user has cygwin
312 FileOpen $0 "$INSTDIR\bin\monosn.exe.sh" "w"
313 FileWrite $0 "#!/bin/sh$\r$\n"
314 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
315 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
316 FileWrite $0 '$6/bin/mono.exe $6/bin/monosn.exe "$$@"'
317 FileClose $0
319 ; create bin/secutil wrapper to be used if the user has cygwin
320 FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"
321 FileWrite $0 "#!/bin/sh$\r$\n"
322 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
323 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
324 FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'
325 FileClose $0
327 ; create bin/cert2spc wrapper to be used if the user has cygwin
328 FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"
329 FileWrite $0 "#!/bin/sh$\r$\n"
330 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
331 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
332 FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'
333 FileClose $0
335 ; create bin/cilc wrapper to be used if the user has cygwin
336 FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"
337 FileWrite $0 "#!/bin/sh$\r$\n"
338 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
339 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
340 FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'
341 FileClose $0
344 ; These wrappers are copied to the windows directory.
347 ;========================
348 ; Write the path file
349 ;========================
351 FileOpen $0 "$WINDIR\monobasepath.bat" "w"
352 FileWrite $0 'set MONO_BASEPATH="$INSTDIR"$\r$\n'
353 FileWrite $0 'set MONO_PATH=$INSTDIR\lib$\r$\n'
354 FileWrite $0 'set MONO_CFG_DIR=$INSTDIR\etc'
355 FileClose $0
358 ;========================
359 ; Write the mcs file
360 ;========================
362 FileOpen $0 "$WINDIR\mcs.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\mcs.exe" %MONOARGS%$\r$\n'
376 FileWrite $0 "endlocal$\r$\n"
378 FileClose $0
380 ;========================
381 ; Write the mbas file
382 ;========================
384 FileOpen $0 "$WINDIR\mbas.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\mono.exe" "$INSTDIR\bin\mbas.exe" %MONOARGS%$\r$\n'
398 FileWrite $0 "endlocal$\r$\n"
400 FileClose $0
402 ;========================
403 ; Write the mint file
404 ;========================
406 FileOpen $0 "$WINDIR\mint.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\mint.exe" %MONOARGS%$\r$\n'
420 FileWrite $0 "endlocal$\r$\n"
422 FileClose $0
424 ;========================
425 ; Write the mono file
426 ;========================
428 FileOpen $0 "$WINDIR\mono.bat" "w"
430 FileWrite $0 "@echo off$\r$\n"
431 FileWrite $0 "call monobasepath.bat$\r$\n"
432 FileWrite $0 "set MONOARGS=$\r$\n"
433 FileWrite $0 ":loop$\r$\n"
434 FileWrite $0 "if x%1 == x goto :done$\r$\n"
435 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
436 FileWrite $0 "shift$\r$\n"
437 FileWrite $0 "goto loop$\r$\n"
438 FileWrite $0 ":done$\r$\n"
439 FileWrite $0 "setlocal$\r$\n"
440 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
441 FileWrite $0 '"$INSTDIR\bin\mono.exe" %MONOARGS%$\r$\n'
442 FileWrite $0 "endlocal$\r$\n"
443 FileClose $0
445 ;========================
446 ; Write monodis
447 ;========================
449 FileOpen $0 "$WINDIR\monodis.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\monodis.exe" %MONOARGS%$\r$\n'
463 FileWrite $0 "endlocal$\r$\n"
465 FileClose $0
467 ;========================
468 ; Write monoilasm
469 ;========================
471 FileOpen $0 "$WINDIR\monoilasm.bat" "w"
473 FileWrite $0 "@echo off$\r$\n"
474 FileWrite $0 "call monobasepath.bat$\r$\n"
475 FileWrite $0 "set MONOARGS=$\r$\n"
476 FileWrite $0 ":loop$\r$\n"
477 FileWrite $0 "if x%1 == x goto :done$\r$\n"
478 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
479 FileWrite $0 "shift$\r$\n"
480 FileWrite $0 "goto loop$\r$\n"
481 FileWrite $0 ":done$\r$\n"
482 FileWrite $0 "setlocal$\r$\n"
483 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
484 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoilasm.exe" %MONOARGS%$\r$\n'
485 FileWrite $0 "endlocal$\r$\n"
487 FileClose $0
490 ;========================
491 ; Write the sqlsharp file
492 ;========================
494 FileOpen $0 "$WINDIR\sqlsharp.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\sqlsharp.exe" %MONOARGS%$\r$\n'
508 FileWrite $0 "endlocal$\r$\n"
510 FileClose $0
512 ;========================
513 ; Write the secutil file
514 ;========================
516 FileOpen $0 "$WINDIR\secutil.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\secutil.exe" %MONOARGS%$\r$\n'
530 FileWrite $0 "endlocal$\r$\n"
532 FileClose $0
534 ;========================
535 ; Write the cert2spc file
536 ;========================
538 FileOpen $0 "$WINDIR\cert2spc.bat" "w"
540 FileWrite $0 "@echo off$\r$\n"
541 FileWrite $0 "call monobasepath.bat$\r$\n"
542 FileWrite $0 "set MONOARGS=$\r$\n"
543 FileWrite $0 ":loop$\r$\n"
544 FileWrite $0 "if x%1 == x goto :done$\r$\n"
545 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
546 FileWrite $0 "shift$\r$\n"
547 FileWrite $0 "goto loop$\r$\n"
548 FileWrite $0 ":done$\r$\n"
549 FileWrite $0 "setlocal$\r$\n"
550 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
551 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cert2spec.exe" %MONOARGS%$\r$\n'
552 FileWrite $0 "endlocal$\r$\n"
554 FileClose $0
557 ;========================
558 ; Write the monoresgen file
559 ;========================
561 FileOpen $0 "$WINDIR\monoresgen.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\mono.exe" "$INSTDIR\bin\monoresgen.exe" %MONOARGS%$\r$\n'
575 FileWrite $0 "endlocal$\r$\n"
577 FileClose $0
579 ;========================
580 ; Write the monosn file
581 ;========================
583 FileOpen $0 "$WINDIR\monosn.bat" "w"
585 FileWrite $0 "@echo off$\r$\n"
586 FileWrite $0 "call monobasepath.bat$\r$\n"
587 FileWrite $0 "set MONOARGS=$\r$\n"
588 FileWrite $0 ":loop$\r$\n"
589 FileWrite $0 "if x%1 == x goto :done$\r$\n"
590 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
591 FileWrite $0 "shift$\r$\n"
592 FileWrite $0 "goto loop$\r$\n"
593 FileWrite $0 ":done$\r$\n"
594 FileWrite $0 "setlocal$\r$\n"
595 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
596 FileWrite $0 '"$INSTDIR\bin\monosn.exe" %MONOARGS%$\r$\n'
597 FileWrite $0 "endlocal$\r$\n"
599 FileClose $0
601 ;========================
602 ; Write the cilc file
603 ;========================
605 FileOpen $0 "$WINDIR\cilc.bat" "w"
607 FileWrite $0 "@echo off$\r$\n"
608 FileWrite $0 "call monobasepath.bat$\r$\n"
609 FileWrite $0 "set MONOARGS=$\r$\n"
610 FileWrite $0 ":loop$\r$\n"
611 FileWrite $0 "if x%1 == x goto :done$\r$\n"
612 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
613 FileWrite $0 "shift$\r$\n"
614 FileWrite $0 "goto loop$\r$\n"
615 FileWrite $0 ":done$\r$\n"
616 FileWrite $0 "setlocal$\r$\n"
617 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;%path%"$\r$\n'
618 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cilc.exe" %MONOARGS%$\r$\n'
619 FileWrite $0 "endlocal$\r$\n"
621 FileClose $0
623 ; ============= glib-2.0.pc ===============
624 FileOpen $0 "$INSTDIR\lib\pkgconfig\glib-2.0.pc" "w"
625 FileWrite $0 "prefix=$6$\r$\n"
626 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
627 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
628 FileWrite $0 "includedir=$${prefix}/include$\r$\n"
629 FileWrite $0 "$\r$\n"
630 FileWrite $0 "glib_genmarshal=glib-genmarshal$\r$\n"
631 FileWrite $0 "gobject_query=gobject-query$\r$\n"
632 FileWrite $0 "glib_mkenums=glib-mkenums$\r$\n"
633 FileWrite $0 "$\r$\n"
634 FileWrite $0 "Name: GLib$\r$\n"
635 FileWrite $0 "Description: C Utility Library$\r$\n"
636 FileWrite $0 "Version: 2.0.4$\r$\n"
637 FileWrite $0 "Libs: -L$${libdir} -lglib-2.0 -lintl -liconv $\r$\n"
638 FileWrite $0 "Cflags: -I$${includedir}/glib-2.0 -I$${libdir}/glib-2.0/include $\r$\n"
639 FileClose $0
641 ; ============= gmodule-2.0.pc ===============
642 FileOpen $0 "$INSTDIR\lib\pkgconfig\gmodule-2.0.pc" "w"
643 FileWrite $0 "prefix=$6$\r$\n"
644 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
645 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
646 FileWrite $0 "includedir=$${prefix}/include$\r$\n"
647 FileWrite $0 "$\r$\n"
648 FileWrite $0 "gmodule_supported=true$\r$\n"
649 FileWrite $0 "$\r$\n"
650 FileWrite $0 "Name: GModule$\r$\n"
651 FileWrite $0 "Description: Dynamic module loader for GLib$\r$\n"
652 FileWrite $0 "Requires: glib-2.0$\r$\n"
653 FileWrite $0 "Version: 2.0.4$\r$\n"
654 FileWrite $0 "Libs: -L$${libdir} -lgmodule-2.0 $\r$\n"
655 FileWrite $0 "Cflags:$\r$\n"
656 FileClose $0
658 ; ============= gobject-2.0.pc ===============
659 FileOpen $0 "$INSTDIR\lib\pkgconfig\gobject-2.0.pc" "w"
660 FileWrite $0 "prefix=$6$\r$\n"
661 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
662 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
663 FileWrite $0 "includedir=$${prefix}/include$\r$\n"
664 FileWrite $0 "$\r$\n"
665 FileWrite $0 "Name: GObject$\r$\n"
666 FileWrite $0 "Description: GLib Type, Object, Parameter and Signal Library$\r$\n"
667 FileWrite $0 "Requires: glib-2.0$\r$\n"
668 FileWrite $0 "Version: 2.0.4$\r$\n"
669 FileWrite $0 "Libs: -L$${libdir} -lgobject-2.0$\r$\n"
670 FileWrite $0 "Cflags:$\r$\n"
671 FileClose $0
673 ; ============= gthread-2.0.pc ===============
674 FileOpen $0 "$INSTDIR\lib\pkgconfig\gthread-2.0.pc" "w"
675 FileWrite $0 "prefix=$6$\r$\n"
676 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
677 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
678 FileWrite $0 "includedir=$${prefix}/include$\r$\n"
679 FileWrite $0 "$\r$\n"
680 FileWrite $0 "Name: GThread$\r$\n"
681 FileWrite $0 "Description: Thread support for GLib$\r$\n"
682 FileWrite $0 "Requires: glib-2.0$\r$\n"
683 FileWrite $0 "Version: 2.0.4$\r$\n"
684 FileWrite $0 "Libs: -L$${libdir} -lgthread-2.0 $\r$\n"
685 FileWrite $0 "Cflags: -D_REENTRANT$\r$\n"
686 FileClose $0
688 ; ============= libintl.pc ===============
689 FileOpen $0 "$INSTDIR\lib\pkgconfig\libintl.pc" "w"
690 FileWrite $0 "prefix=$6$\r$\n"
691 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"
692 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"
693 FileWrite $0 "includedir=$${prefix}/include$\r$\n"
694 FileWrite $0 "$\r$\n"
695 FileWrite $0 "Name: libintl$\r$\n"
696 FileWrite $0 "Description: The intl library from GNU gettext$\r$\n"
697 FileWrite $0 "Version: 0.10.40-tml$\r$\n"
698 FileWrite $0 "Libs: -L$${libdir} -lintl$\r$\n"
699 FileWrite $0 "Cflags: -I$${includedir}$\r$\n"
700 FileClose $0
702 NoInstall:
703 SectionEnd
705 ; function StrReplace
706 ; by Hendri Adriaens
707 ; HendriAdriaens@hotmail.com
708 ; found in the NSIS Archives
709 function StrReplace
710 Exch $0 ;this will replace wrong characters
711 Exch
712 Exch $1 ;needs to be replaced
713 Exch
714 Exch 2
715 Exch $2 ;the orginal string
716 Push $3 ;counter
717 Push $4 ;temp character
718 Push $5 ;temp string
719 Push $6 ;length of string that need to be replaced
720 Push $7 ;length of string that will replace
721 Push $R0 ;tempstring
722 Push $R1 ;tempstring
723 Push $R2 ;tempstring
724 StrCpy $3 "-1"
725 StrCpy $5 ""
726 StrLen $6 $1
727 StrLen $7 $0
728 Loop:
729 IntOp $3 $3 + 1
730 StrCpy $4 $2 $6 $3
731 StrCmp $4 "" ExitLoop
732 StrCmp $4 $1 Replace
733 Goto Loop
734 Replace:
735 StrCpy $R0 $2 $3
736 IntOp $R2 $3 + $6
737 StrCpy $R1 $2 "" $R2
738 StrCpy $2 $R0$0$R1
739 IntOp $3 $3 + $7
740 Goto Loop
741 ExitLoop:
742 StrCpy $0 $2
743 Pop $R2
744 Pop $R1
745 Pop $R0
746 Pop $7
747 Pop $6
748 Pop $5
749 Pop $4
750 Pop $3
751 Pop $2
752 Pop $1
753 Exch $0
754 FunctionEnd
756 Function VersionCheck
757 Exch $0 ;second versionnumber
758 Exch
759 Exch $1 ;first versionnumber
760 Push $R0 ;counter for $0
761 Push $R1 ;counter for $1
762 Push $3 ;temp char
763 Push $4 ;temp string for $0
764 Push $5 ;temp string for $1
765 StrCpy $R0 "-1"
766 StrCpy $R1 "-1"
767 Start:
768 StrCpy $4 ""
769 DotLoop0:
770 IntOp $R0 $R0 + 1
771 StrCpy $3 $0 1 $R0
772 StrCmp $3 "" DotFound0
773 StrCmp $3 "." DotFound0
774 StrCpy $4 $4$3
775 Goto DotLoop0
776 DotFound0:
777 StrCpy $5 ""
778 DotLoop1:
779 IntOp $R1 $R1 + 1
780 StrCpy $3 $1 1 $R1
781 StrCmp $3 "" DotFound1
782 StrCmp $3 "." DotFound1
783 StrCpy $5 $5$3
784 Goto DotLoop1
785 DotFound1:
786 Strcmp $4 "" 0 Not4
787 StrCmp $5 "" Equal
788 Goto Ver2Less
789 Not4:
790 StrCmp $5 "" Ver2More
791 IntCmp $4 $5 Start Ver2Less Ver2More
792 Equal:
793 StrCpy $0 "0"
794 Goto Finish
795 Ver2Less:
796 StrCpy $0 "1"
797 Goto Finish
798 Ver2More:
799 StrCpy $0 "2"
800 Finish:
801 Pop $5
802 Pop $4
803 Pop $3
804 Pop $R1
805 Pop $R0
806 Pop $1
807 Exch $0
808 FunctionEnd