Subversion Repositories gelsvn

Rev

Rev 242 | 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
8
OutFile "GELexternals.exe"
9
 
10
; The default installation directory
11
InstallDir $DESKTOP\test
12
 
13
;--------------------------------
14
 
244 bj 15
!macro GELModule mvar mstring
16
  ${If} ${mvar} = 1
17
    SetOutPath $INSTDIR\lib
18
    File current\lib\${mstring}.lib 
19
 
20
    SetOutPath $INSTDIR\include
21
    File /r current\include\${mstring}
22
  ${EndIf}
23
!macroend
24
 
239 bj 25
; Pages
26
 
27
Page directory
28
Page components
29
 
240 bj 30
InstType "Externals only"
31
InstType "Full"
239 bj 32
 
244 bj 33
Section "Externals" Externals_flag
239 bj 34
SectionIn 1 2
35
SectionEnd
36
 
244 bj 37
SectionGroup "GEL binary (ver. 0.1)"
38
 
39
Section "CGLA" CGLA_flag
240 bj 40
SectionIn 2
239 bj 41
SectionEnd
42
 
43
 
244 bj 44
Section "Geometry" Geometry_flag
45
SectionIn 2
46
SectionEnd
239 bj 47
 
244 bj 48
Section "GLGraphics" GLGraphics_flag
49
SectionIn 2
50
SectionEnd
51
 
52
Section "HMesh" HMesh_flag
53
SectionIn 2
54
SectionEnd
55
 
56
Section "LinAlg" LinAlg_flag
57
SectionIn 2
58
SectionEnd
59
 
60
Section "Util" Util_flag
61
SectionIn 2
62
SectionEnd
63
 
64
SectionGroupEnd
65
 
66
 
67
 
239 bj 68
Page instfiles
69
 
70
;--------------------------------
71
 
72
Section ""
244 bj 73
 
74
  Var /GLOBAL Externals
75
  Var /GLOBAL CGLA
76
  Var /GLOBAL Geometry 
77
  Var /GLOBAL GLGraphics 
78
  Var /GLOBAL HMesh 
79
  Var /GLOBAL LinAlg
80
  Var /GLOBAL Util 
239 bj 81
 
244 bj 82
  # Get flags of each section into appropriate variables
83
  SectionGetFlags ${Externals_flag} $Externals
84
  SectionGetFlags ${CGLA_flag} $CGLA 
85
  SectionGetFlags ${Geometry_flag} $Geometry
86
  SectionGetFlags ${GLGraphics_flag} $GLGraphics
87
  SectionGetFlags ${HMesh_flag} $HMesh
88
  SectionGetFlags ${LinAlg_flag} $LinAlg
89
  SectionGetFlags ${Util_flag} $Util
239 bj 90
 
241 bj 91
  ;MessageBox MB_OK "Externals: $0 $\r$\n GEL: $1 $\r$\n "
239 bj 92
 
244 bj 93
  ${If} $Externals = 1
239 bj 94
    SetOutPath $INSTDIR\bin
95
    File externals\bin\*.dll 
96
 
97
    SetOutPath $INSTDIR\lib
98
    File externals\lib\*.lib 
99
 
100
    SetOutPath $INSTDIR
101
    File /r externals\include
102
  ${EndIf}
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:
244 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