Subversion Repositories gelsvn

Rev

Rev 249 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 249 Rev 253
Line 1... Line 1...
1
!include "LogicLib.nsh" 
1
!include "LogicLib.nsh" 
2
!include "WinMessages.NSH"
2
!include "WinMessages.NSH"
3
 
3
 
-
 
4
!define TEMP1 $R0 ;Temp variable
-
 
5
 
4
; The name of the installer
6
; The name of the installer
5
Name "GEL Externals"
7
Name "GEL Externals"
6
 
8
 
7
; The file to write
9
; The file to write
8
OutFile "GELsetup.exe"
10
OutFile "GELsetup.exe"
9
 
11
 
10
; The default installation directory
12
; The default installation directory
11
InstallDir $DOCUMENTS\GEL
13
InstallDir $DOCUMENTS\GEL
12
 
14
 
-
 
15
; Show install details
-
 
16
ShowInstDetails show
-
 
17
 
-
 
18
;Things that need to be extracted on startup (keep these lines before any File command!)
-
 
19
;Only useful for BZIP2 compression
-
 
20
;Use ReserveFile for your own InstallOptions INI files too!
-
 
21
 
-
 
22
ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
-
 
23
ReserveFile "custdir.ini"
-
 
24
 
-
 
25
 
13
;--------------------------------
26
;--------------------------------
14
 
27
 
15
; Pages
28
; Pages
16
 
29
 
17
Page directory
30
;Page directory
-
 
31
Page custom SetCustom "" ": Installation Folder"
18
Page components
32
Page components
19
 
33
 
20
InstType "Externals only"
34
InstType "Externals only"
21
InstType "Full"
35
InstType "Full"
22
 
36
 
Line 57... Line 71...
57
 
71
 
58
Page instfiles
72
Page instfiles
59
 
73
 
60
;--------------------------------
74
;--------------------------------
61
 
75
 
-
 
76
 
-
 
77
 
62
Section ""
78
Section ""
63
 
79
 
-
 
80
  ReadINIStr $INSTDIR "$PLUGINSDIR\custdir.ini" "Field 2" "State"
-
 
81
   
64
  Var /GLOBAL Externals
82
  Var /GLOBAL Externals
65
  Var /GLOBAL CGLA
83
  Var /GLOBAL CGLA
66
  Var /GLOBAL Geometry 
84
  Var /GLOBAL Geometry 
67
  Var /GLOBAL GLGraphics 
85
  Var /GLOBAL GLGraphics 
68
  Var /GLOBAL HMesh 
86
  Var /GLOBAL HMesh 
Line 107... Line 125...
107
  !insertmacro GELModule $HMesh "HMesh"
125
  !insertmacro GELModule $HMesh "HMesh"
108
  !insertmacro GELModule $LinAlg "LinAlg"
126
  !insertmacro GELModule $LinAlg "LinAlg"
109
  !insertmacro GELModule $Util "Util"
127
  !insertmacro GELModule $Util "Util"
110
 
128
 
111
  # Create Environment variables
129
  # 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
 
130
 
-
 
131
  ReadINIStr $R2 "$PLUGINSDIR\custdir.ini" "Field 3" "State"
-
 
132
  ReadINIStr $R3 "$PLUGINSDIR\custdir.ini" "Field 4" "State"
-
 
133
 
-
 
134
  ${If} $R2 = 0
-
 
135
    WriteRegExpandStr 'HKLM' "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "GEL_INCLUDE" "$INSTDIR\include"
-
 
136
    WriteRegExpandStr 'HKLM' "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "GEL_LIB" "$INSTDIR\lib"
-
 
137
    WriteRegExpandStr 'HKLM' "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "GEL_BIN" "$INSTDIR\bin"
-
 
138
 
-
 
139
  ${Else}
-
 
140
    WriteRegExpandStr 'HKCU' "Environment" "GEL_INCLUDE" "$INSTDIR\include"
-
 
141
    WriteRegExpandStr 'HKCU' "Environment" "GEL_LIB" "$INSTDIR\lib"
-
 
142
    WriteRegExpandStr 'HKCU' "Environment" "GEL_BIN" "$INSTDIR\bin"
-
 
143
 
-
 
144
  ${EndIf}
-
 
145
 
-
 
146
  
116
  # Add %GEL_BIN% to path
147
  # Add %GEL_BIN% to path
-
 
148
  
-
 
149
  ${If} $R2 = 0
-
 
150
    ReadRegStr $1 'HKLM' "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
-
 
151
  ${Else}
117
  ReadRegStr $1 HKCU "Environment" "PATH"
152
    ReadRegStr $1 'HKCU' "Environment" "PATH"
-
 
153
  ${EndIf}
-
 
154
 
118
  StrCpy $2 $1 1 -1 # copy last char
155
  StrCpy $2 $1 1 -1 # copy last char
119
  StrCmp $2 ";" 0 +2 # if last char == ;
156
  StrCmp $2 ";" 0 +2 # if last char == ;
120
    StrCpy $1 $1 -1 # remove last char
157
    StrCpy $1 $1 -1 # remove last char
121
  StrCmp $1 "" AddToPath_NTdoIt
158
  StrCmp $1 "" AddToPath_NTdoIt
122
    StrCpy $0 "$1;%GEL_BIN%"
159
    StrCpy $0 "$1;%GEL_BIN%"
123
  AddToPath_NTdoIt:
160
  AddToPath_NTdoIt:
-
 
161
    ${If} $R2 = 0
-
 
162
      WriteRegExpandStr 'HKLM' "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0
-
 
163
    ${Else}
124
    WriteRegExpandStr HKCU "Environment" "PATH" $0
164
      WriteRegExpandStr 'HKCU' "Environment" "PATH" $0
-
 
165
    ${EndIf}
125
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
166
    SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
126
 
167
 
127
 
168
 
128
SectionEnd ; end the section
169
SectionEnd ; end the section
-
 
170
 
-
 
171
Function .onInit
-
 
172
 
-
 
173
  ;Extract InstallOptions files
-
 
174
  ;$PLUGINSDIR will automatically be removed when the installer closes
-
 
175
 
-
 
176
  InitPluginsDir
-
 
177
  File /oname=$PLUGINSDIR\custdir.ini "custdir.ini"
-
 
178
  WriteINIStr  "$PLUGINSDIR\custdir.ini" "Field 2" "State" $INSTDIR
-
 
179
 
-
 
180
 
-
 
181
FunctionEnd
-
 
182
 
-
 
183
Function SetCustom
-
 
184
 
-
 
185
  ;Display the InstallOptions dialog
-
 
186
 
-
 
187
  Push ${TEMP1}
-
 
188
 
-
 
189
    InstallOptions::dialog "$PLUGINSDIR\custdir.ini"
-
 
190
    Pop ${TEMP1}
-
 
191
 
-
 
192
  Pop ${TEMP1}
-
 
193
 
-
 
194
FunctionEnd