/[ascend]/trunk/nsis/installer.nsi
ViewVC logotype

Diff of /trunk/nsis/installer.nsi

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

revision 2026 by jpye, Fri Feb 27 00:49:31 2009 UTC revision 2027 by jpye, Thu Apr 30 08:27:56 2009 UTC
# Line 248  Section "ASCEND (required)" Line 248  Section "ASCEND (required)"
248      ; Write default values of ASCENDLIBRARY and ASCENDSOLVERS (user can override with env vars)      ; Write default values of ASCENDLIBRARY and ASCENDSOLVERS (user can override with env vars)
249      WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDLIBRARY" "$INSTDIR\models"      WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDLIBRARY" "$INSTDIR\models"
250      WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDSOLVERS" "$INSTDIR\solvers"      WriteRegStr HKLM SOFTWARE\ASCEND "ASCENDSOLVERS" "$INSTDIR\solvers"
251            
     ; Create 'ascend.bat' batch file for launching the PyGTK GUI.  
     ClearErrors  
     FileOpen $0 $INSTDIR\ascend.bat w  
     ${If} ${Errors}  
         MessageBox MB_OK "The 'ascend.bat' file was not installed properly; problems writing to that file."  
     ${Else}  
         FileWrite $0 "@echo off"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "set PATH=$PATH"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "cd "  
         FileWrite $0 $INSTDIR  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "$PYPATH\python "  
         FileWriteByte $0 "34"  
         FileWrite $0 "$INSTDIR\ascend"  
         FileWriteByte $0 "34"  
         FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileClose $0  
     ${EndIf}  
       
     ; Create 'ascend-config.bat' batch file for launching the python script 'ascend-config'.  
     ClearErrors  
     FileOpen $0 $INSTDIR\ascend-config.bat w  
     ${If} ${Errors}  
         MessageBox MB_OK "The 'ascend-config.bat' file was not installed properly; problems writing to that file."    
     ${Else}  
         FileWrite $0 "@echo off"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "set PATH=$PATH"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "cd "  
         FileWrite $0 $INSTDIR  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileWrite $0 "$PYPATH\python "  
         FileWriteByte $0 "34"  
         FileWrite $0 "$INSTDIR\ascend-config"  
         FileWriteByte $0 "34"  
         FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"  
         FileWriteByte $0 "13"  
         FileWriteByte $0 "10"  
         FileClose $0  
     ${EndIf}  
       
252      Return      Return
253  SectionEnd  SectionEnd
254    
# Line 325  Section "PyGTK GUI" sect_pygtk Line 273  Section "PyGTK GUI" sect_pygtk
273    
274          DetailPrint "--- PYTHON INTERFACE ---"          DetailPrint "--- PYTHON INTERFACE ---"
275    
276          ; Set output path to the installation directory.          ; File icon
277          SetOutPath $INSTDIR          SetOutPath $INSTDIR
278            File "..\pygtk\glade\ascend-doc.ico"
279            File "..\pygtk\ascend"      
280    
281          ; Python interface          ; Python interface
282          File /nonfatal "..\pygtk\_ascpy.pyd"          SetOutPath $INSTDIR\python
283            File "..\pygtk\_ascpy.pyd"
284          File "..\pygtk\*.py"          File "..\pygtk\*.py"
285          File "..\pygtk\ascend"          
286          File "..\pygtk\glade\ascend-doc.ico"          ; GLADE assets
   
