Subversion Repositories gelsvn

Rev

Rev 247 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 247 Rev 249
1
!include "LogicLib.nsh" 
1
!include "LogicLib.nsh" 
2
!include "WinMessages.NSH"
2
!include "WinMessages.NSH"
3
 
3
 
4
; The name of the installer
4
; The name of the installer
5
Name "GEL Externals"
5
Name "GEL Externals"
6
 
6
 
7
; The file to write
7
; The file to write
8
OutFile "GELsetup.exe"
8
OutFile "GELsetup.exe"
9
 
9
 
10
; The default installation directory
10
; The default installation directory
11
InstallDir $DOCUMENTS\GEL
11
InstallDir $DOCUMENTS\GEL
12
 
12
 
13
;--------------------------------
13
;--------------------------------
14
 
14
 
15
; Pages
15
; Pages
16
 
16
 
17
Page directory
17
Page directory
18
Page components
18
Page components
19
 
19
 
20
InstType "Externals only"
20
InstType "Externals only"
21
InstType "Full"
21
InstType "Full"
22
 
22
 
23
Section "Externals" Externals_flag
23
Section "Externals" Externals_flag
24
SectionIn 1 2
24
SectionIn 1 2
25
SectionEnd
25
SectionEnd
26
 
26
 
27
SectionGroup "GEL binary (ver. 0.1)"
27
SectionGroup "GEL binary (ver. 0.1)"
28
 
28
 
29
Section "CGLA" CGLA_flag
29
Section "CGLA" CGLA_flag
30
SectionIn 2
30
SectionIn 2
31
SectionEnd
31
SectionEnd
32
 
32
 
33
 
33
 
34
Section "Geometry" Geometry_flag
34
Section "Geometry" Geometry_flag
35
SectionIn 2
35
SectionIn 2
36
SectionEnd
36
SectionEnd
37
 
37
 
38
Section "GLGraphics" GLGraphics_flag
38
Section "GLGraphics" GLGraphics_flag
39
SectionIn 2
39
SectionIn 2
40
SectionEnd
40
SectionEnd
41
 
41
 
42
Section "HMesh" HMesh_flag
42
Section "HMesh" HMesh_flag
43
SectionIn 2
43
SectionIn 2
44
SectionEnd
44
SectionEnd
45
 
45
 
46
Section "LinAlg" LinAlg_flag
46
Section "LinAlg" LinAlg_flag
47
SectionIn 2
47
SectionIn 2
48
SectionEnd
48
SectionEnd
49
 
49
 
50
Section "Util" Util_flag
50
Section "Util" Util_flag
51
SectionIn 2
51
SectionIn 2
52
SectionEnd
52
SectionEnd
53
 
53
 
54
SectionGroupEnd
54
SectionGroupEnd
55
 
55
 
56
 
56
 
57
 
57
 
58
Page instfiles
58
Page instfiles
59
 
59
 
60
;--------------------------------
60
;--------------------------------
61
 
61
 
62
Section ""
62
Section ""
63
 
63
 
64
  Var /GLOBAL Externals
64
  Var /GLOBAL Externals
65
  Var /GLOBAL CGLA
65
  Var /GLOBAL CGLA
66
  Var /GLOBAL Geometry 
66
  Var /GLOBAL Geometry 
67
  Var /GLOBAL GLGraphics 
67
  Var /GLOBAL GLGraphics 
68
  Var /GLOBAL HMesh 
68
  Var /GLOBAL HMesh 
69
  Var /GLOBAL LinAlg
69
  Var /GLOBAL LinAlg
70
  Var /GLOBAL Util 
70
  Var /GLOBAL Util 
71
 
71
 
72
  # Get flags of each section into appropriate variables
72
  # Get flags of each section into appropriate variables
73
  SectionGetFlags ${Externals_flag} $Externals
73
  SectionGetFlags ${Externals_flag} $Externals
74
  SectionGetFlags ${CGLA_flag} $CGLA 
74
  SectionGetFlags ${CGLA_flag} $CGLA 
75
  SectionGetFlags ${Geometry_flag} $Geometry
75
  SectionGetFlags ${Geometry_flag} $Geometry
76
  SectionGetFlags ${GLGraphics_flag} $GLGraphics
76
  SectionGetFlags ${GLGraphics_flag} $GLGraphics
77
  SectionGetFlags ${HMesh_flag} $HMesh
77
  SectionGetFlags ${HMesh_flag} $HMesh
78
  SectionGetFlags ${LinAlg_flag} $LinAlg
78
  SectionGetFlags ${LinAlg_flag} $LinAlg
