/[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 2001 by jpye, Wed Feb 27 05:40:40 2008 UTC revision 2002 by jpye, Fri Feb 27 00:49:31 2009 UTC
# Line 86  Var /GLOBAL TCLDOWNLOAD Line 86  Var /GLOBAL TCLDOWNLOAD
86    
87  Var /GLOBAL ASCENDINIFOUND  Var /GLOBAL ASCENDINIFOUND
88    
89  Function .onInit  ; .onInit has been moved to after section decls so that they can be references
     StrCpy $PYINSTALLED ""  
     StrCpy $TCLINSTALLED ""  
     StrCpy $ASCENDINIFOUND ""  
     StrCpy $PDFINSTALLED ""  
       
     ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32"  
   
     Call DetectPython  
     Pop $PYOK  
     Pop $PYPATH  
       
     Call DetectGTK  
     Pop $GTKOK  
     Pop $GTKPATH  
   
     Call DetectGlade  
     Pop $GLADEOK  
     Pop $GLADEPATH    
       
     Call DetectTcl  
     Pop $TCLOK  
     Pop $TCLPATH  
       
     Call DetectPyGTK  
     Pop $PYGTKOK  
   
     Call DetectPyGObject  
     Pop $PYGOBJECTOK  
   
     Call DetectPyCairo  
     Pop $PYCAIROOK  
       
     StrCpy $PATH "$DEFAULTPATH;$PYPATH;$GTKPATH"  
   
 FunctionEnd  
90    
91  ;------------------------------------------------------------  ;------------------------------------------------------------
92  ; DOWNLOAD AND INSTALL DEPENDENCIES FIRST  ; DOWNLOAD AND INSTALL DEPENDENCIES FIRST
# Line 341  SectionEnd Line 306  SectionEnd
306    
307  ;--------------------------------  ;--------------------------------
308    
309  Section "PyGTK GUI"  Section "PyGTK GUI" sect_pygtk
310      ; Check the dependencies of the PyGTK GUI before proceding...      ; Check the dependencies of the PyGTK GUI before proceding...
311      ${If} $PYOK == 'NOK'      ${If} $PYOK == 'NOK'
312          MessageBox MB_OK "PyGTK GUI can not be installed, because Python was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(PYPATH=$PYPATH)"          MessageBox MB_OK "PyGTK GUI can not be installed, because Python was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(PYPATH=$PYPATH)"
# Line 422  SectionEnd Line 387  SectionEnd
387    
388  ;---------------------------------  ;---------------------------------
389    
390  Section "Tcl/Tk GUI"  Section "Tcl/Tk GUI" sect_tcltk
391    
392      ${If} $TCLOK != 'OK'      ${If} $TCLOK != 'OK'
393          MessageBox MB_OK "Tck/Tk GUI can not be installed, because ActiveTcl was not found on this system. If do you want to use the Tcl/Tk GUI, please check the installation instructions ($TCLPATH)"          MessageBox MB_OK "Tck/Tk GUI can not be installed, because ActiveTcl was not found on this system. If do you want to use the Tcl/Tk GUI, please check the installation instructions ($TCLPATH)"
# Line 443  SectionEnd Line 408  SectionEnd
408    
409  ;---------------------------------  ;---------------------------------
410    
411  Section "Documentation"  Section "Documentation" sect_doc
412      SetOutPath $INSTDIR      SetOutPath $INSTDIR
413      File "..\doc\book.pdf"      File "..\doc\book.pdf"
414      StrCpy $PDFINSTALLED "1"      StrCpy $PDFINSTALLED "1"
# Line 451  Section "Documentation" Line 416  Section "Documentation"
416  SectionEnd  SectionEnd
417    
418  ; Optional section (can be disabled by the user)  ; Optional section (can be disabled by the user)
419  Section "Start Menu Shortcuts"  Section "Start Menu Shortcuts" sect_menu
420        
421      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "StartMenu" 1      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "StartMenu" 1
422    
# Line 487  SectionEnd Line 452  SectionEnd
452  ;------------------------------------------------------------------  ;------------------------------------------------------------------
453  ; HEADER FILES for DEVELOPERS  ; HEADER FILES for DEVELOPERS
454    
455  Section /o "Header files (for developers)"  Section /o "Header files (for developers)" sect_devel
456      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1      WriteRegDWORD HKLM "SOFTWARE\ASCEND" "HeaderFiles" 1
457    
458      SetOutPath $INSTDIR\include      SetOutPath $INSTDIR\include
# Line 504  Section "Uninstall" Line 469  Section "Uninstall"
469  ;--- python components ---  ;--- python components ---
470    
471      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"
472      IntCmp $0 0 unnopython unpython      ${If} $0 <> 0
473        
474  unpython:          DetailPrint "--- REMOVING PYTHON COMPONENTS ---"
475      DetailPrint "--- REMOVING PYTHON COMPONENTS ---"          Delete $INSTDIR\_ascpy.pyd
476      Delete $INSTDIR\_ascpy.pyd          Delete $INSTDIR\ascend
477      Delete $INSTDIR\ascend          Delete $INSTDIR\*.py
478      Delete $INSTDIR\*.py          Delete $INSTDIR\*.pyc
479      Delete $INSTDIR\*.pyc          Delete $INSTDIR\glade\*.glade
480      Delete $INSTDIR\glade\*.glade          Delete $INSTDIR\glade\*.png
481      Delete $INSTDIR\glade\*.png          Delete $INSTDIR\glade\*.svg
482      Delete $INSTDIR\glade\*.svg          RmDir $INSTDIR\glade
483      RmDir $INSTDIR\glade          Delete $INSTDIR\ascend-doc.ico
     Delete $INSTDIR\ascend-doc.ico  
484    
485  ;--- file association (for Python GUI) ---  ;--- file association (for Python GUI) ---
486        
487      DetailPrint "--- REMOVING FILE ASSOCIATION ---"          DetailPrint "--- REMOVING FILE ASSOCIATION ---"
488      ;start of restore script          ;start of restore script
489      ReadRegStr $1 HKCR ".a4c" ""          ReadRegStr $1 HKCR ".a4c" ""
490      ${If} $1 == "ASCEND.model"          ${If} $1 == "ASCEND.model"
491          ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"              ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
492          ${If} $1 == ""              ${If} $1 == ""
493              ; nothing to restore: delete it                  ; nothing to restore: delete it
494              DeleteRegKey HKCR ".a4c"                  DeleteRegKey HKCR ".a4c"
495          ${Else}              ${Else}
496              WriteRegStr HKCR ".a4c" "" $1                  WriteRegStr HKCR ".a4c" "" $1
497                ${EndIf}
498                DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"
499          ${EndIf}          ${EndIf}
         DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4C"  
     ${EndIf}  
500    
501      ReadRegStr $1 HKCR ".a4l" ""              ReadRegStr $1 HKCR ".a4l" ""    
502      ${If} $1 == "ASCEND.model"          ${If} $1 == "ASCEND.model"
503          ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"              ReadRegStr $1 HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
504          ${If} $1 == ""              ${If} $1 == ""
505              ; nothing to restore: delete it                  ; nothing to restore: delete it
506              DeleteRegKey HKCR ".a4l"                  DeleteRegKey HKCR ".a4l"
507          ${Else}              ${Else}
508              WriteRegStr HKCR ".a4l" "" $1                  WriteRegStr HKCR ".a4l" "" $1
509                ${EndIf}
510                DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"
511          ${EndIf}          ${EndIf}
         DeleteRegValue HKLM "SOFTWARE\ASCEND" "BackupAssocA4L"  
     ${EndIf}  
512    
513      DeleteRegKey HKCR "ASCEND.model" ;Delete key with association settings          DeleteRegKey HKCR "ASCEND.model" ;Delete key with association settings
514    
515      System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'          System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
516      ;rest of script          ;rest of script
517    
518  unnopython:      ${EndIf}
519    
520  ;--- tcl/tk components ---  ;--- tcl/tk components ---
521    
522      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"
523      ${If} $0 != 0      ${If} $0 <> 0
524          DetailPrint "--- REMOVING TCL/TK COMPONENTS ---"          DetailPrint "--- REMOVING TCL/TK COMPONENTS ---"
525          Delete $INSTDIR\ascendtcl.dll          Delete $INSTDIR\ascendtcl.dll
526          Delete $INSTDIR\ascend4.exe          Delete $INSTDIR\ascend4.exe
# Line 566  unnopython: Line 530  unnopython:
530  ;--- documentation ---  ;--- documentation ---
531    
532      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "PDF"      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "PDF"
533      ${If} $0 != 0      ${If} $0 <> 0
534          DetailPrint "--- REMOVING DOCUMENTATION ---"          DetailPrint "--- REMOVING DOCUMENTATION ---"
535          Delete $INSTDIR\book.pdf          Delete $INSTDIR\book.pdf
536      ${EndIf}      ${EndIf}
# Line 574  unnopython: Line 538  unnopython:
538  ;--- header files ---  ;--- header files ---
539    
540      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "HeaderFiles"      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "HeaderFiles"
541      ${If} $0 != 0      ${If} $0 <> 0
542          DetailPrint "--- REMOVING HEADER FILES ---"          DetailPrint "--- REMOVING HEADER FILES ---"
543          RMDir /r $INSTDIR\include          RMDir /r $INSTDIR\include
544      ${EndIf}      ${EndIf}
# Line 582  unnopython: Line 546  unnopython:
546  ;--- start menu ---  ;--- start menu ---
547    
548      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "StartMenu"      ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "StartMenu"
549      ${If} $0 != 0      ${If} $0 <> 0
550          ; Remove shortcuts, if any          ; Remove shortcuts, if any
551          DetailPrint "--- REMOVING START MENU SHORTCUTS ---"          DetailPrint "--- REMOVING START MENU SHORTCUTS ---"
552          RmDir /r "$SMPROGRAMS\ASCEND"          RmDir /r "$SMPROGRAMS\ASCEND"
# Line 630  SectionEnd Line 594  SectionEnd
594  !include "detect.nsi"  !include "detect.nsi"
595    
596  !include "ascendini.nsi"  !include "ascendini.nsi"
597    
598    Function .onInit
599        StrCpy $PYINSTALLED ""
600        StrCpy $TCLINSTALLED ""
601        StrCpy $ASCENDINIFOUND ""
602        StrCpy $PDFINSTALLED ""
603        
604        ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32"
605    
606        Call DetectPython
607        Pop $PYOK
608        Pop $PYPATH
609        
610        Call DetectGTK
611        Pop $GTKOK
612        Pop $GTKPATH
613    
614        Call DetectGlade
615        Pop $GLADEOK
616        Pop $GLADEPATH  
617        
618        Call DetectTcl
619        Pop $TCLOK
620        Pop $TCLPATH
621        
622        Call DetectPyGTK
623        Pop $PYGTKOK
624    
625        Call DetectPyGObject
626        Pop $PYGOBJECTOK
627    
628        Call DetectPyCairo
629        Pop $PYCAIROOK
630        
631        StrCpy $PATH "$DEFAULTPATH;$PYPATH;$GTKPATH"
632    
633        ReadRegStr $0 HKLM "SOFTWARE\ASCEND" "Install_Dir"
634        ${If} $0 != ""  
635            ;MessageBox MB_OK "Previous installation detected..."
636            ; If user previous deselected Tcl/Tk, then deselect it by
637            ; default now, i.e don't force the user to install it.
638            ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk"
639            ${If} $0 = 0
640                ;MessageBox MB_OK "Tcl/Tk was previously deselected"
641                SectionGetFlags "${sect_tcltk}" $1
642                IntOp $1 $1 ^ ${SF_SELECTED}
643                SectionSetFlags "${sect_tcltk}" $1
644            ${Else}
645                ; If previously installed, force it to stay installed;
646                ; the only way to uninstall a component is via complete
647                ; uninstall.
648                SectionGetFlags "${sect_tcltk}" $1
649                IntOp $1 $1 ^ ${SF_RO}
650                SectionSetFlags "${sect_tcltk}" $1
651            ${EndIf}
652    
653            ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python"
654            ${If} $0 = 0
655                ;MessageBox MB_OK "Python was previously deselected"
656                SectionGetFlags "${sect_pygtk}" $1
657                IntOp $1 $1 ^ ${SF_SELECTED}
658                SectionSetFlags "${sect_pygtk}" $1
659            ${Else}
660                SectionGetFlags "${sect_pygtk}" $1
661                IntOp $1 $1 ^ ${SF_RO}
662                SectionSetFlags "${sect_pygtk}" $1      
663            ${EndIf}
664    
665            ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "PDF"
666            ${If} $0 = 0
667                ;MessageBox MB_OK "Documentation was previously deselected"
668                SectionGetFlags "${sect_doc}" $1
669                IntOp $1 $1 ^ ${SF_SELECTED}
670                SectionSetFlags "${sect_doc}" $1
671            ${Else}
672                SectionGetFlags "${sect_doc}" $1
673                IntOp $1 $1 ^ ${SF_RO}
674                SectionSetFlags "${sect_doc}" $1
675            ${EndIf}
676    
677            ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "StartMenu"
678            ${If} $0 = 0
679                ;MessageBox MB_OK "Start Menu was previously deselected"
680                SectionGetFlags "${sect_menu}" $1
681                IntOp $1 $1 ^ ${SF_SELECTED}
682                SectionSetFlags "${sect_menu}" $1
683            ${Else}
684                SectionGetFlags "${sect_menu}" $1
685                IntOp $1 $1 ^ ${SF_RO}
686                SectionSetFlags "${sect_menu}" $1
687            ${EndIf}
688            
689            ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "HeaderFiles"
690            ${If} $0 <> 0
691                ;MessageBox MB_OK "Header files were previously selected"
692                SectionGetFlags "${sect_devel}" $1
693                IntOp $1 $1 | ${SF_SELECTED}
694                IntOp $1 $1 | ${SF_RO}
695                SectionSetFlags "${sect_devel}" $1
696            ${EndIf}
697        ${EndIf}    
698    
699    FunctionEnd

Legend:
Removed from v.2001  
changed lines
  Added in v.2002

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