* icall.c: Clairfy out of sync error message. It is not always
[mono.git] / monowiz.win32.nsi
1 ; =================================================================
2 ; mono.nsi - This NSIS script creates Mono Setup wizard for Windows
3 ;
4 ;            Requires NSIS 2.0 (Nullsoft Scriptable Install System)
5 ;            From http://nsis.sourceforge.net/site/index.php
6 ; =================================================================
7 ;
8 ; (C) Copyright 2003 by Johannes Roith
9 ; (C) Copyright 2003, 2004 by Daniel Morgan
10 ;
11 ; Authors: 
12 ;       Johannes Roith <johannes@jroith.de>
13 ;       Daniel Morgan <danielmorgan@verizon.net>
14 ;
15 ; This .nsi includes code from the NSIS Archives:
16 ; function StrReplace and VersionCheck 
17 ; by Hendri Adriaens
18 ; HendriAdriaens@hotmail.com
19
20 ; =====================================================
21 ;
22 ; This script can build a binary setup wizard of mono.
23 ; It is released under the GNU GPL.
24 ;
25 ; =====================================================
26 ; SET MILESTONE & SOURCE DIR
27 ; =====================================================
28 ; set by makefile!!
29 ; !define MILESTONE 0.29 
30 ; !define SOURCE_INSTALL_DIR E:\cygwin\home\danmorg\mono029\*.*
31
32 !define MILESTONE 0.31
33 !define SOURCE_INSTALL_DIR c:\b\install\*.* 
34 ;E:\cygwin\home\danmorg\mono029\*.*
35
36 ; =====================================================
37 ; SET LOGO
38 ; =====================================================
39 ;
40 ;  Beautification:
41 ;
42 ;  This adds a Mono-specific Image on the left
43 ;  You can choose between the light or dark one.
44 ;  
45 ;  If you wish no mono-specifi logo, please outcomment
46 ;  the lines.
47 ;  
48 ;  "light" is enabled.
49 ;
50 ;  !define MUI_SPECIALBITMAP "mono-win32-setup-dark.bmp"
51    !define MUI_SPECIALBITMAP "mono-win32-setup-light.bmp"
52
53 ; =====================================================
54 ; BUILDING
55 ; =====================================================
56 ;
57 ; 1. Build mono to a clean directory prefix.
58 ;
59 ; 2. In your install directory, delete the *.a files.
60 ;     Most people won't need them and it saves ~ 4 MB.
61 ;
62 ; 3. Type "make win32setup"
63 ;
64 ; 4. The output file is mono-[MILESTONE]-win32-1.exe
65 ;
66 ;
67 ; =====================================================
68 ; MONO & REGISTRY / DETECTING MONO
69 ; =====================================================
70 ;
71 ;
72 ; This setup creates several Registry Keys:
73 ;
74 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR
75 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot
76 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory
77 ; HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir
78 ;
79 ; =====================================================
80 ;
81 ; To get the current Mono Install Directory:
82 ;
83 ; 1. Get DefaultCLR
84 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE SdkInstallRoot
85 ;
86 ; =====================================================
87 ;
88 ; To get the current Mono assembly Directory:
89 ;
90 ; 1. Get DefaultCLR
91 ; 2. Get HKEY_LOCAL_MACHINE SOFTWARE\Mono\$THE_DEFAULT_CLR_VALUE FrameworkAssemblyDirectory
92
93 ; =====================================================
94 ; Do not edit below
95 ; =====================================================
96 ;
97 ;
98 ; =====================================================
99 ; GENERAL SETTING - NEED NOT TO BE CHANGED
100 ; =====================================================
101
102 !define NAME "Mono" 
103 !define TARGET_INSTALL_DIR "$PROGRAMFILES\Mono-${MILESTONE}" 
104 !define OUTFILE mono-${MILESTONE}-win32-1.exe
105
106 Name ${NAME}\r
107 Caption "Mono ${MILESTONE} Setup"\r
108
109 !include "MUI.nsh"\r
110 !include "Sections.nsh"\r
111
112 SetCompressor bzip2\r
113 SilentInstall normal\r
114 ShowInstDetails show\r
115 SetDateSave on\r
116 SetDatablockOptimize on\r
117 CRCCheck on\r
118 BGGradient 000000 800000 FFFFFF\r
119 InstallColors FF8080 000030\r
120 XPStyle on\r
121 AutoCloseWindow false
122
123 ; =====================================================
124 ; SCRIPT
125 ; =====================================================
126
127 #!define MUI_WELCOMEPAGE
128 #!define MUI_DIRECTORYPAGE
129 #!define MUI_DIRECTORYSELECTIONPAGE
130  
131 !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Mono for Windows.\r\n\r\n\r\n$_CLICK"\r
132 \r
133 !insertmacro MUI_PAGE_WELCOME\r
134 !insertmacro MUI_PAGE_DIRECTORY\r
135 !insertmacro MUI_PAGE_INSTFILES\r
136 \r
137 !define MUI_FINISHPAGE_LINK "Visit Mono's website for the latest news"\r
138 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.go-mono.com/"\r
139 \r
140 !define MUI_FINISHPAGE_NOREBOOTSUPPORT\r
141 \r
142 !insertmacro MUI_PAGE_FINISH\r
143 \r
144 !insertmacro MUI_UNPAGE_CONFIRM\r
145 !insertmacro MUI_UNPAGE_INSTFILES\r
146  
147 !insertmacro MUI_LANGUAGE "ENGLISH"
148
149 AutoCloseWindow false\r
150 ShowInstDetails show
151
152 OutFile ${OUTFILE}
153 InstallDir "${TARGET_INSTALL_DIR}"
154
155 ;========================
156 ; Uninstaller
157 ;========================
158
159 Section "Uninstall"
160
161   MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall
162
163   Delete $INSTDIR\Uninst.exe ; delete Uninstaller
164   DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List
165
166   MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1
167   RMDir /r $INSTDIR
168   GoNext1:
169
170   DeleteRegKey HKLM SOFTWARE\Mono\${MILESTONE}
171
172   ; If the Default-Key is the current Milestone, we just remove the wrappers
173
174   ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
175   StrCmp $0 ${MILESTONE} DeleteWrappers
176
177   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
178
179   DeleteWrappers:
180
181   ; Complete Uninstall
182
183   DeleteRegKey HKLM SOFTWARE\Mono
184   Delete $WINDIR\monobasepath.bat
185   Delete $WINDIR\mcs.bat
186   Delete $WINDIR\mbas.bat
187   Delete $WINDIR\mint.bat
188   Delete $WINDIR\mono.bat
189   Delete $WINDIR\monodis.bat
190   Delete $WINDIR\monoilasm.bat
191   Delete $WINDIR\sqlsharp.bat
192   Delete $WINDIR\secutil.bat
193   Delete $WINDIR\cert2spc.bat
194   Delete $WINDIR\monoresgen.bat
195   Delete $WINDIR\monosn.bat
196   Delete $WINDIR\cilc.bat
197
198   GoNext2:
199   NoUnInstall:
200
201 SectionEnd
202
203
204  Section
205
206  ; Warn people if a newer Mono is already installed
207
208  ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR
209  Push $0
210  Push ${MILESTONE} 
211  Call VersionCheck
212  Pop $0
213  StrCmp $0 0 NoAskInstall
214  StrCmp $0 2 NoAskInstall
215  MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall
216
217  NoAskInstall:
218
219  DetailPrint "Installing Mono Files..."
220  SetOverwrite on
221  SetOutPath $INSTDIR
222  File /r ${SOURCE_INSTALL_DIR}
223
224  WriteUninstaller Uninst.exe
225
226  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} SdkInstallRoot $INSTDIR
227  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} FrameworkAssemblyDirectory $INSTDIR\lib
228  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} MonoConfigDir $INSTDIR\etc\mono
229  ;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib
230  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}
231
232  ; Mono Uninstall Entry in Windows Software List in the Control panel
233  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"
234  WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe
235
236  ;original string is like C:\mono-0.20\install
237  StrCpy $5 $INSTDIR 
238  Push $5
239  Push "\" ;search for this string
240  Push "/" ;replace with this string
241  Call StrReplace
242  ;resulting string which is like C:/mono-0.20/install
243  Pop $6
244
245 ;========================
246 ; Write the wrapper files
247 ;========================
248
249 ; create bin/mono wrapper to be used if the user has cygwin
250 FileOpen $0 "$INSTDIR\bin\mono.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 "$$@"'
255 FileClose $0
256
257 ; create bin/mint wrapper to be used if the user has cygwin
258 FileOpen $0 "$INSTDIR\bin\mint.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/mint.exe "$$@"'
263 FileClose $0
264
265 ; create bin/mcs wrapper to be used if the user has cygwin
266 FileOpen $0 "$INSTDIR\bin\mcs.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/mcs.exe "$$@"'
271 FileClose $0
272
273 ; create bin/mbas wrapper to be used if the user has cygwin
274 FileOpen $0 "$INSTDIR\bin\mbas.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/mbas.exe "$$@"'
279 FileClose $0
280
281 ; create bin/sqlsharp wrapper to be used if the user has cygwin
282 FileOpen $0 "$INSTDIR\bin\sqlsharp.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/sqlsharp.exe "$$@"'
287 FileClose $0
288
289 ; create bin/monodis wrapper to be used if the user has cygwin
290 FileOpen $0 "$INSTDIR\bin\monodis.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/monodis.exe "$$@"'
295 FileClose $0
296
297 ; create bin/monoresgen wrapper to be used if the user has cygwin
298 FileOpen $0 "$INSTDIR\bin\monoresgen.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/monoresgen.exe "$$@"'
303 FileClose $0
304
305 ; create bin/monoilasm wrapper to be used if the user has cygwin
306 FileOpen $0 "$INSTDIR\bin\monoilasm.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/monoilasm.exe "$$@"'
311 FileClose $0
312
313 ; create bin/monosn wrapper to be used if the user has cygwin
314 FileOpen $0 "$INSTDIR\bin\monosn.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/monosn.exe "$$@"'
319 FileClose $0
320
321 ; create bin/secutil wrapper to be used if the user has cygwin
322 FileOpen $0 "$INSTDIR\bin\secutil.exe.sh" "w"
323 FileWrite $0 "#!/bin/sh$\r$\n"
324 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
325 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
326 FileWrite $0 '$6/bin/mono.exe $6/bin/secutil.exe "$$@"'
327 FileClose $0
328
329 ; create bin/cert2spc wrapper to be used if the user has cygwin
330 FileOpen $0 "$INSTDIR\bin\cert2spc.exe.sh" "w"
331 FileWrite $0 "#!/bin/sh$\r$\n"
332 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
333 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
334 FileWrite $0 '$6/bin/mono.exe $6/bin/cert2spc.exe "$$@"'
335 FileClose $0
336
337 ; create bin/cilc wrapper to be used if the user has cygwin
338 FileOpen $0 "$INSTDIR\bin\cilc.exe.sh" "w"
339 FileWrite $0 "#!/bin/sh$\r$\n"
340 FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
341 FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
342 FileWrite $0 '$6/bin/mono.exe $6/bin/cilc.exe "$$@"'
343 FileClose $0
344
345 ;
346 ; These wrappers are copied to the windows directory.
347 ;
348
349 ;========================
350 ; Write the path file
351 ;========================
352
353 FileOpen $0 "$WINDIR\monobasepath.bat" "w"
354 FileWrite $0 'set MONO_BASEPATH="$INSTDIR"$\r$\n'
355 FileWrite $0 'set MONO_PATH=$INSTDIR\lib$\r$\n'
356 FileWrite $0 'set MONO_CFG_DIR=$INSTDIR\etc'
357 FileClose $0
358
359
360 ;========================
361 ; Write the mcs file
362 ;========================
363
364 FileOpen $0 "$WINDIR\mcs.bat" "w"
365
366 FileWrite $0 "@echo off$\r$\n"
367 FileWrite $0 "call monobasepath.bat$\r$\n"
368 FileWrite $0 "set MONOARGS=$\r$\n"
369 FileWrite $0 ":loop$\r$\n"
370 FileWrite $0 "if x%1 == x goto :done$\r$\n"
371 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
372 FileWrite $0 "shift$\r$\n"
373 FileWrite $0 "goto loop$\r$\n"
374 FileWrite $0 ":done$\r$\n"
375 FileWrite $0 "setlocal$\r$\n"
376 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
377 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mcs.exe" %MONOARGS%$\r$\n'
378 FileWrite $0 "endlocal$\r$\n"
379
380 FileClose $0
381
382 ;========================
383 ; Write the mbas file
384 ;========================
385
386 FileOpen $0 "$WINDIR\mbas.bat" "w"
387
388 FileWrite $0 "@echo off$\r$\n"
389 FileWrite $0 "call monobasepath.bat$\r$\n"
390 FileWrite $0 "set MONOARGS=$\r$\n"
391 FileWrite $0 ":loop$\r$\n"
392 FileWrite $0 "if x%1 == x goto :done$\r$\n"
393 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
394 FileWrite $0 "shift$\r$\n"
395 FileWrite $0 "goto loop$\r$\n"
396 FileWrite $0 ":done$\r$\n"
397 FileWrite $0 "setlocal$\r$\n"
398 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
399 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\mbas.exe" %MONOARGS%$\r$\n'
400 FileWrite $0 "endlocal$\r$\n"
401
402 FileClose $0
403
404 ;========================
405 ; Write the mint file
406 ;========================
407
408 FileOpen $0 "$WINDIR\mint.bat" "w"
409
410 FileWrite $0 "@echo off$\r$\n"
411 FileWrite $0 "call monobasepath.bat$\r$\n"
412 FileWrite $0 "set MONOARGS=$\r$\n"
413 FileWrite $0 ":loop$\r$\n"
414 FileWrite $0 "if x%1 == x goto :done$\r$\n"
415 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
416 FileWrite $0 "shift$\r$\n"
417 FileWrite $0 "goto loop$\r$\n"
418 FileWrite $0 ":done$\r$\n"
419 FileWrite $0 "setlocal$\r$\n"
420 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
421 FileWrite $0 '"$INSTDIR\bin\mint.exe" %MONOARGS%$\r$\n'
422 FileWrite $0 "endlocal$\r$\n"
423
424 FileClose $0
425
426 ;========================
427 ; Write the mono file
428 ;========================
429
430 FileOpen $0 "$WINDIR\mono.bat" "w"
431
432 FileWrite $0 "@echo off$\r$\n"
433 FileWrite $0 "call monobasepath.bat$\r$\n"
434 FileWrite $0 "set MONOARGS=$\r$\n"
435 FileWrite $0 ":loop$\r$\n"
436 FileWrite $0 "if x%1 == x goto :done$\r$\n"
437 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
438 FileWrite $0 "shift$\r$\n"
439 FileWrite $0 "goto loop$\r$\n"
440 FileWrite $0 ":done$\r$\n"
441 FileWrite $0 "setlocal$\r$\n"
442 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
443 FileWrite $0 '"$INSTDIR\bin\mono.exe" %MONOARGS%$\r$\n'
444 FileWrite $0 "endlocal$\r$\n"
445 FileClose $0
446
447 ;========================
448 ; Write monodis
449 ;========================
450
451 FileOpen $0 "$WINDIR\monodis.bat" "w"
452
453 FileWrite $0 "@echo off$\r$\n"
454 FileWrite $0 "call monobasepath.bat$\r$\n"
455 FileWrite $0 "set MONOARGS=$\r$\n"
456 FileWrite $0 ":loop$\r$\n"
457 FileWrite $0 "if x%1 == x goto :done$\r$\n"
458 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
459 FileWrite $0 "shift$\r$\n"
460 FileWrite $0 "goto loop$\r$\n"
461 FileWrite $0 ":done$\r$\n"
462 FileWrite $0 "setlocal$\r$\n"
463 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
464 FileWrite $0 '"$INSTDIR\bin\monodis.exe" %MONOARGS%$\r$\n'
465 FileWrite $0 "endlocal$\r$\n"
466
467 FileClose $0
468
469 ;========================
470 ; Write monoilasm
471 ;========================
472
473 FileOpen $0 "$WINDIR\monoilasm.bat" "w"
474
475 FileWrite $0 "@echo off$\r$\n"
476 FileWrite $0 "call monobasepath.bat$\r$\n"
477 FileWrite $0 "set MONOARGS=$\r$\n"
478 FileWrite $0 ":loop$\r$\n"
479 FileWrite $0 "if x%1 == x goto :done$\r$\n"
480 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
481 FileWrite $0 "shift$\r$\n"
482 FileWrite $0 "goto loop$\r$\n"
483 FileWrite $0 ":done$\r$\n"
484 FileWrite $0 "setlocal$\r$\n"
485 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
486 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoilasm.exe" %MONOARGS%$\r$\n'
487 FileWrite $0 "endlocal$\r$\n"
488
489 FileClose $0
490
491
492 ;========================
493 ; Write the sqlsharp file
494 ;========================
495
496 FileOpen $0 "$WINDIR\sqlsharp.bat" "w"
497
498 FileWrite $0 "@echo off$\r$\n"
499 FileWrite $0 "call monobasepath.bat$\r$\n"
500 FileWrite $0 "set MONOARGS=$\r$\n"
501 FileWrite $0 ":loop$\r$\n"
502 FileWrite $0 "if x%1 == x goto :done$\r$\n"
503 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
504 FileWrite $0 "shift$\r$\n"
505 FileWrite $0 "goto loop$\r$\n"
506 FileWrite $0 ":done$\r$\n"
507 FileWrite $0 "setlocal$\r$\n"
508 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
509 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\sqlsharp.exe" %MONOARGS%$\r$\n'
510 FileWrite $0 "endlocal$\r$\n"
511
512 FileClose $0
513
514 ;========================
515 ; Write the secutil file
516 ;========================
517
518 FileOpen $0 "$WINDIR\secutil.bat" "w"
519
520 FileWrite $0 "@echo off$\r$\n"
521 FileWrite $0 "call monobasepath.bat$\r$\n"
522 FileWrite $0 "set MONOARGS=$\r$\n"
523 FileWrite $0 ":loop$\r$\n"
524 FileWrite $0 "if x%1 == x goto :done$\r$\n"
525 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
526 FileWrite $0 "shift$\r$\n"
527 FileWrite $0 "goto loop$\r$\n"
528 FileWrite $0 ":done$\r$\n"
529 FileWrite $0 "setlocal$\r$\n"
530 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
531 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\secutil.exe" %MONOARGS%$\r$\n'
532 FileWrite $0 "endlocal$\r$\n"
533
534 FileClose $0
535
536 ;========================
537 ; Write the cert2spc file
538 ;========================
539
540 FileOpen $0 "$WINDIR\cert2spc.bat" "w"
541
542 FileWrite $0 "@echo off$\r$\n"
543 FileWrite $0 "call monobasepath.bat$\r$\n"
544 FileWrite $0 "set MONOARGS=$\r$\n"
545 FileWrite $0 ":loop$\r$\n"
546 FileWrite $0 "if x%1 == x goto :done$\r$\n"
547 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
548 FileWrite $0 "shift$\r$\n"
549 FileWrite $0 "goto loop$\r$\n"
550 FileWrite $0 ":done$\r$\n"
551 FileWrite $0 "setlocal$\r$\n"
552 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
553 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cert2spec.exe" %MONOARGS%$\r$\n'
554 FileWrite $0 "endlocal$\r$\n"
555
556 FileClose $0
557
558
559 ;========================
560 ; Write the monoresgen file
561 ;========================
562
563 FileOpen $0 "$WINDIR\monoresgen.bat" "w"
564
565 FileWrite $0 "@echo off$\r$\n"
566 FileWrite $0 "call monobasepath.bat$\r$\n"
567 FileWrite $0 "set MONOARGS=$\r$\n"
568 FileWrite $0 ":loop$\r$\n"
569 FileWrite $0 "if x%1 == x goto :done$\r$\n"
570 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
571 FileWrite $0 "shift$\r$\n"
572 FileWrite $0 "goto loop$\r$\n"
573 FileWrite $0 ":done$\r$\n"
574 FileWrite $0 "setlocal$\r$\n"
575 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
576 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\monoresgen.exe" %MONOARGS%$\r$\n'
577 FileWrite $0 "endlocal$\r$\n"
578
579 FileClose $0
580
581 ;========================
582 ; Write the monosn file
583 ;========================
584
585 FileOpen $0 "$WINDIR\monosn.bat" "w"
586
587 FileWrite $0 "@echo off$\r$\n"
588 FileWrite $0 "call monobasepath.bat$\r$\n"
589 FileWrite $0 "set MONOARGS=$\r$\n"
590 FileWrite $0 ":loop$\r$\n"
591 FileWrite $0 "if x%1 == x goto :done$\r$\n"
592 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
593 FileWrite $0 "shift$\r$\n"
594 FileWrite $0 "goto loop$\r$\n"
595 FileWrite $0 ":done$\r$\n"
596 FileWrite $0 "setlocal$\r$\n"
597 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
598 FileWrite $0 '"$INSTDIR\bin\monosn.exe" %MONOARGS%$\r$\n'
599 FileWrite $0 "endlocal$\r$\n"
600
601 FileClose $0
602
603 ;========================
604 ; Write the cilc file
605 ;========================
606
607 FileOpen $0 "$WINDIR\cilc.bat" "w"
608
609 FileWrite $0 "@echo off$\r$\n"
610 FileWrite $0 "call monobasepath.bat$\r$\n"
611 FileWrite $0 "set MONOARGS=$\r$\n"
612 FileWrite $0 ":loop$\r$\n"
613 FileWrite $0 "if x%1 == x goto :done$\r$\n"
614 FileWrite $0 "set MONOARGS=%MONOARGS% %1$\r$\n"
615 FileWrite $0 "shift$\r$\n"
616 FileWrite $0 "goto loop$\r$\n"
617 FileWrite $0 ":done$\r$\n"
618 FileWrite $0 "setlocal$\r$\n"
619 FileWrite $0 'set path="$INSTDIR\bin\;$INSTDIR\lib\;$INSTDIR\icu\bin;%path%"$\r$\n'
620 FileWrite $0 '"$INSTDIR\bin\mono.exe" "$INSTDIR\bin\cilc.exe" %MONOARGS%$\r$\n'
621 FileWrite $0 "endlocal$\r$\n"
622
623 FileClose $0
624
625 ; ============= glib-2.0.pc ===============\r
626 FileOpen $0 "$INSTDIR\lib\pkgconfig\glib-2.0.pc" "w"\r
627 FileWrite $0 "prefix=$6$\r$\n"\r
628 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"\r
629 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"\r
630 FileWrite $0 "includedir=$${prefix}/include$\r$\n"\r
631 FileWrite $0 "$\r$\n"\r
632 FileWrite $0 "glib_genmarshal=glib-genmarshal$\r$\n"\r
633 FileWrite $0 "gobject_query=gobject-query$\r$\n"\r
634 FileWrite $0 "glib_mkenums=glib-mkenums$\r$\n"\r
635 FileWrite $0 "$\r$\n"\r
636 FileWrite $0 "Name: GLib$\r$\n"\r
637 FileWrite $0 "Description: C Utility Library$\r$\n"\r
638 FileWrite $0 "Version: 2.0.4$\r$\n"\r
639 FileWrite $0 "Libs: -L$${libdir} -lglib-2.0 -lintl -liconv $\r$\n"\r
640 FileWrite $0 "Cflags: -I$${includedir}/glib-2.0 -I$${libdir}/glib-2.0/include $\r$\n"\r
641 FileClose $0
642 \r
643 ; ============= gmodule-2.0.pc ===============\r
644 FileOpen $0 "$INSTDIR\lib\pkgconfig\gmodule-2.0.pc" "w"\r
645 FileWrite $0 "prefix=$6$\r$\n"\r
646 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"\r
647 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"\r
648 FileWrite $0 "includedir=$${prefix}/include$\r$\n"\r
649 FileWrite $0 "$\r$\n"\r
650 FileWrite $0 "gmodule_supported=true$\r$\n"\r
651 FileWrite $0 "$\r$\n"\r
652 FileWrite $0 "Name: GModule$\r$\n"\r
653 FileWrite $0 "Description: Dynamic module loader for GLib$\r$\n"\r
654 FileWrite $0 "Requires: glib-2.0$\r$\n"\r
655 FileWrite $0 "Version: 2.0.4$\r$\n"\r
656 FileWrite $0 "Libs: -L$${libdir} -lgmodule-2.0 $\r$\n"\r
657 FileWrite $0 "Cflags:$\r$\n"\r
658 FileClose $0\r
659 \r
660 ; ============= gobject-2.0.pc ===============\r
661 FileOpen $0 "$INSTDIR\lib\pkgconfig\gobject-2.0.pc" "w"\r
662 FileWrite $0 "prefix=$6$\r$\n"\r
663 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"\r
664 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"\r
665 FileWrite $0 "includedir=$${prefix}/include$\r$\n"\r
666 FileWrite $0 "$\r$\n"\r
667 FileWrite $0 "Name: GObject$\r$\n"\r
668 FileWrite $0 "Description: GLib Type, Object, Parameter and Signal Library$\r$\n"\r
669 FileWrite $0 "Requires: glib-2.0$\r$\n"\r
670 FileWrite $0 "Version: 2.0.4$\r$\n"\r
671 FileWrite $0 "Libs: -L$${libdir} -lgobject-2.0$\r$\n"\r
672 FileWrite $0 "Cflags:$\r$\n"\r
673 FileClose $0\r
674 \r
675 ; ============= gthread-2.0.pc ===============\r
676 FileOpen $0 "$INSTDIR\lib\pkgconfig\gthread-2.0.pc" "w"\r
677 FileWrite $0 "prefix=$6$\r$\n"\r
678 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"\r
679 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"\r
680 FileWrite $0 "includedir=$${prefix}/include$\r$\n"\r
681 FileWrite $0 "$\r$\n"\r
682 FileWrite $0 "Name: GThread$\r$\n"\r
683 FileWrite $0 "Description: Thread support for GLib$\r$\n"\r
684 FileWrite $0 "Requires: glib-2.0$\r$\n"\r
685 FileWrite $0 "Version: 2.0.4$\r$\n"\r
686 FileWrite $0 "Libs: -L$${libdir} -lgthread-2.0 $\r$\n"\r
687 FileWrite $0 "Cflags: -D_REENTRANT$\r$\n"\r
688 FileClose $0\r
689
690 ; ============= libintl.pc ===============\r
691 FileOpen $0 "$INSTDIR\lib\pkgconfig\libintl.pc" "w"\r
692 FileWrite $0 "prefix=$6$\r$\n"\r
693 FileWrite $0 "exec_prefix=$${prefix}$\r$\n"\r
694 FileWrite $0 "libdir=$${exec_prefix}/lib$\r$\n"\r
695 FileWrite $0 "includedir=$${prefix}/include$\r$\n"\r
696 FileWrite $0 "$\r$\n"\r
697 FileWrite $0 "Name: libintl$\r$\n"\r
698 FileWrite $0 "Description: The intl library from GNU gettext$\r$\n"\r
699 FileWrite $0 "Version: 0.10.40-tml$\r$\n"\r
700 FileWrite $0 "Libs: -L$${libdir} -lintl$\r$\n"\r
701 FileWrite $0 "Cflags: -I$${includedir}$\r$\n"\r
702 FileClose $0\r
703
704 NoInstall:
705 SectionEnd
706
707 ; function StrReplace
708 ; by Hendri Adriaens
709 ; HendriAdriaens@hotmail.com
710 ; found in the NSIS Archives
711 function StrReplace
712   Exch $0 ;this will replace wrong characters
713   Exch
714   Exch $1 ;needs to be replaced
715   Exch
716   Exch 2
717   Exch $2 ;the orginal string
718   Push $3 ;counter
719   Push $4 ;temp character
720   Push $5 ;temp string
721   Push $6 ;length of string that need to be replaced
722   Push $7 ;length of string that will replace
723   Push $R0 ;tempstring
724   Push $R1 ;tempstring
725   Push $R2 ;tempstring
726   StrCpy $3 "-1"
727   StrCpy $5 ""
728   StrLen $6 $1
729   StrLen $7 $0
730   Loop:
731   IntOp $3 $3 + 1
732   StrCpy $4 $2 $6 $3
733   StrCmp $4 "" ExitLoop
734   StrCmp $4 $1 Replace
735   Goto Loop
736   Replace:
737   StrCpy $R0 $2 $3
738   IntOp $R2 $3 + $6
739   StrCpy $R1 $2 "" $R2
740   StrCpy $2 $R0$0$R1
741   IntOp $3 $3 + $7
742   Goto Loop
743   ExitLoop:
744   StrCpy $0 $2
745   Pop $R2
746   Pop $R1
747   Pop $R0
748   Pop $7
749   Pop $6
750   Pop $5
751   Pop $4
752   Pop $3
753   Pop $2
754   Pop $1
755   Exch $0
756 FunctionEnd
757
758 Function VersionCheck
759   Exch $0 ;second versionnumber
760   Exch
761   Exch $1 ;first versionnumber
762   Push $R0 ;counter for $0
763   Push $R1 ;counter for $1
764   Push $3 ;temp char
765   Push $4 ;temp string for $0
766   Push $5 ;temp string for $1
767   StrCpy $R0 "-1"
768   StrCpy $R1 "-1"
769   Start:
770   StrCpy $4 ""
771   DotLoop0:
772   IntOp $R0 $R0 + 1
773   StrCpy $3 $0 1 $R0
774   StrCmp $3 "" DotFound0
775   StrCmp $3 "." DotFound0
776   StrCpy $4 $4$3
777   Goto DotLoop0
778   DotFound0:
779   StrCpy $5 ""
780   DotLoop1:
781   IntOp $R1 $R1 + 1
782   StrCpy $3 $1 1 $R1
783   StrCmp $3 "" DotFound1
784   StrCmp $3 "." DotFound1
785   StrCpy $5 $5$3
786   Goto DotLoop1
787   DotFound1:
788   Strcmp $4 "" 0 Not4
789     StrCmp $5 "" Equal
790     Goto Ver2Less
791   Not4:
792   StrCmp $5 "" Ver2More
793   IntCmp $4 $5 Start Ver2Less Ver2More
794   Equal:
795   StrCpy $0 "0"
796   Goto Finish
797   Ver2Less:
798   StrCpy $0 "1"
799   Goto Finish
800   Ver2More:
801   StrCpy $0 "2"
802   Finish:
803   Pop $5
804   Pop $4
805   Pop $3
806   Pop $R1
807   Pop $R0
808   Pop $1
809   Exch $0
810 FunctionEnd