1 | Function MsysPath |
---|
2 | Push $R0 |
---|
3 | ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MSYS-1.0_is1" "Inno Setup: App Path" |
---|
4 | Exch $R0 |
---|
5 | FunctionEnd |
---|
6 | |
---|
7 | Function MsysDTKPath |
---|
8 | Push $R0 |
---|
9 | ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MSYS-DTK_is1" "Inno Setup: App Path" |
---|
10 | Exch $R0 |
---|
11 | FunctionEnd |
---|
12 | |
---|
13 | Function MSYSCheckExes |
---|
14 | Exch $R0 |
---|
15 | DetailPrint "Checking for MSYS $R0\bin\sh.exe." |
---|
16 | IfFileExists "$R0\bin\sh.exe" +5 0 |
---|
17 | DetailPrint "Could not find $R0\bin\sh.exe." |
---|
18 | StrCpy $R0 "$R0\bin\sh.exe" |
---|
19 | Exch $R0 |
---|
20 | Return |
---|
21 | DetailPrint "Checking for MSYS $R0\bin\m4.exe." |
---|
22 | IfFileExists "$R0\bin\m4.exe" +5 0 |
---|
23 | DetailPrint "Could not find $R0\bin\m4.exe." |
---|
24 | StrCpy $R0 "$R0\bin\m4.exe" |
---|
25 | Exch $R0 |
---|
26 | Return |
---|
27 | DetailPrint "Checking for MSYS $R0\bin\perl.exe." |
---|
28 | IfFileExists "$R0\bin\perl.exe" +5 0 |
---|
29 | DetailPrint "Could not find $R0\bin\perl.exe." |
---|
30 | StrCpy $R0 "$R0\bin\perl.exe" |
---|
31 | Exch $R0 |
---|
32 | Return |
---|
33 | StrCpy $R0 "ok" |
---|
34 | Exch $R0 |
---|
35 | FunctionEnd |
---|
36 | |
---|
37 | Function MSYSDetect |
---|
38 | Push $R0 |
---|
39 | Push $R1 |
---|
40 | StrCpy $R1 "c:\msys\1.0" |
---|
41 | DetailPrint "Checking MSYS default install path: $R1" |
---|
42 | Push $R1 |
---|
43 | Call MSYSCheckExes |
---|
44 | Pop $R0 |
---|
45 | StrCmp $R0 "ok" Found |
---|
46 | DetailPrint "Checking Registry for MSYS Installed Path" |
---|
47 | Call MsysPath |
---|
48 | Pop $R0 |
---|
49 | ifErrors 0 +3 |
---|
50 | MessageBox MB_OK "MSYS Not Installed. Please install MSYS." |
---|
51 | Abort |
---|
52 | DetailPrint "Checking Registry for MSYS DTK Installed Path" |
---|
53 | Call MsysDTKPath |
---|
54 | Pop $R1 |
---|
55 | ifErrors 0 +3 |
---|
56 | MessageBox MB_OK "MSYS DTK Not Installed. Please install MSYS DTK." |
---|
57 | Abort |
---|
58 | StrCmp $R0 $R1 +3 0 |
---|
59 | MessageBox MB_OK "MSYS and MSYS DTK installed to different paths. This is not supported." |
---|
60 | Abort |
---|
61 | Push $R0 |
---|
62 | Call MSYSCheckExes |
---|
63 | Pop $R0 |
---|
64 | StrCmp $R0 "ok" Found |
---|
65 | MessageBox MB_OK "MSYS Executable '$R0' not found. Please install." |
---|
66 | Abort |
---|
67 | Found: |
---|
68 | StrCpy $R0 $R1 |
---|
69 | DetailPrint "MSYS Found: $R0" |
---|
70 | Pop $R1 |
---|
71 | Exch $R0 |
---|
72 | FunctionEnd |
---|
73 | |
---|
74 | Function MSYSDetectSilent |
---|
75 | Push $R0 |
---|
76 | Push $R1 |
---|
77 | StrCpy $R1 "c:\msys\1.0" |
---|
78 | DetailPrint "Checking MSYS default install path: $R1" |
---|
79 | Push $R1 |
---|
80 | Call MSYSCheckExes |
---|
81 | Pop $R0 |
---|
82 | StrCmp $R0 "ok" Done |
---|
83 | DetailPrint "Checking Registry for MSYS Installed Path" |
---|
84 | Call MsysPath |
---|
85 | Pop $R0 |
---|
86 | ifErrors 0 +3 |
---|
87 | StrCpy $R1 "not-found" |
---|
88 | Goto Done |
---|
89 | DetailPrint "Checking Registry for MSYS DTK Installed Path" |
---|
90 | Call MsysDTKPath |
---|
91 | Pop $R1 |
---|
92 | ifErrors 0 +3 |
---|
93 | StrCpy $R1 "not-found" |
---|
94 | Goto Done |
---|
95 | StrCmp $R0 $R1 +3 0 |
---|
96 | StrCpy $R1 "not-found" |
---|
97 | Goto Done |
---|
98 | Push $R0 |
---|
99 | Call MSYSCheckExes |
---|
100 | Pop $R0 |
---|
101 | StrCmp $R0 "ok" Done |
---|
102 | StrCpy $R1 "not-found" |
---|
103 | Goto Done |
---|
104 | Done: |
---|
105 | StrCpy $R0 $R1 |
---|
106 | DetailPrint "MSYS Result: $R0" |
---|
107 | Pop $R1 |
---|
108 | Exch $R0 |
---|
109 | FunctionEnd |
---|