source: rtems/contrib/mingw/msys-path.nsi @ df16b8bf

4.104.114.95
Last change on this file since df16b8bf was 598aab1f, checked in by Chris Johns <chrisj@…>, on Aug 20, 2007 at 2:12:48 AM

2007-08-20 Chris Johns <chisj@…>

  • filewrite.nsi, getparameters.nsi, instance-check.nsi, mingw-path.nsi, sm-dummy.nsi, strslash.nsi, strstr.nsi, options.nsi: Added the shared between the 2 installer scripts.
  • msys-path.nsi: Fixed the last LF bug.
  • rtems-autotools.nsi, rtems-tools.nsi: Fixed the instance check, added a start menu, remove pages from target installers.
  • rtems.ini: Fixed the URL links. Added support link.
  • rtems_logo.bmp: Trimmed a little more to get a better image.
  • ba-wrap.sh: Stop on a error.
  • build-exes.sh: Use the option parameter variables. Change the order the section appear in the installer.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1;
2; $Id$
3;
4; RTEMS Tools Installer.
5;
6; Copyright Chris Johns (chrisj@rtems.org)
7;
8
9!include "${RTEMS_SOURCE}/strslash.nsi"
10
11Function MsysPath
12  Push $R0
13  ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MSYS-1.0_is1" "Inno Setup: App Path"
14  Exch $R0
15FunctionEnd
16
17Function MsysDTKPath
18  Push $R0
19  ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MSYS-DTK_is1" "Inno Setup: App Path"
20  Exch $R0
21FunctionEnd
22
23Function MSYSCheckExes
24  Exch $R0
25  DetailPrint "Checking for MSYS $R0\bin\sh.exe."
26  IfFileExists "$R0\bin\sh.exe" +5 0
27   DetailPrint "Could not find $R0\bin\sh.exe."
28   StrCpy $R0 "$R0\bin\sh.exe"
29   Exch $R0
30   Return
31  DetailPrint "Checking for MSYS $R0\bin\m4.exe."
32  IfFileExists "$R0\bin\m4.exe" +5 0
33   DetailPrint "Could not find $R0\bin\m4.exe."
34   StrCpy $R0 "$R0\bin\m4.exe"
35   Exch $R0
36   Return
37  DetailPrint "Checking for MSYS $R0\bin\perl.exe."
38  IfFileExists "$R0\bin\perl.exe" +5 0
39   DetailPrint "Could not find $R0\bin\perl.exe."
40   StrCpy $R0 "$R0\bin\perl.exe"
41   Exch $R0
42   Return
43  StrCpy $R0 "ok"
44  Exch $R0
45FunctionEnd
46
47Function MSYSDetect
48  Push $R0
49  Push $R1
50  StrCpy $R1 "c:\msys\1.0"
51  DetailPrint "Checking MSYS default install path: $R1"
52  Push $R1
53  Call MSYSCheckExes
54  Pop $R0
55  StrCmp $R0 "ok" Found
56  DetailPrint "Checking Registry for MSYS Installed Path"
57  Call MsysPath
58  Pop $R0
59  ifErrors 0 +3
60   MessageBox MB_OK "MSYS Not Installed. Please install MSYS from http://www.mingw.org/"
61   Abort
62  DetailPrint "Checking Registry for MSYS DTK Installed Path"
63  Call MsysDTKPath
64  Pop $R1
65  ifErrors 0 +3
66   MessageBox MB_OK "MSYS DTK Not Installed. Please install MSYS DTK from http://www.mingw.org/"
67   Abort
68  StrCmp $R0 $R1 +3 0
69   MessageBox MB_OK "MSYS and MSYS DTK installed to different paths. This is not supported."
70   Abort
71  Push $R0
72  Call MSYSCheckExes
73  Pop $R0
74  StrCmp $R0 "ok" Found
75   MessageBox MB_OK "MSYS Executable '$R0' not found. Please install from http://www.mingw.org/"
76   Abort
77 Found:
78  StrCpy $R0 $R1
79  DetailPrint "MSYS Found: $R0"
80  Pop $R1
81  Exch $R0
82FunctionEnd
83
84Function MSYSDetectSilent
85  Push $R0
86  Push $R1
87  StrCpy $R1 "c:\msys\1.0"
88  DetailPrint "Checking MSYS default install path: $R1"
89  Push $R1
90  Call MSYSCheckExes
91  Pop $R0
92  StrCmp $R0 "ok" Done
93  DetailPrint "Checking Registry for MSYS Installed Path"
94  Call MsysPath
95  Pop $R0
96  ifErrors 0 +3
97   StrCpy $R1 "not-found"
98   Goto Done
99  DetailPrint "Checking Registry for MSYS DTK Installed Path"
100  Call MsysDTKPath
101  Pop $R1
102  ifErrors 0 +3
103   StrCpy $R1 "not-found"
104   Goto Done
105  StrCmp $R0 $R1 +3 0
106   StrCpy $R1 "not-found"
107   Goto Done
108  Push $R0
109  Call MSYSCheckExes
110  Pop $R0
111  StrCmp $R0 "ok" Done
112   StrCpy $R1 "not-found"
113   Goto Done
114 Done:
115  StrCpy $R0 $R1
116  DetailPrint "MSYS Result: $R0"
117  Pop $R1
118  Exch $R0
119FunctionEnd
120
121Function MSYSFstabUpdate
122 Call MSYSDetectSilent
123 Pop $R0
124 Push $R0
125 Push $INSTDIR
126 Push '\\'
127 Pop $R0
128 Call StrSlash
129 Pop $R1
130 Pop $R0
131 DetailPrint "Setting MSYS fstab: $R1 -> /opt/rtems-${PRODUCT_VERSION}"
132 StrCpy $R1 "$R1 /opt/rtems-${PRODUCT_VERSION}$\n"
133 FileOpen $9 "$R0\etc\fstab" a
134 ifErrors 0 +3
135   MessageBox MB_OK "Cannot open $R0\etc\fstab. MSYS mount point not added."
136   Goto Close
137 FileSeek $9 0 SET
138ReadLoop:
139 FileRead $9 $R2
140 ifErrors Append
141 StrCmp $R1 $R2 Close ReadLoop
142Append:
143 FileSeek $9 0 END
144 StrCpy $R2 $R2 1 -1
145 StrCmp $R2 "$\n" +2 0
146 FileWrite $9 "$\n"
147 FileWrite $9 $R1
148Close:
149 FileClose $9
150 ClearErrors
151FunctionEnd
Note: See TracBrowser for help on using the repository browser.