Subversion Repositories gelsvn

Rev

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

Rev Author Line No. Line
239 bj 1
!include "LogicLib.nsh" 
242 bj 2
!include "WinMessages.NSH"
3
 
239 bj 4
; The name of the installer
5
Name "GEL Externals"
6
 
7
; The file to write
246 bj 8
OutFile "GELsetup.exe"
239 bj 9
 
10
; The default installation directory
247 bj 11
InstallDir $DOCUMENTS\GEL
239 bj 12
 
13
;--------------------------------
14
 
15
; Pages
16
 
17
Page directory
18
Page components
19
 
240 bj 20
InstType "Externals only"
21
InstType "Full"
239 bj 22
 
244 bj 23
Section "Externals" Externals_flag
239 bj 24
SectionIn 1 2
25
SectionEnd
26
 
244 bj 27
SectionGroup "GEL binary (ver. 0.1)"
28
 
29
Section "CGLA" CGLA_flag
240 bj 30
SectionIn 2
239 bj 31
SectionEnd
32
 
33
 
244 bj 34
Section "Geometry" Geometry_flag
35
SectionIn 2
36
SectionEnd
239 bj 37
 
244 bj 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
 
239 bj 58
Page instfiles
59
 
60
;--------------------------------
61
 
62
Section ""
244 bj 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 
239 bj 71
 
244 bj 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
239 bj 80
 
241 bj 81
  ;MessageBox MB_OK "Externals: $0 $\r$\n GEL: $1 $\r$\n "
239 bj 82
 
244 bj 83
  ${If} $Externals = 1
239 bj 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
 
245 bj 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
 
244 bj 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"
239 bj 110
 
242 bj 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"
239 bj 115
 
242 bj 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:
245 bj 124
    WriteRegExpandStr HKCU "Environment" "PATH" $0
242 bj 125
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
239 bj 126
 
242 bj 127
 
239 bj 128
SectionEnd ; end the section