11 |
|
|
12 |
Name "ASCEND ${VERSION}" |
Name "ASCEND ${VERSION}" |
13 |
|
|
|
;SetCompressor /SOLID zlib |
|
14 |
;SetCompressor /FINAL zlib |
;SetCompressor /FINAL zlib |
15 |
SetCompressor /SOLID lzma |
SetCompressor /SOLID lzma |
16 |
|
|
26 |
!define PYPATCH ".1" |
!define PYPATCH ".1" |
27 |
!endif |
!endif |
28 |
|
|
|
!ifndef INST64 |
|
|
!define INST64 1 |
|
|
!endif |
|
|
|
|
29 |
; The file to write |
; The file to write |
30 |
OutFile ${OUTFILE} |
OutFile ${OUTFILE} |
31 |
|
|
32 |
; The default installation directory |
; The default installation directory |
33 |
!if "${INST64}" != "0" |
!ifdef INST64 |
34 |
InstallDir $PROGRAMFILES64\ASCEND |
InstallDir $PROGRAMFILES64\ASCEND |
35 |
!else |
!else |
36 |
InstallDir $PROGRAMFILES32\ASCEND |
InstallDir $PROGRAMFILES32\ASCEND |
63 |
|
|
64 |
!define GTKSEARCHPATH "c:\GTK" |
!define GTKSEARCHPATH "c:\GTK" |
65 |
|
|
66 |
Var /GLOBAL DEFAULTPATH |
Var DEFAULTPATH |
67 |
Var /GLOBAL PYOK |
Var HAVE_PYTHON |
68 |
Var /GLOBAL PYPATH |
Var PYPATH |
69 |
Var /GLOBAL GTKOK |
Var HAVE_GTK |
70 |
Var /GLOBAL GTKPATH |
Var GTKPATH |
71 |
Var /GLOBAL PYGTKOK |
Var HAVE_PYGTK |
72 |
Var /GLOBAL PYGOBJECTOK |
Var HAVE_PYGOBJECT |
73 |
Var /GLOBAL PYCAIROOK |
Var HAVE_PYCAIRO |
74 |
Var /GLOBAL PYINSTALLED |
Var PYINSTALLED |
75 |
;Var /GLOBAL TCLOK |
|
76 |
;Var /GLOBAL TCLPATH |
Var PDFINSTALLED |
77 |
;Var /GLOBAL TCLINSTALLED |
|
78 |
|
Var PATH |
79 |
Var /GLOBAL PDFINSTALLED |
|
80 |
|
Var NEED_PYTHON |
81 |
Var /GLOBAL PATH |
Var NEED_GTK |
82 |
|
Var NEED_PYGTK |
83 |
Var /GLOBAL PYDOWNLOAD |
Var NEED_PYCAIRO |
84 |
Var /GLOBAL GTKDOWNLOAD |
Var NEED_PYGOBJECT |
85 |
;Var /GLOBAL TCLDOWNLOAD |
|
86 |
|
Var ASCENDINIFOUND |
87 |
Var /GLOBAL ASCENDINIFOUND |
Var ASCENDENVVARFOUND |
88 |
Var /GLOBAL ASCENDENVVARFOUND |
Var ASCENDLIBRARY |
|
Var /GLOBAL ASCENDLIBRARY |
|
89 |
|
|
90 |
; .onInit has been moved to after section decls so that they can be references |
; .onInit has been moved to after section decls so that they can be references |
91 |
|
|
92 |
;------------------------------------------------------------ |
;------------------------------------------------------------ |
93 |
; DOWNLOAD AND INSTALL DEPENDENCIES FIRST |
; DOWNLOAD AND INSTALL DEPENDENCIES FIRST |
94 |
|
|
95 |
|
; Use the official python.org Python packages |
96 |
!define PYTHON_VERSION "${PYVERSION}${PYPATCH}${PYARCH}" |
!define PYTHON_VERSION "${PYVERSION}${PYPATCH}${PYARCH}" |
97 |
!define PYTHON_FN "python-${PYTHON_VERSION}.msi" |
!define PYTHON_FN "python-${PYTHON_VERSION}.msi" |
98 |
!define PYTHON_URL "http://python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_FN}" |
!define PYTHON_URL "http://python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_FN}" |
99 |
!define PYTHON_CMD "msiexec /i $DAI_TMPFILE /passive ALLUSERS=1 TARGETDIR=c:\Python${PYVERSION}" |
!define PYTHON_CMD "msiexec /i $DAI_TMPFILE /passive ALLUSERS=1 TARGETDIR=c:\Python${PYVERSION}" |
|
!define PYTHON_MD5 "a69ce1b2d870be29befd1cefb4615d82" |
|
100 |
|
|
101 |
|
!define THIRDPARTY_DIR "http://sourceforge.net/projects/ascend-sim/files/thirdparty/" |
102 |
!define GTK_VER "2.22" |
!define GTK_VER "2.22" |
103 |
!define GTK_PATCH ".6" |
|
104 |
!define GTK_FN "pygtk-all-in-one-${GTK_VER}${GTK_PATCH}.win32-py${PYVERSION}.msi" |
!ifdef INST64 |
105 |
|
!define WINXX "win64" |
106 |
|
!define AMDXX ".win-amd64" |
107 |
|
!define GTK_PATCH ".1-20101227" |
108 |
|
!else |
109 |
|
!define WINXX "win32" |
110 |
|
!define AMDXX ".win32" |
111 |
|
!define GTK_PATCH ".0-20101016" |
112 |
|
!endif |
113 |
|
|
114 |
|
; Host our own GTK bundles, repackaged as installers. |
115 |
|
; User should still be able to use the ftp.gnome.org zip files, we just can't easily install them from here. |
116 |
|
; Also, but having GTK installer, we can store the installation location in the registry (and have both 64 and 32 bit versions) |
117 |
|
!define GTK_FN "gtk+_bundle_${GTK_VER}${GTK_PATCH}.win64-py${PYVERSION}.msi" |
118 |
!define GTK_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/${GTK_FN}" |
!define GTK_URL "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.22/${GTK_FN}" |
119 |
!define GTK_CMD "msiexec /i $DAI_TMPFILE TARGETDIR=c:\Python${PYVERSION} INSTALLLEVEL=1 ALLUSERS=1 /passive" |
!define GTK_MFT "gtk+-bundle_${GTK_VER}${GTK_PATCH}_${WINXX}.mft" |
120 |
!define GTK_MD5 "75cfe879a13ae99d5b19fee4f1597bb5" |
|
121 |
; FIXME shouldn't need to specify TARGETDIR here... |
; We will host the PyGTK, PyGObject and PyCairo dependencies on SF.net ourselves... for the moment. |
122 |
|
!define PYGTK_PATCH ".0" |
123 |
; passive install of pygtk 2.22.6 doesn't seem to work. |
!define PYCAIRO_VER "1.10.0" |
124 |
|
!define PYGOBJECT_VER "2.28.6" |
125 |
;!define TCL_VERSION "8.5.9.2" |
!define PYGTK_FN "pygtk-${GTK_VER}${PYGTK_PATCH}${AMDXX}-py${PYVERSION}.exe" |
126 |
;!define TCL_PATCH ".294317" |
!define PYCAIRO_FN "py2cairo-${PYCAIRO_VER}${AMDXX}-py${PYVERSION}.exe" |
127 |
;!define TCL_FN "ActiveTcl${TCL_VERSION}${TCL_PATCH}-win32-ix86-threaded.exe" |
!define PYGOBJECT_FN "pygobject-${PYGOBJECT_VER}${AMDXX}-py${PYVERSION}.exe" |
128 |
;!define TCL_URL "http://downloads.activestate.com/ActiveTcl/releases/${TCL_VERSION}/${TCL_FN}" |
!define PYGTK_URL "${THIRDPARTY_DIR}${PYGTK_FN}" |
129 |
;!define TCL_CMD "$DAI_TMPFILE" |
!define PYCAIRO_URL "${THIRDPARTY_DIR}${PYCAIRO_FN}" |
130 |
;!define TCL_MD5 "15d6b17d38e66a83956dc16b7d80fc59" |
!define PYGOBJECT_URL "${THIRDPARTY_DIR}${PYGTK_FN}" |
131 |
|
|
132 |
!include "download.nsi" |
!include "download.nsi" |
133 |
|
|
134 |
Section "-python" |
Section "-python" |
135 |
DetailPrint "--- DOWNLOAD PYTHON ---" |
DetailPrint "--- DOWNLOAD PYTHON ---" |
136 |
${If} $PYDOWNLOAD == '1' |
${If} $NEED_PYTHON == '1' |
137 |
!insertmacro downloadAndInstall "Python" "${PYTHON_URL}" "${PYTHON_FN}" "${PYTHON_CMD}" "${PYTHON_MD5}" |
!insertmacro downloadAndInstall "Python" "${PYTHON_URL}" "${PYTHON_FN}" "${PYTHON_CMD}" |
138 |
Call DetectPython |
Call DetectPython |
139 |
Pop $PYOK |
${If} $HAVE_PYTHON == 'NOK' |
|
Pop $PYPATH |
|
|
${If} $PYOK == 'NOK' |
|
140 |
MessageBox MB_OK "Python installation appears to have failed" |
MessageBox MB_OK "Python installation appears to have failed" |
141 |
${EndIf} |
${EndIf} |
142 |
${EndIf} |
${EndIf} |
143 |
SectionEnd |
SectionEnd |
144 |
; FIXME need to go back to using separate GTK, PyGTK, PyGObject, PyCairo installers :-( |
|
145 |
Section "-gtk" |
Section "-gtk" |
146 |
DetailPrint "--- DOWNLOAD PYGTK ---" |
DetailPrint "--- DOWNLOAD GTK ---" |
147 |
${If} $GTKDOWNLOAD == '1' |
${If} $NEED_GTK == '1' |
148 |
!insertmacro downloadAndInstall "PyGTK All-in-one" "${GTK_URL}" "${GTK_FN}" "${GTK_CMD}" "${GTK_MD5}" |
!insertmacro downloadAndInstall "GTK" "${GTK_URL}" "${GTK_FN}" "${GTK_CMD}" |
149 |
Call DetectGTK |
Call DetectGTK |
150 |
Pop $GTKOK |
${If} $HAVE_GTK == 'NOK' |
151 |
Pop $GTKPATH |
MessageBox MB_OK "GTK installation appears to have failed" |
152 |
|
${EndIf} |
153 |
; Call DetectTcl |
${EndIf} |
154 |
; Pop $TCLOK |
SectionEnd |
|
; Pop $TCLPATH |
|
155 |
|
|
156 |
|
Section "-pygtk" |
157 |
|
DetailPrint "--- DOWNLOAD PYGTK ---" |
158 |
|
${If} $NEED_PYGTK == '1' |
159 |
|
!insertmacro downloadAndInstall "PyGTK" "${PYGTK_URL}" "${PYGTK_FN}" "${PYGTK_CMD}" |
160 |
Call DetectPyGTK |
Call DetectPyGTK |
161 |
Pop $PYGTKOK |
${If} $HAVE_PYGTK == 'NOK' |
162 |
|
MessageBox MB_OK "PyGTK installation appears to have failed" |
163 |
Call DetectPyGObject |
${EndIf} |
164 |
Pop $PYGOBJECTOK |
${EndIf} |
165 |
|
SectionEnd |
166 |
|
|
167 |
|
Section "-pycairo" |
168 |
|
DetailPrint "--- DOWNLOAD PYCAIRO ---" |
169 |
|
${If} $NEED_PYCAIRO == '1' |
170 |
|
!insertmacro downloadAndInstall "PyCAIRO" "${PYCAIRO_URL}" "${PYCAIRO_FN}" "${PYCAIRO_CMD}" |
171 |
Call DetectPyCairo |
Call DetectPyCairo |
172 |
Pop $PYCAIROOK |
${If} $HAVE_PYCAIRO == 'NOK' |
173 |
|
MessageBox MB_OK "PyCairo installation appears to have failed" |
174 |
|
${EndIf} |
175 |
|
${EndIf} |
176 |
|
SectionEnd |
177 |
|
|
178 |
|
Section "-pygobject" |
179 |
|
DetailPrint "--- DOWNLOAD PYGOBJECT ---" |
180 |
|
${If} $NEED_PYGOBJECT == '1' |
181 |
|
!insertmacro downloadAndInstall "PyGObject" "${PYGOBJECT_URL}" "${PYGOBJECT_FN}" "${PYGOBJECT_CMD}" |
182 |
|
Call DetectPyGObject |
183 |
|
${If} $HAVE_PYGOBJECT == 'NOK' |
184 |
|
MessageBox MB_OK "PyGObject installation appears to have failed" |
185 |
|
${EndIf} |
186 |
${EndIf} |
${EndIf} |
187 |
SectionEnd |
SectionEnd |
|
;Section "-tcl" |
|
|
; DetailPrint "--- DOWNLOAD TCL/TK ---" |
|
|
; ${If} $TCLDOWNLOAD == '1' |
|
|
; !insertmacro downloadAndInstall "Tcl/Tk" "${TCL_URL}" "${TCL_FN}" "${TCL_CMD}" "${TCL_MD5}" |
|
|
; Call DetectTcl |
|
|
; Pop $TCLOK |
|
|
; Pop $TCLPATH |
|
|
; ${EndIf} |
|
|
;SectionEnd |
|
188 |
|
|
189 |
;------------------------------------------------------------------------ |
;------------------------------------------------------------------------ |
190 |
; INSTALL CORE STUFF including model library |
; INSTALL CORE STUFF including model library |
270 |
;-------------------------------- |
;-------------------------------- |
271 |
|
|
272 |
Section "PyGTK GUI" sect_pygtk |
Section "PyGTK GUI" sect_pygtk |
273 |
!if "${INST64}" != "0" |
!ifdef INST64 |
274 |
SetRegView 64 |
SetRegView 64 |
275 |
!endif |
!endif |
276 |
; Check the dependencies of the PyGTK GUI before proceding... |
; Check the dependencies of the PyGTK GUI before proceding... |
277 |
${If} $PYOK == 'NOK' |
${If} $HAVE_PYTHON == 'NOK' |
278 |
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)" |
279 |
${ElseIf} $GTKOK == 'NOK' |
${ElseIf} $HAVE_GTK == 'NOK' |
280 |
MessageBox MB_OK "PyGTK GUI cannot be installed, because GTK+ 2.x was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(GTKPATH=$GTKPATH)" |
MessageBox MB_OK "PyGTK GUI cannot be installed, because GTK+ 2.x was not found on this system.$\nIf you do want to use the PyGTK GUI, please check the installation instructions$\n$\n(GTKPATH=$GTKPATH)" |
281 |
${ElseIf} $PYGTKOK == "NOK" |
${ElseIf} $HAVE_PYGTK == "NOK" |
282 |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGTK was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGTK was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
283 |
${ElseIf} $PYCAIROOK == "NOK" |
${ElseIf} $HAVE_PYCAIRO == "NOK" |
284 |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyCairo was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyCairo was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
285 |
${ElseIf} $PYGOBJECTOK == "NOK" |
${ElseIf} $HAVE_PYGOBJECT == "NOK" |
286 |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGObject was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
MessageBox MB_OK "PyGTK GUI cannot be installed, because PyGObject was not found on this system.$\nPlease check the installation instructions.$\n$\n(PYPATH=$PYPATH)" |
287 |
${Else} |
${Else} |
288 |
;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH" |
;MessageBox MB_OK "Python: $PYPATH, GTK: $GTKPATH" |
487 |
; UNINSTALLER |
; UNINSTALLER |
488 |
|
|
489 |
Section "Uninstall" |
Section "Uninstall" |
490 |
!if "${INST64}" != "0" |
!ifdef INST64 |
491 |
SetRegView 64 |
SetRegView 64 |
492 |
!endif |
!endif |
493 |
|
|
627 |
!include "envvarwarning.nsi" |
!include "envvarwarning.nsi" |
628 |
|
|
629 |
Function .onInit |
Function .onInit |
630 |
!if "${INST64}" != "0" |
!ifdef INST64 |
631 |
${If} ${RunningX64} |
${If} ${RunningX64} |
632 |
MessageBox MB_OK "64-bit installer on 64-bit Windows (inst64= ${INST64})" |
MessageBox MB_OK "64-bit installer on 64-bit Windows." |
633 |
${Else} |
${Else} |
634 |
MessageBox MB_OK "This ASCEND installer is for 64-bit Windows versions only.\n\nVisit http://ascend4.org for 32-bit versions." |
MessageBox MB_OK "This ASCEND installer is for 64-bit Windows versions only.\n\nVisit http://ascend4.org for 32-bit versions." |
635 |
${EndIf} |
${EndIf} |
636 |
SetRegView 64 |
SetRegView 64 |
637 |
!else |
!else |
638 |
${If} ${RunningX64} |
${If} ${RunningX64} |
639 |
MessageBox MB_OK "32-bit installer on 64-bit Windows" |
MessageBox MB_OK "32-bit installer on 64-bit Windows." |
640 |
${Else} |
${Else} |
641 |
MessageBox MB_OK "32-bit installer on 32-bit Windows" |
MessageBox MB_OK "32-bit installer on 32-bit Windows." |
642 |
${EndIf} |
${EndIf} |
643 |
!endif |
!endif |
644 |
|
|
645 |
StrCpy $PYINSTALLED "" |
StrCpy $PYINSTALLED "" |
|
; StrCpy $TCLINSTALLED "" |
|
646 |
StrCpy $ASCENDINIFOUND "" |
StrCpy $ASCENDINIFOUND "" |
647 |
StrCpy $PDFINSTALLED "" |
StrCpy $PDFINSTALLED "" |
648 |
StrCpy $ASCENDENVVARFOUND "" |
StrCpy $ASCENDENVVARFOUND "" |
650 |
ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32" |
ExpandEnvStrings $DEFAULTPATH "%WINDIR%;%WINDIR%\system32" |
651 |
|
|
652 |
Call DetectPython |
Call DetectPython |
|
Pop $PYOK |
|
|
Pop $PYPATH |
|
|
|
|
653 |
Call DetectGTK |
Call DetectGTK |
|
Pop $GTKOK |
|
|
Pop $GTKPATH |
|
|
|
|
|
; Call DetectTcl |
|
|
; Pop $TCLOK |
|
|
; Pop $TCLPATH |
|
|
|
|
654 |
Call DetectPyGTK |
Call DetectPyGTK |
|
Pop $PYGTKOK |
|
|
|
|
655 |
Call DetectPyGObject |
Call DetectPyGObject |
|
Pop $PYGOBJECTOK |
|
|
|
|
656 |
Call DetectPyCairo |
Call DetectPyCairo |
|
Pop $PYCAIROOK |
|
657 |
|
|
658 |
MessageBox MB_OK "GTK path is $GTKPATH" |
MessageBox MB_OK "GTK path is $GTKPATH" |
659 |
StrCpy $PATH "$GTKPATH;$DEFAULTPATH;$PYPATH" |
StrCpy $PATH "$GTKPATH;$DEFAULTPATH;$PYPATH" |
661 |
ReadRegStr $0 HKLM "SOFTWARE\ASCEND" "Install_Dir" |
ReadRegStr $0 HKLM "SOFTWARE\ASCEND" "Install_Dir" |
662 |
${If} $0 != "" |
${If} $0 != "" |
663 |
;MessageBox MB_OK "Previous installation detected..." |
;MessageBox MB_OK "Previous installation detected..." |
|
; If user previous deselected Tcl/Tk, then deselect it by |
|
|
; default now, i.e don't force the user to install it. |
|
|
|
|
|
; ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "TclTk" |
|
|
; ${If} $0 = 0 |
|
|
; ;MessageBox MB_OK "Tcl/Tk was previously deselected" |
|
|
; SectionGetFlags "${sect_tcltk}" $1 |
|
|
; IntOp $1 $1 ^ ${SF_SELECTED} |
|
|
; SectionSetFlags "${sect_tcltk}" $1 |
|
|
; ${Else} |
|
|
; ; If previously installed, force it to stay installed; |
|
|
; ; the only way to uninstall a component is via complete |
|
|
; ; uninstall. |
|
|
; SectionGetFlags "${sect_tcltk}" $1 |
|
|
; IntOp $1 $1 ^ ${SF_RO} |
|
|
; SectionSetFlags "${sect_tcltk}" $1 |
|
|
; ${EndIf} |
|
664 |
|
|
665 |
ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python" |
ReadRegDWORD $0 HKLM "SOFTWARE\ASCEND" "Python" |
666 |
${If} $0 = 0 |
${If} $0 = 0 |