/[cvs]/joko/ToolBox/Windows/w2hfax-installer/w2hfax.nsi
ViewVC logotype

Diff of /joko/ToolBox/Windows/w2hfax-installer/w2hfax.nsi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Thu Mar 17 15:10:11 2005 UTC revision 1.2 by joko, Wed Mar 23 01:56:03 2005 UTC
# Line 13  Line 13 
13  Name "w2hfax"  Name "w2hfax"
14    
15  ; The file to write  ; The file to write
16  OutFile "w2hfax.exe"  OutFile "w2hfax_setup.exe"
17    
18  ; The default installation directory  ; The default installation directory
19  InstallDir $PROGRAMFILES\w2hfax-test  InstallDir $PROGRAMFILES\w2hfax-test
# Line 24  InstallDirRegKey HKLM "Software\NSIS_w2h Line 24  InstallDirRegKey HKLM "Software\NSIS_w2h
24    
25  Var redmonInstDir  Var redmonInstDir
26    
27    
28    
29    
30  ; --------------------------------  ; --------------------------------
31  ;   Pages  ;   Pages
32  ; --------------------------------  ; --------------------------------
# Line 36  UninstPage uninstConfirm Line 39  UninstPage uninstConfirm
39  UninstPage instfiles  UninstPage instfiles
40    
41    
42    
43  ; --------------------------------  ; --------------------------------
44  ;   The stuff to install  ;   The stuff to install
45  ; --------------------------------  ; --------------------------------
46    
47  ;Section "w2hfax (required)"  
48  Section "w2hfax"  Var python_path
49    Var python_version
50    Var python_url
51    Var python_msi
52    
53    
54    Section "Python" IDX_PYTHON
55      Call install_python
56      Call check_python
57    SectionEnd
58    
59    Section "Python for Win32 Extensions" IDX_PYTHONWIN
60      Call install_pythonwin
61      Call check_pythonwin
62    SectionEnd
63    
64    
65    Section "w2hfax" IDX_W2HFAX
66    
67    SetDetailsPrint both    SetDetailsPrint both
68    DetailPrint "Installing w2hfax..."    DetailPrint "Installing w2hfax..."
# Line 70  Section "w2hfax" Line 91  Section "w2hfax"
91    ;nsExec::Exec "$INSTDIR\hfaxcom.py"    ;nsExec::Exec "$INSTDIR\hfaxcom.py"
92    ; TODO: Use $pythonInstDir here!    ; TODO: Use $pythonInstDir here!
93    nsExec::Exec "python $INSTDIR\hfaxcom.py"    nsExec::Exec "python $INSTDIR\hfaxcom.py"
94      
95      ; TODO: (pre-)configure w2hfax here!
96    
97  SectionEnd  SectionEnd
98    
99    
100  Section "RedMon Port Redirection Monitor"  Section "RedMon Port Redirection Monitor" IDX_REDMON
101    
102    SetDetailsPrint both    SetDetailsPrint both
103    DetailPrint "Installing RedMon Port Redirection Monitor..."    DetailPrint "Installing RedMon Port Redirection Monitor..."
# Line 88  Section "RedMon Port Redirection Monitor Line 111  Section "RedMon Port Redirection Monitor
111        
112    ; Put file there    ; Put file there
113    File "C:\tmp\w2hfax-make\redmon17de\*.*"    File "C:\tmp\w2hfax-make\redmon17de\*.*"
114      ; TODO: integrate into here to use current $INSTDIR
115    File "redmon_configure.reg"    File "redmon_configure.reg"
116        
117    ; Write the installation path into the registry    ; Write the installation path into the registry
# Line 104  Section "RedMon Port Redirection Monitor Line 128  Section "RedMon Port Redirection Monitor
128    nsExec::Exec "$redmonInstDir\setup.exe"    nsExec::Exec "$redmonInstDir\setup.exe"
129        
130    DetailPrint "Configuring RedMon Port Redirection Monitor..."    DetailPrint "Configuring RedMon Port Redirection Monitor..."
131      ; TODO: integrate into here to use current $INSTDIR
132    nsExec::Exec "$redmonInstDir\redmon_configure.reg"    nsExec::Exec "$redmonInstDir\redmon_configure.reg"
133        
134  SectionEnd  SectionEnd
135    
136    
137  ; Optional section (can be disabled by the user)  ; Optional section (can be disabled by the user)
138  Section "Start Menu Shortcuts"  Section "Start Menu Shortcuts" IDX_STARTMENU
139    
140    SetDetailsPrint both    SetDetailsPrint both
141    DetailPrint "Installing Start Menu and Desktop Shortcuts..."    DetailPrint "Installing Start Menu and Desktop Shortcuts..."
# Line 122  Section "Start Menu Shortcuts" Line 147  Section "Start Menu Shortcuts"
147  SectionEnd  SectionEnd
148    
149    
150    
151  ; --------------------------------  ; --------------------------------
152  ;   Uninstaller  ;   Uninstaller
153  ; --------------------------------  ; --------------------------------
154    
155  Section "Uninstall"  Section "Uninstall" IDX_UNINSTALL
156    
157    ; ------------------    ; ------------------
158    ;  uninstall redmon    ;  uninstall redmon
# Line 168  Section "Uninstall" Line 194  Section "Uninstall"
194    RMDir "$INSTDIR"    RMDir "$INSTDIR"
195    
196  SectionEnd  SectionEnd
197    
198    
199    ; --------------------------------
200    ;   Functions
201    ; --------------------------------
202    
203    Function check_python
204    
205      SetDetailsPrint both
206      DetailPrint "Checking for Python installation..."
207      
208      ClearErrors
209      
210      ReadRegStr $python_path HKLM Software\Python\PythonCore\2.4\InstallPath ""
211      IfErrors +3
212        StrCpy $python_version "2.4"
213        Goto found_python
214        
215      ReadRegStr $python_path HKLM Software\Python\PythonCore\2.3\InstallPath ""
216      IfErrors +3
217        StrCpy $python_version "2.3"
218        Goto found_python
219        
220      ReadRegStr $python_path HKLM Software\Python\PythonCore\2.2\InstallPath ""
221      IfErrors +3
222        StrCpy $python_version "2.2"
223        Goto found_python
224      
225      Goto no_python
226      
227      found_python:
228      ; check if python.exe is really present
229      ClearErrors
230      IfFileExists $python_path\python.exe 0 +2
231      DetailPrint "Found Python $python_version at: $python_path."
232      Return
233      
234      no_python:
235      ; error: no python
236      ;MessageBox MB_OK "No Python installation found (checked HKLM\Software\Python\PythonCore\2.3 and HKLM\Software\Python\PythonCore\2.2)."
237      ;Call install_python
238      SetErrors
239    
240    FunctionEnd
241    
242    
243    
244    Function install_python
245    
246      IfFileExists "$EXEDIR\python-2.4.msi" 0 +2
247        StrCpy $python_msi "$EXEDIR\python-2.4.msi"
248      IfFileExists "$INSTDIR\python-2.4.msi" 0 +2
249        StrCpy $python_msi "$INSTDIR\python-2.4.msi"
250      
251      ;MessageBox MB_OK $python_msi
252      StrCmp $python_msi "" 0 run_setup
253    
254      SetDetailsPrint textonly
255      DetailPrint "Downloading Python 2.3"
256      SetDetailsPrint listonly
257      
258      StrCpy $python_url "http://www.python.org/ftp/python/2.4/python-2.4.msi"
259      MessageBox MB_YESNO "Download Python 2.3 from $python_url?" IDYES NoCancelAbort
260        ;Abort ; causes uninstaller to not quit.
261        Return
262        
263      NoCancelAbort:
264        NSISdl::download $python_url $INSTDIR\python-2.4.msi
265        
266      run_setup:
267        IfFileExists $python_msi 0 +10
268          SetDetailsPrint textonly
269          DetailPrint "Installing Python..."
270          SetDetailsPrint listonly
271          ExecWait 'msiexec /i "$python_msi"'
272    
273    FunctionEnd
274    
275    
276    Function check_pythonwin
277    
278      SetDetailsPrint both
279      DetailPrint "Checking for installation of 'Python for Win32 Extensions'..."
280      IfFileExists "$python_path\Lib\site-packages\win32com\server\register.py" 0 no_pythonwin
281        Return
282      
283      no_pythonwin:
284        SetErrors
285    
286    FunctionEnd
287    
288    
289    Function install_pythonwin
290    
291      ; installer exe
292      StrCmp $python_version "2.2" 0 +2
293        StrCpy $R0 "pywin32-203.win32-py2.2.exe"
294      StrCmp $python_version "2.3" 0 +2
295        StrCpy $R0 "pywin32-203.win32-py2.3.exe"
296      StrCmp $python_version "2.4" 0 +2
297        StrCpy $R0 "pywin32-203.win32-py2.4.exe"
298    
299      ; download base
300      StrCpy $R1 "http://mesh.dl.sourceforge.net/sourceforge/pywin32/$R0"
301    
302      IfFileExists "$EXEDIR\$R0" 0 +2
303        StrCpy $R2 "$EXEDIR\R0"
304      IfFileExists "$INSTDIR\$R0" 0 +2
305        StrCpy $R2 "$INSTDIR\$R0"
306      
307      ;MessageBox MB_OK $R2
308      StrCmp $R2 "" 0 run_setup
309    
310      SetDetailsPrint textonly
311      DetailPrint "Downloading 'Python for Win32 Extensions'"
312      SetDetailsPrint listonly
313      
314      MessageBox MB_YESNO "Download 'Python for Win32 Extensions' from $R1?" IDYES NoCancelAbort
315        ;Abort ; causes uninstaller to not quit.
316        Return
317        
318      NoCancelAbort:
319        NSISdl::download $R1 $INSTDIR\$R0
320        StrCpy $R2 "$INSTDIR\$R0"
321        
322      run_setup:
323        IfFileExists $R2 0 +10
324          SetDetailsPrint textonly
325          DetailPrint "Installing 'Python for Win32 Extensions'..."
326          SetDetailsPrint listonly
327          ExecWait '"$R2"'
328    
329    FunctionEnd
330    
331    
332    ; --------------------------------
333    ;   Startup
334    ; --------------------------------
335    Function .onInit
336    
337      Call check_python
338      IfErrors 0 python_found
339        SectionSetFlags ${IDX_PYTHON} 1
340        Return
341    
342      python_found:
343        SectionSetFlags ${IDX_PYTHON} 0
344        SectionSetText ${IDX_PYTHON} "Python (found version $python_version)"
345        ;Return
346    
347    
348      Call check_pythonwin
349      IfErrors 0 pythonwin_found
350        SectionSetFlags ${IDX_PYTHONWIN} 1
351        Return
352    
353      pythonwin_found:
354        SectionSetFlags ${IDX_PYTHONWIN} 0
355        SectionSetText ${IDX_PYTHONWIN} "Python for Win32 Extensions (found)"
356        ;Return
357    
358    FunctionEnd

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed