228 |
bj |
1 |
; ----------------------------------------------------------------------------
|
|
|
2 |
;
|
|
|
3 |
; AutoIt Version: 3.1.0
|
|
|
4 |
; Author: A.N.Other <myemail@nowhere.com>
|
|
|
5 |
;
|
|
|
6 |
; Script Function:
|
|
|
7 |
; Template AutoIt script.
|
|
|
8 |
;
|
|
|
9 |
; ----------------------------------------------------------------------------
|
|
|
10 |
|
|
|
11 |
#include-once
|
|
|
12 |
#include <GUIConstants.au3>
|
|
|
13 |
|
|
|
14 |
Func EnvLocal($scope)
|
|
|
15 |
|
|
|
16 |
Local $envloc = "HKCU\Environment"
|
|
|
17 |
If $scope = "System" Then
|
|
|
18 |
$envloc = "HKLM\System\ControlSet001\Control\Session Manager\Environment"
|
|
|
19 |
EndIf
|
|
|
20 |
return $envloc
|
231 |
bj |
21 |
|
228 |
bj |
22 |
Endfunc
|
|
|
23 |
|
|
|
24 |
Func updatePath(ByRef $inpubox)
|
|
|
25 |
Local $text = FileSelectFolder ( "Select folder", "" , 1 )
|
|
|
26 |
|
|
|
27 |
If $text <> "" Then
|
|
|
28 |
GUICtrlSetData($inpubox, $text)
|
|
|
29 |
EndIf
|
|
|
30 |
EndFunc
|
|
|
31 |
|
237 |
bj |
32 |
Func useExisting(ByRef $inpubox, $scope)
|
|
|
33 |
$envloc = EnvLocal($scope)
|
|
|
34 |
$prevPath = RegRead($envloc,"GEL_LIB")
|
|
|
35 |
|
|
|
36 |
If $prevPath <> "" Then
|
|
|
37 |
GUICtrlSetData($inpubox, StringTrimRight($prevPath, 4 ))
|
|
|
38 |
EndIf
|
|
|
39 |
|
|
|
40 |
EndFunc
|
|
|
41 |
|
228 |
bj |
42 |
Func installLibs($GELpath, $scope)
|
|
|
43 |
|
|
|
44 |
$envloc = EnvLocal($scope)
|
|
|
45 |
|
231 |
bj |
46 |
RegWrite($envloc,"GEL_INCLUDE","REG_EXPAND_SZ",$GELpath & "\include")
|
|
|
47 |
RegWrite($envloc,"GEL_LIB","REG_EXPAND_SZ",$GELpath & "\lib")
|
|
|
48 |
RegWrite($envloc,"GEL_BIN","REG_EXPAND_SZ",$GELpath & "\bin")
|
228 |
bj |
49 |
|
|
|
50 |
$Path = RegREad($envloc,"Path")
|
232 |
bj |
51 |
RegWrite($envloc,"Path","REG_EXPAND_SZ",$Path & ";" & "%GEL_BIN%")
|
228 |
bj |
52 |
|
231 |
bj |
53 |
DirCreate($GELpath)
|
|
|
54 |
FileInstall("externals.exe", $GELpath, 1)
|
|
|
55 |
|
|
|
56 |
FileChangeDir ( $GELpath )
|
|
|
57 |
RunWait("externals.exe")
|
|
|
58 |
FileDelete("externals.exe")
|
238 |
bj |
59 |
|
|
|
60 |
$res = "Copied files to : " & $GELpath & @LF
|
|
|
61 |
$res = $res & "Changed env var GEL_LIB to : " & $GELpath & "\lib" & @LF
|
|
|
62 |
$res = $res & "Changed env var GEL_INCLUDE to : " & $GELpath & "\include" & @LF
|
|
|
63 |
$res = $res & "Changed env var GEL_BIN to : " & $GELpath & "\bin" & @LF
|
|
|
64 |
$res = $res & "Added %GEL_BIN% to Path"
|
|
|
65 |
|
|
|
66 |
MsgBox(4096, "Result", $res , 20)
|
228 |
bj |
67 |
EndFunc
|
|
|
68 |
|
231 |
bj |
69 |
Func installAll($GELpath, $scope)
|
|
|
70 |
|
|
|
71 |
$envloc = EnvLocal($scope)
|
|
|
72 |
|
|
|
73 |
RegWrite($envloc,"GEL_INCLUDE","REG_EXPAND_SZ",$GELpath & "\include")
|
|
|
74 |
RegWrite($envloc,"GEL_LIB","REG_EXPAND_SZ",$GELpath & "\lib")
|
|
|
75 |
RegWrite($envloc,"GEL_BIN","REG_EXPAND_SZ",$GELpath & "\bin")
|
|
|
76 |
|
|
|
77 |
$Path = RegREad($envloc,"Path")
|
232 |
bj |
78 |
RegWrite($envloc,"Path","REG_EXPAND_SZ",$Path & ";" & "%GEL_BIN%")
|
231 |
bj |
79 |
|
|
|
80 |
DirCreate($GELpath)
|
|
|
81 |
FileInstall("externals.exe", $GELpath, 1)
|
|
|
82 |
FileInstall("gel.exe", $GELpath, 1)
|
|
|
83 |
|
|
|
84 |
FileChangeDir ( $GELpath )
|
|
|
85 |
RunWait("externals.exe")
|
|
|
86 |
RunWait("gel.exe")
|
|
|
87 |
FileDelete("externals.exe")
|
|
|
88 |
FileDelete("gel.exe")
|
238 |
bj |
89 |
|
|
|
90 |
$res = "Copied files to : " & $GELpath & @LF
|
|
|
91 |
$res = $res & "Changed env var GEL_LIB to : " & $GELpath & "\lib" & @LF
|
|
|
92 |
$res = $res & "Changed env var GEL_INCLUDE to : " & $GELpath & "\include" & @LF
|
|
|
93 |
$res = $res & "Changed env var GEL_BIN to : " & $GELpath & "\bin" & @LF
|
|
|
94 |
$res = $res & "Added %GEL_BIN% to Path"
|
|
|
95 |
|
|
|
96 |
MsgBox(4096, "Result", $res , 20)
|
231 |
bj |
97 |
|
|
|
98 |
EndFunc
|
|
|
99 |
|
228 |
bj |
100 |
Func makeSolution($GELpath, $msvcVer, $libType, $scope)
|
|
|
101 |
|
|
|
102 |
$envloc = EnvLocal($scope)
|
|
|
103 |
|
231 |
bj |
104 |
$vcver = "vc71"
|
|
|
105 |
$tlib = "msvc"
|
|
|
106 |
$texe = "msvcexe"
|
|
|
107 |
If $msvcVer = "2005" Then
|
|
|
108 |
$vcver = "vc8"
|
|
|
109 |
$tlib = "msvc8lib"
|
|
|
110 |
$texe = "msvc8exe"
|
|
|
111 |
EndIf
|
228 |
bj |
112 |
|
231 |
bj |
113 |
$mwcfile="GEL.mwc"
|
|
|
114 |
If $libType = "Single Library" Then
|
|
|
115 |
$mwcfile="GEL_single.mwc"
|
|
|
116 |
EndIf
|
|
|
117 |
|
|
|
118 |
Run("perl MPC\mwc.pl -type " & $vcver & " -include makefiles -relative GEL_ROOT= -ti lib:" & $tlib & " -ti dll_exe:" & $texe & " " & $mwcfile)
|
|
|
119 |
|
228 |
bj |
120 |
|
231 |
bj |
121 |
|
228 |
bj |
122 |
|
|
|
123 |
EndFunc
|
|
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
|