; =====================================================\r
-; mono.nsi - Mono Setup Wizard for Windows\r
-; uses NullSoft Installer System\r
-; found at http://nsis.sourceforge.net/\r
+; mono.nsi - Mono Setup wizard for windows\r
; =====================================================\r
;\r
; (C) Copyright 2003 by Johannes Roith\r
; Daniel Morgan <danmorg@sc.rr.com>\r
;\r
; This .nsi includes code from the NSIS Archives:\r
-; function StrReplace\r
+; function StrReplace and VersionCheck \r
; by Hendri Adriaens\r
; HendriAdriaens@hotmail.com\r
; \r
;\r
;\r
!define MILESTONE "0.23" ;\r
- !define SOURCE_INSTALL_DIR "c:\mono-0.23\install\\*" ;\r
+ !define SOURCE_INSTALL_DIR "c:\mono-0.23-setup\install\\*" ;\r
\r
; =====================================================\r
; BUILDING\r
; 2. In your install directory, delete the *.a files.\r
; Most people won't need them and it saves ~ 4 MB.\r
;\r
-; 3. Get latest the latest NSIS from cvs or \r
-; a development snapshot\r
-; from http://nsis.sourceforge.net/\r
-;\r
-; Documentation for it can be found\r
+; 3. Get latest nsis from cvs or a development snapshot\r
+; from http://nsis.sf.net\r
;\r
; 4. Adapt the MILESTONE\r
;\r
; 6. Open this script in makensisw.exe\r
;\r
; 7. The output file is mono-[MILESTONE]-win32-1.exe\r
-; If there has been a mono-[MILESTONE]-win32-1.exe\r
-; created, then increment the number after win32- \r
-; to indicate the win32 package build number, such as,\r
-; mono-[MILESTONE]-win32-2.exe \r
-; Usually, this would be done if there were errors in\r
-; the 1st package that was released.\r
+;\r
+;\r
+;\r
;\r
;\r
; =====================================================\r
\r
Section "Uninstall"\r
\r
+ MessageBox MB_YESNO "Are you sure you want to uninstall Mono from your system?" IDNO NoUnInstall\r
+\r
Delete $INSTDIR\Uninst.exe ; delete Uninstaller\r
+ DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} ; Remove Entry in Software List\r
\r
MessageBox MB_YESNO "Mono was installed into $INSTDIR. Should this directory be removed completly?" IDNO GoNext1\r
RMDir /r $INSTDIR\r
Delete $WINDIR\monosn.bat\r
\r
GoNext2:\r
-\r
+ NoUnInstall:\r
\r
SectionEnd\r
\r
\r
-\r
Section\r
+\r
+ ; Warn people if a newer Mono is already installed\r
+\r
+ ReadRegStr $0 HKEY_LOCAL_MACHINE SOFTWARE\Mono\ DefaultCLR\r
+ Push $0\r
+ Push ${MILESTONE} \r
+ Call VersionCheck\r
+ Pop $0\r
+ StrCmp $0 0 NoAskInstall\r
+ StrCmp $0 2 NoAskInstall\r
+ MessageBox MB_YESNO "A newer Mono version is already installed. Still continue?" IDNO NoInstall\r
+\r
+ NoAskInstall:\r
+\r
SetOutPath $INSTDIR\r
File /r "${SOURCE_INSTALL_DIR}"\r
WriteUninstaller Uninst.exe\r
;WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono\${MILESTONE} GtkSharpLibPath $INSTDIR\lib\r
WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Mono DefaultCLR ${MILESTONE}\r
\r
+ ; Mono Uninstall Entry in Windows Software List in the Control panel\r
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} DisplayName "Mono ${MILESTONE}"\r
+ WriteRegStr HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mono-${MILESTONE} UninstallString $INSTDIR\uninst.exe\r
+\r
;original string is like C:\mono-0.20\install\r
StrCpy $5 $INSTDIR \r
Push $5\r
FileWrite $0 "#!/bin/sh$\r$\n"
FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/monodis.exe "$$@"'
+FileWrite $0 '$6/bin/mono.exe $6/bin/monodis.exe "$$@"'
FileClose $0\r
\r
; create bin/monoresgen wrapper to be used if the user has cygwin\r
FileWrite $0 "#!/bin/sh$\r$\n"
FileWrite $0 "export MONO_PATH=$6/lib$\r$\n"
FileWrite $0 "export MONO_CFG_DIR=$6/etc/mono$\r$\n"
-FileWrite $0 '$6/bin/mono.exe $6/bin/ilasm.exe "$$@"'
+FileWrite $0 '$6/bin/mono.exe $6/bin/monoilasm.exe "$$@"'
FileClose $0\r
\r
; create bin/monosn wrapper to be used if the user has cygwin\r
FileWrite $0 ":done$\r$\n"\r
FileWrite $0 "setlocal$\r$\n"\r
FileWrite $0 'set path="%MONO_BASEPATH%\bin\;%MONO_BASEPATH%\lib\;%path%"$\r$\n'\r
-FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\ilasm.exe %MONOARGS%$\r$\n"\r
+FileWrite $0 "%MONO_BASEPATH%\bin\mono.exe %MONO_BASEPATH%\bin\monoilasm.exe %MONOARGS%$\r$\n"\r
FileWrite $0 "endlocal$\r$\n"\r
\r
FileClose $0\r
\r
FileClose $0\r
\r
+NoInstall:\r
SectionEnd\r
\r
; function StrReplace\r
Pop $1\r
Exch $0\r
FunctionEnd\r
+\r
+Function VersionCheck\r
+ Exch $0 ;second versionnumber\r
+ Exch\r
+ Exch $1 ;first versionnumber\r
+ Push $R0 ;counter for $0\r
+ Push $R1 ;counter for $1\r
+ Push $3 ;temp char\r
+ Push $4 ;temp string for $0\r
+ Push $5 ;temp string for $1\r
+ StrCpy $R0 "-1"\r
+ StrCpy $R1 "-1"\r
+ Start:\r
+ StrCpy $4 ""\r
+ DotLoop0:\r
+ IntOp $R0 $R0 + 1\r
+ StrCpy $3 $0 1 $R0\r
+ StrCmp $3 "" DotFound0\r
+ StrCmp $3 "." DotFound0\r
+ StrCpy $4 $4$3\r
+ Goto DotLoop0\r
+ DotFound0:\r
+ StrCpy $5 ""\r
+ DotLoop1:\r
+ IntOp $R1 $R1 + 1\r
+ StrCpy $3 $1 1 $R1\r
+ StrCmp $3 "" DotFound1\r
+ StrCmp $3 "." DotFound1\r
+ StrCpy $5 $5$3\r
+ Goto DotLoop1\r
+ DotFound1:\r
+ Strcmp $4 "" 0 Not4\r
+ StrCmp $5 "" Equal\r
+ Goto Ver2Less\r
+ Not4:\r
+ StrCmp $5 "" Ver2More\r
+ IntCmp $4 $5 Start Ver2Less Ver2More\r
+ Equal:\r
+ StrCpy $0 "0"\r
+ Goto Finish\r
+ Ver2Less:\r
+ StrCpy $0 "1"\r
+ Goto Finish\r
+ Ver2More:\r
+ StrCpy $0 "2"\r
+ Finish:\r
+ Pop $5\r
+ Pop $4\r
+ Pop $3\r
+ Pop $R1\r
+ Pop $R0\r
+ Pop $1\r
+ Exch $0\r
+FunctionEnd
\ No newline at end of file