Subversion Repositories gelsvn

Rev

Rev 247 | Rev 253 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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