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

4.8
Last change on this file since d24a72f was d24a72f, checked in by Chris Johns <chrisj@…>, on 01/11/08 at 22:38:36

2008-01-11 Chris Johns <chisj@…>

  • expat-version: New.
  • build-exes.sh: Fix the size calculation.
  • build-rpms.sh: Add expax support. Clean the BUILD, RPM and SRPM directories. Delete the RPM database if cleaning.
  • msys-path.nsi: Add comments.
  • rtems-tools.nsi: Fix the uninstall targets check.
  • target-section-text, targets: Add bfin target.
  • upload.sh: Upload only the specific version of files.
  • version: Build 17.
  • 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 ; Check the result.
124 Pop $R0
125 Push $R0
126 Push $INSTDIR
127 Push '\\'
128 Pop $R0
129 Call StrSlash
130 Pop $R1
131 Pop $R0
132 DetailPrint "Setting MSYS fstab: $R1 -> /opt/rtems-${PRODUCT_VERSION}"
133 StrCpy $R1 "$R1 /opt/rtems-${PRODUCT_VERSION}$\n"
134 FileOpen $9 "$R0\etc\fstab" a
135 ifErrors 0 +3
136   ; Create the file.
137   MessageBox MB_OK "Cannot open $R0\etc\fstab. MSYS mount point not added."
138   Goto Close
139 FileSeek $9 0 SET
140ReadLoop:
141 FileRead $9 $R2
142 ifErrors Append
143 StrCmp $R1 $R2 Close ReadLoop
144Append:
145 FileSeek $9 0 END
146 StrCpy $R2 $R2 1 -1
147 StrCmp $R2 "$\n" +2 0
148 FileWrite $9 "$\n"
149 FileWrite $9 $R1
150Close:
151 FileClose $9
152 ClearErrors
153FunctionEnd
Note: See TracBrowser for help on using the repository browser.