287          SetOutPath $INSTDIR\glade          SetOutPath $INSTDIR\glade
288          File "..\pygtk\glade\*.glade"          File "..\pygtk\glade\*.glade"
289          File "..\pygtk\glade\*.png"          File "..\pygtk\glade\*.png"
# Line 342  Section "PyGTK GUI" sect_pygtk Line 292  Section "PyGTK GUI" sect_pygtk
292          StrCpy $PYINSTALLED "1"          StrCpy $PYINSTALLED "1"
293          WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1          WriteRegDWORD HKLM "SOFTWARE\ASCEND" "Python" 1
294    
295            ; Create 'ascend.bat' batch file for launching the PyGTK GUI.
296            ClearErrors
297            FileOpen $0 $INSTDIR\ascend.bat w
298            ${If} ${Errors}
299                MessageBox MB_OK "The 'ascend.bat' file was not installed properly; problems writing to that file."
300            ${Else}
301                FileWrite $0 "@echo off"
302                FileWriteByte $0 "13"
303                FileWriteByte $0 "10"
304                FileWrite $0 "set PATH=$PATH"
305                FileWriteByte $0 "13"
306                FileWriteByte $0 "10"
307                FileWrite $0 "cd "
308                FileWrite $0 $INSTDIR
309                FileWriteByte $0 "13"
310                FileWriteByte $0 "10"
311                FileWrite $0 "$PYPATH\python "
312                FileWriteByte $0 "34"
313                FileWrite $0 "$INSTDIR\python\ascend"
314                FileWriteByte $0 "34"
315                FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
316                FileWriteByte $0 "13"
317                FileWriteByte $0 "10"
318                FileClose $0
319            ${EndIf}
320    
321          ;---- file association ----          ;---- file association ----
322    
323          ; back up old value of .a4c file association          ; back up old value of .a4c file association
# Line 376  a4lnobkp: Line 352  a4lnobkp:
352          WriteRegStr HKCR "ASCEND.model\DefaultIcon" "" "$INSTDIR\ascend-doc.ico"          WriteRegStr HKCR "ASCEND.model\DefaultIcon" "" "$INSTDIR\ascend-doc.ico"
353    
354  a4cskip:  a4cskip:
355          WriteRegStr HKCR "ASCEND.model\shell\open\command" "" '$PYPATH\pythonw "$INSTDIR\ascend" "%1"'          WriteRegStr HKCR "ASCEND.model\shell\open\command" "" '$PYPATH\pythonw.exe "$INSTDIR\ascend" "%1"'
356    
357          System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'          System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
358    
# Line 394  Section "Tcl/Tk GUI" sect_tcltk Line 370  Section "Tcl/Tk GUI" sect_tcltk
370      ${Else}      ${Else}
371          DetailPrint "--- TCL/TK INTERFACE ---"          DetailPrint "--- TCL/TK INTERFACE ---"
372          SetOutPath $INSTDIR\tcltk          SetOutPath $INSTDIR\tcltk
373          File /r /x .svn "..\tcltk\TK\*"          ; FIXME we should be a bit more selective here?
374            File /r /x .svn "..\tcltk\tk\*"
375          SetOutPath $INSTDIR          SetOutPath $INSTDIR
376          File "..\tcltk\generic\interface\ascendtcl.dll"          File "..\tcltk\interface\ascendtcl.dll"
377          File "..\tcltk\generic\interface\ascend4.exe"          File "..\tcltk\interface\ascend4.exe"
378    
379          StrCpy $TCLINSTALLED "1"          StrCpy $TCLINSTALLED "1"
380          WriteRegDWORD HKLM "SOFTWARE\ASCEND" "TclTk" 1          WriteRegDWORD HKLM "SOFTWARE\ASCEND" "TclTk" 1
# Line 455  SectionEnd Line 432  SectionEnd
432  Section /o "Header files (for developers)" sect_devel  Section /o "Header files (for developers)" sect_devel
433      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1
434    
435      SetOutPath $INSTDIR\include      SetOutPath $INSTDIR\include\ascend
436      File /r /x .svn "..\base\generic\*.h"      File /r /x .svn "..\ascend\*.h"
437        
438        ; Create 'ascend-config.bat' batch file for launching the python script 'ascend-config'.
439        ClearErrors
440        FileOpen $0 $INSTDIR\ascend-config.bat w
441        ${If} ${Errors}
442            MessageBox MB_OK "The 'ascend-config.bat' file was not installed properly; problems writing to that file."  
443        ${Else}
444            FileWrite $0 "@echo off"
445            FileWriteByte $0 "13"
446            FileWriteByte $0 "10"
447            FileWrite $0 "set PATH=$PATH"
448            FileWriteByte $0 "13"
449            FileWriteByte $0 "10"
450            FileWrite $0 "cd "
451            FileWrite $0 $INSTDIR
452            FileWriteByte $0 "13"
453            FileWriteByte $0 "10"
454            FileWrite $0 "$PYPATH\python "
455            FileWriteByte $0 "34"
456            FileWrite $0 "$INSTDIR\ascend-config"
457            FileWriteByte $0 "34"
458            FileWrite $0 " %1 %2 %3 %4 %5 %6 %7 %8"
459            FileWriteByte $0 "13"
460            FileWriteByte $0 "10"
461            FileClose $0
462        ${EndIf}
463      SetOutPath $INSTDIR      SetOutPath $INSTDIR
464  SectionEnd  SectionEnd
465    
# Line 472  Section "Uninstall" Line 474  Section "Uninstall"
474      ${If} $0 <> 0      ${If} $0 <> 0
475        
476          DetailPrint "--- REMOVING PYTHON COMPONENTS ---"          DetailPrint "--- REMOVING PYTHON COMPONENTS ---"
477          Delete $INSTDIR\_ascpy.pyd          Delete $INSTDIR\python\_ascpy.pyd
478          Delete $INSTDIR\ascend          Delete $INSTDIR\python\*.py
479          Delete $INSTDIR\*.py          Delete $INSTDIR\python\*.pyc
         Delete $INSTDIR\*.pyc  
480          Delete $INSTDIR\glade\*.glade          Delete $INSTDIR\glade\*.glade
481          Delete $INSTDIR\glade\*.png          Delete $INSTDIR\glade\*.png
482          Delete $INSTDIR\glade\*.svg          Delete $INSTDIR\glade\*.svg
         RmDir $INSTDIR\glade  
483          Delete $INSTDIR\ascend-doc.ico          Delete $INSTDIR\ascend-doc.ico
484            Delete $INSTDIR\ascend
485            Delete $INSTDIR\ascend.bat
486            RmDir $INSTDIR\glade
487            RmDir $INSTDIR\python
488    
489  ;--- file association (for Python GUI) ---  ;--- file association (for Python GUI) ---
490        
# Line 541  Section "Uninstall" Line 545  Section "Uninstall"
545      ${If} $0 <> 0      ${If} $0 <> 0
546          DetailPrint "--- REMOVING HEADER FILES ---"          DetailPrint "--- REMOVING HEADER FILES ---"
547          RMDir /r $INSTDIR\include          RMDir /r $INSTDIR\include
548            Delete $INSTDIR\ascend-config
549            Delete $INSTDIR\ascend-config.bat  
550      ${EndIf}      ${EndIf}
551            
552  ;--- start menu ---  ;--- start menu ---
# Line 562  Section "Uninstall" Line 568  Section "Uninstall"
568    
569      ; Remove files and uninstaller      ; Remove files and uninstaller
570    
     Delete $INSTDIR\ascend-config  
     Delete $INSTDIR\ascend-config.bat  
     Delete $INSTDIR\ascend.bat  
571      Delete $INSTDIR\ascend.dll      Delete $INSTDIR\ascend.dll
572      Delete $INSTDIR\LICENSE.txt      Delete $INSTDIR\LICENSE.txt
573      Delete $INSTDIR\README-windows.txt      Delete $INSTDIR\README-windows.txt

Legend:
Removed from v.2026  
changed lines
  Added in v.2027

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22