79
  SectionGetFlags ${Util_flag} $Util
79
  SectionGetFlags ${Util_flag} $Util
80
  
80
  
81
  ;MessageBox MB_OK "Externals: $0 $\r$\n GEL: $1 $\r$\n "
81
  ;MessageBox MB_OK "Externals: $0 $\r$\n GEL: $1 $\r$\n "
82
 
82
 
83
  ${If} $Externals = 1
83
  ${If} $Externals = 1
84
    SetOutPath $INSTDIR\bin
84
    SetOutPath $INSTDIR\bin
85
    File externals\bin\*.dll 
85
    File externals\bin\*.dll 
86
   
86
   
87
    SetOutPath $INSTDIR\lib
87
    SetOutPath $INSTDIR\lib
88
    File externals\lib\*.lib 
88
    File externals\lib\*.lib 
89
 
89
 
90
    SetOutPath $INSTDIR
90
    SetOutPath $INSTDIR
91
    File /r externals\include
91
    File /r externals\include
92
  ${EndIf}
92
  ${EndIf}
93
 
93
 
94
  !macro GELModule mvar mstring
94
  !macro GELModule mvar mstring
95
    ${If} ${mvar} = 1
95
    ${If} ${mvar} = 1
96
      SetOutPath $INSTDIR\lib
96
      SetOutPath $INSTDIR\lib
97
      File current\lib\${mstring}.lib 
97
      File current\lib\${mstring}.lib 
98
 
98
 
99
      SetOutPath $INSTDIR\include
99
      SetOutPath $INSTDIR\include
100
      File /r current\include\${mstring}
100
      File /r current\include\${mstring}
101
    ${EndIf}
101
    ${EndIf}
102
  !macroend
102
  !macroend
103
 
103
 
104
  !insertmacro GELModule $CGLA "CGLA"
104
  !insertmacro GELModule $CGLA "CGLA"
105
  !insertmacro GELModule $Geometry "Geometry"
105
  !insertmacro GELModule $Geometry "Geometry"
106
  !insertmacro GELModule $GLGraphics "GLGraphics"
106
  !insertmacro GELModule $GLGraphics "GLGraphics"
107
  !insertmacro GELModule $HMesh "HMesh"
107
  !insertmacro GELModule $HMesh "HMesh"
108
  !insertmacro GELModule $LinAlg "LinAlg"
108
  !insertmacro GELModule $LinAlg "LinAlg"
109
  !insertmacro GELModule $Util "Util"
109
  !insertmacro GELModule $Util "Util"
110
 
110
 
111
  # Create Environment variables
111
  # Create Environment variables
112
  WriteRegExpandStr HKCU "Environment" "GEL_INCLUDE" "$INSTDIR\include"
112
  WriteRegExpandStr HKCU "Environment" "GEL_INCLUDE" "$INSTDIR\include"
113
  WriteRegExpandStr HKCU "Environment" "GEL_LIB" "$INSTDIR\lib"
113
  WriteRegExpandStr HKCU "Environment" "GEL_LIB" "$INSTDIR\lib"
114
  WriteRegExpandStr HKCU "Environment" "GEL_BIN" "$INSTDIR\bin"
114
  WriteRegExpandStr HKCU "Environment" "GEL_BIN" "$INSTDIR\bin"
115
 
115
 
116
  # Add %GEL_BIN% to path
116
  # Add %GEL_BIN% to path
117
  ReadRegStr $1 HKCU "Environment" "PATH"
117
  ReadRegStr $1 HKCU "Environment" "PATH"
118
  StrCpy $2 $1 1 -1 # copy last char
118
  StrCpy $2 $1 1 -1 # copy last char
119
  StrCmp $2 ";" 0 +2 # if last char == ;
119
  StrCmp $2 ";" 0 +2 # if last char == ;
120
    StrCpy $1 $1 -1 # remove last char
120
    StrCpy $1 $1 -1 # remove last char
121
  StrCmp $1 "" AddToPath_NTdoIt
121
  StrCmp $1 "" AddToPath_NTdoIt
122
    StrCpy $0 "$1;%GEL_BIN%"
122
    StrCpy $0 "$1;%GEL_BIN%"
123
  AddToPath_NTdoIt:
123
  AddToPath_NTdoIt:
124
    WriteRegExpandStr HKCU "Environment" "PATH" $0
124
    WriteRegExpandStr HKCU "Environment" "PATH" $0
125
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
125
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
126
 
126
 
127
 
127
 
128
SectionEnd ; end the section
128
SectionEnd ; end the section
129
 
129