installer.nsi 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385
  1. ; Panda3D installation script for the Nullsoft Installation System (NSIS).
  2. ; Jon Parise <[email protected]>
  3. ; with Ben Johnson <[email protected]>
  4. ; with Jason Pratt <[email protected]>
  5. ; mangled by Josh Yelon <[email protected]>
  6. ; Heavily restructured by rdb
  7. ; Caller needs to define these variables:
  8. ;
  9. ; COMPRESSOR - either zlib or lzma
  10. ; TITLE - title (eg. "Panda3D SDK 1.9.0")
  11. ; INSTALLDIR - default install location (eg. "C:\Panda3D-1.9.0-x64")
  12. ; OUTFILE - where to put the output file (eg. "..\nsis-output.exe")
  13. ;
  14. ; BUILT - location of panda install tree.
  15. ; SOURCE - location of the panda source-tree if available, OR location of panda install tree.
  16. ; INCLUDE_PYVER - version of Python that Panda was built with (eg. "2.7", "3.5-32")
  17. ; REGVIEW - either 32 or 64, depending on the build architecture.
  18. ;
  19. Name "${TITLE}"
  20. InstallDir "${INSTALLDIR}"
  21. OutFile "${OUTFILE}"
  22. RequestExecutionLevel user
  23. SetCompress auto
  24. SetCompressor ${COMPRESSOR}
  25. !include "MUI2.nsh"
  26. !include "Sections.nsh"
  27. !include "WinMessages.nsh"
  28. !include "WordFunc.nsh"
  29. !include "x64.nsh"
  30. !define MUI_WELCOMEFINISHPAGE_BITMAP "panda-install.bmp"
  31. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "panda-install.bmp"
  32. !define MUI_ABORTWARNING
  33. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  34. !define MUI_FINISHPAGE_RUN
  35. !define MUI_FINISHPAGE_RUN_FUNCTION runFunction
  36. !define MUI_FINISHPAGE_RUN_TEXT "Visit the Panda3D Manual"
  37. !insertmacro MUI_PAGE_WELCOME
  38. !insertmacro MUI_PAGE_LICENSE "${SOURCE}/doc/LICENSE"
  39. !insertmacro MUI_PAGE_DIRECTORY
  40. !ifdef INCLUDE_PYVER
  41. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE ConfirmPythonSelection
  42. !endif
  43. !insertmacro MUI_PAGE_COMPONENTS
  44. !insertmacro MUI_PAGE_INSTFILES
  45. !insertmacro MUI_PAGE_FINISH
  46. !insertmacro MUI_UNPAGE_WELCOME
  47. !insertmacro MUI_UNPAGE_CONFIRM
  48. !insertmacro MUI_UNPAGE_INSTFILES
  49. !insertmacro MUI_UNPAGE_FINISH
  50. !insertmacro MUI_LANGUAGE "English"
  51. ShowInstDetails hide
  52. ShowUninstDetails hide
  53. LicenseData "${SOURCE}/doc/LICENSE"
  54. InstType "Auto (Recommended)"
  55. InstType "Full"
  56. InstType "Light"
  57. LangString DESC_SecCore ${LANG_ENGLISH} "The Panda3D core libraries, configuration files and models/textures that are needed to use Panda3D."
  58. LangString DESC_SecOpenGL ${LANG_ENGLISH} "The OpenGL graphics back-end is the most well-supported renderer."
  59. LangString DESC_SecDirect3D9 ${LANG_ENGLISH} "The optional Direct3D 9 renderer."
  60. LangString DESC_SecOpenAL ${LANG_ENGLISH} "Support for playing audio via the OpenAL library. You need either OpenAL or FMOD to be able to play audio."
  61. LangString DESC_SecFMOD ${LANG_ENGLISH} "Support for decoding and playing audio via the FMOD Ex library. You need either OpenAL or FMOD to be able to play audio."
  62. LangString DESC_SecFFMpeg ${LANG_ENGLISH} "Support for decoding video and audio via the FFMpeg library. Without this option, Panda3D will only be able to play .wav and .ogg audio files."
  63. LangString DESC_SecBullet ${LANG_ENGLISH} "Support for the Bullet physics engine."
  64. LangString DESC_SecODE ${LANG_ENGLISH} "Support for the Open Dynamics Engine to implement physics."
  65. LangString DESC_SecTools ${LANG_ENGLISH} "Useful tools and model converters to help with Panda3D development. Recommended."
  66. LangString DESC_SecGroupPython ${LANG_ENGLISH} "Contains modules that provide Python support for Panda3D."
  67. LangString DESC_SecPyShared ${LANG_ENGLISH} "Contains the common Python code used by the Panda3D Python bindings."
  68. LangString DESC_SecPython ${LANG_ENGLISH} "Contains a ${REGVIEW}-bit copy of Python ${INCLUDE_PYVER} preconfigured to make use of Panda3D."
  69. LangString DESC_SecEnsurePip ${LANG_ENGLISH} "Installs the pip package manager into the included Python installation."
  70. LangString DESC_SecHeadersLibs ${LANG_ENGLISH} "Headers and libraries needed for C++ development with Panda3D."
  71. LangString DESC_SecSamples ${LANG_ENGLISH} "The sample programs demonstrate how to make Python applications with Panda3D."
  72. LangString DESC_SecMaxPlugins ${LANG_ENGLISH} "Plug-ins for Autodesk 3ds Max (${REGVIEW}-bit) that can be used to export models to Panda3D."
  73. LangString DESC_SecMayaPlugins ${LANG_ENGLISH} "Plug-ins and scripts for Autodesk Maya (${REGVIEW}-bit) that can be used to export models to Panda3D."
  74. var READABLE
  75. var MANPAGE
  76. ; See http://nsis.sourceforge.net/Check_if_a_file_exists_at_compile_time for documentation
  77. !macro !defineifexist _VAR_NAME _FILE_NAME
  78. !tempfile _TEMPFILE
  79. !ifdef NSIS_WIN32_MAKENSIS
  80. ; Windows - cmd.exe
  81. !system 'if exist "${_FILE_NAME}" echo !define ${_VAR_NAME} > "${_TEMPFILE}"'
  82. !else
  83. ; Posix - sh
  84. !system 'if [ -e "${_FILE_NAME}" ]; then echo "!define ${_VAR_NAME}" > "${_TEMPFILE}"; fi'
  85. !endif
  86. !include '${_TEMPFILE}'
  87. !delfile '${_TEMPFILE}'
  88. !undef _TEMPFILE
  89. !macroend
  90. !insertmacro !defineifexist HAVE_GL "${BUILT}\bin\libpandagl.dll"
  91. !insertmacro !defineifexist HAVE_DX9 "${BUILT}\bin\libpandadx9.dll"
  92. !insertmacro !defineifexist HAVE_OPENAL "${BUILT}\bin\libp3openal_audio.dll"
  93. !insertmacro !defineifexist HAVE_FMOD "${BUILT}\bin\libp3fmod_audio.dll"
  94. !insertmacro !defineifexist HAVE_FFMPEG "${BUILT}\bin\libp3ffmpeg.dll"
  95. !insertmacro !defineifexist HAVE_BULLET "${BUILT}\bin\libpandabullet.dll"
  96. !insertmacro !defineifexist HAVE_ODE "${BUILT}\bin\libpandaode.dll"
  97. !insertmacro !defineifexist HAVE_SAMPLES "${SOURCE}\samples"
  98. !insertmacro !defineifexist HAVE_MAX_PLUGINS "${BUILT}\plugins\*.dlo"
  99. !insertmacro !defineifexist HAVE_MAYA_PLUGINS "${BUILT}\plugins\*.mll"
  100. !macro RemovePythonPath PYVER
  101. ReadRegStr $0 HKCU "Software\Python\PythonCore\${PYVER}\PythonPath\Panda3D" ""
  102. StrCmp $0 "$INSTDIR" 0 +2
  103. DeleteRegKey HKCU "Software\Python\PythonCore\${PYVER}\PythonPath\Panda3D"
  104. !macroend
  105. !macro PyBindingSection PYVER EXT_SUFFIX
  106. LangString DESC_SecPyBindings${PYVER} ${LANG_ENGLISH} "Contains the Python modules that allow use of Panda3D using a ${REGVIEW}-bit version of Python ${PYVER}."
  107. !insertmacro !defineifexist _present "${BUILT}\panda3d\core${EXT_SUFFIX}"
  108. !ifdef _present
  109. Section "${PYVER} bindings" SecPyBindings${PYVER}
  110. !if "${PYVER}" == "${INCLUDE_PYVER}"
  111. SectionIn 1 2 3
  112. !else
  113. ; See .onInit function where this is dynamically enabled.
  114. SectionIn 2
  115. !endif
  116. SetDetailsPrint both
  117. DetailPrint "Installing Panda3D bindings for Python ${PYVER}..."
  118. SetDetailsPrint listonly
  119. SetOutPath $INSTDIR\panda3d
  120. File /nonfatal /r "${BUILT}\panda3d\core${EXT_SUFFIX}"
  121. File /nonfatal /r "${BUILT}\panda3d\ai${EXT_SUFFIX}"
  122. File /nonfatal /r "${BUILT}\panda3d\direct${EXT_SUFFIX}"
  123. File /nonfatal /r "${BUILT}\panda3d\egg${EXT_SUFFIX}"
  124. File /nonfatal /r "${BUILT}\panda3d\fx${EXT_SUFFIX}"
  125. File /nonfatal /r "${BUILT}\panda3d\interrogatedb${EXT_SUFFIX}"
  126. File /nonfatal /r "${BUILT}\panda3d\physics${EXT_SUFFIX}"
  127. File /nonfatal /r "${BUILT}\panda3d\_rplight${EXT_SUFFIX}"
  128. File /nonfatal /r "${BUILT}\panda3d\skel${EXT_SUFFIX}"
  129. File /nonfatal /r "${BUILT}\panda3d\vision${EXT_SUFFIX}"
  130. File /nonfatal /r "${BUILT}\panda3d\vrpn${EXT_SUFFIX}"
  131. !ifdef HAVE_BULLET
  132. SectionGetFlags ${SecBullet} $R0
  133. IntOp $R0 $R0 & ${SF_SELECTED}
  134. StrCmp $R0 ${SF_SELECTED} 0 SkipBulletPyd
  135. File /nonfatal /r "${BUILT}\panda3d\bullet${EXT_SUFFIX}"
  136. SkipBulletPyd:
  137. !endif
  138. !ifdef HAVE_ODE
  139. SectionGetFlags ${SecODE} $R0
  140. IntOp $R0 $R0 & ${SF_SELECTED}
  141. StrCmp $R0 ${SF_SELECTED} 0 SkipODEPyd
  142. File /nonfatal /r "${BUILT}\panda3d\ode${EXT_SUFFIX}"
  143. SkipODEPyd:
  144. !endif
  145. SetOutPath $INSTDIR\pandac\input
  146. File /r "${BUILT}\pandac\input\*"
  147. SetOutPath $INSTDIR\Pmw
  148. File /nonfatal /r /x CVS "${BUILT}\Pmw\*"
  149. SetOutPath $INSTDIR\panda3d.dist-info
  150. File /nonfatal /r "${BUILT}\panda3d.dist-info\*"
  151. !ifdef REGVIEW
  152. SetRegView ${REGVIEW}
  153. !endif
  154. ; Install a Panda3D path into the global PythonPath for this version
  155. ; of Python.
  156. WriteRegStr HKCU "Software\Python\PythonCore\${PYVER}\PythonPath\Panda3D" "" "$INSTDIR"
  157. SectionEnd
  158. !undef _present
  159. !endif
  160. !macroend
  161. Function runFunction
  162. ExecShell "open" "$SMPROGRAMS\${TITLE}\Panda3D Manual.lnk"
  163. FunctionEnd
  164. SectionGroup "Panda3D Libraries"
  165. Section "Core Libraries" SecCore
  166. SectionIn 1 2 3 RO
  167. SetShellVarContext current
  168. SetOverwrite try
  169. SetDetailsPrint both
  170. DetailPrint "Installing Panda3D libraries..."
  171. SetDetailsPrint listonly
  172. SetOutPath "$INSTDIR"
  173. File /nonfatal "${BUILT}\LICENSE"
  174. File /nonfatal "${BUILT}\ReleaseNotes"
  175. File /nonfatal "${BUILT}\pandaIcon.ico"
  176. SetOutPath $INSTDIR\etc
  177. File /r "${BUILT}\etc\*"
  178. SetOutPath $INSTDIR\bin
  179. File /r /x api-ms-win-*.dll /x ucrtbase.dll /x libpandagl.dll /x libpandadx9.dll /x cgD3D*.dll /x python*.dll /x libpandaode.dll /x libp3fmod_audio.dll /x fmodex*.dll /x libp3ffmpeg.dll /x av*.dll /x postproc*.dll /x swscale*.dll /x swresample*.dll /x NxCharacter*.dll /x cudart*.dll /x PhysX*.dll /x libpandaphysx.dll /x libp3rocket.dll /x boost_python*.dll /x Rocket*.dll /x _rocket*.pyd /x libpandabullet.dll /x OpenAL32.dll /x *_oal.dll /x libp3openal_audio.dll "${BUILT}\bin\*.dll"
  180. File /nonfatal /r "${BUILT}\bin\Microsoft.*.manifest"
  181. ; Before Windows 10, we need these stubs for the UCRT as well.
  182. ReadRegDWORD $0 HKLM "Software\Microsoft\Windows NT\CurrentVersion" "CurrentMajorVersionNumber"
  183. ${If} $0 < 10
  184. ClearErrors
  185. File /nonfatal /r "${BUILT}\bin\api-ms-win-*.dll"
  186. File /nonfatal "${BUILT}\bin\ucrtbase.dll"
  187. ${Endif}
  188. SetDetailsPrint both
  189. DetailPrint "Installing models..."
  190. SetDetailsPrint listonly
  191. SetOutPath $INSTDIR\models
  192. File /r /x CVS "${BUILT}\models\*"
  193. SetDetailsPrint both
  194. DetailPrint "Installing optional components..."
  195. SetDetailsPrint listonly
  196. RMDir /r "$SMPROGRAMS\${TITLE}"
  197. CreateDirectory "$SMPROGRAMS\${TITLE}"
  198. SectionEnd
  199. !ifdef HAVE_GL
  200. Section "OpenGL" SecOpenGL
  201. SectionIn 1 2 3 RO
  202. SetOutPath "$INSTDIR\bin"
  203. File "${BUILT}\bin\libpandagl.dll"
  204. SectionEnd
  205. !endif
  206. !ifdef HAVE_DX9
  207. Section "Direct3D 9" SecDirect3D9
  208. SectionIn 1 2
  209. SetOutPath "$INSTDIR\bin"
  210. File "${BUILT}\bin\libpandadx9.dll"
  211. File /nonfatal /r "${BUILT}\bin\cgD3D9.dll"
  212. SectionEnd
  213. !endif
  214. !ifdef HAVE_OPENAL
  215. Section "OpenAL Audio" SecOpenAL
  216. SectionIn 1 2 3
  217. SetOutPath "$INSTDIR\bin"
  218. File "${BUILT}\bin\libp3openal_audio.dll"
  219. File /nonfatal /r "${BUILT}\bin\OpenAL32.dll"
  220. File /nonfatal /r "${BUILT}\bin\*_oal.dll"
  221. SectionEnd
  222. !endif
  223. !ifdef HAVE_FMOD
  224. Section "FMOD Audio" SecFMOD
  225. SectionIn 1 2
  226. SetOutPath "$INSTDIR\bin"
  227. File "${BUILT}\bin\libp3fmod_audio.dll"
  228. File /r "${BUILT}\bin\fmodex*.dll"
  229. SectionEnd
  230. !endif
  231. !ifdef HAVE_FFMPEG
  232. Section "FFMpeg" SecFFMpeg
  233. SectionIn 1 2
  234. SetOutPath "$INSTDIR\bin"
  235. File "${BUILT}\bin\libp3ffmpeg.dll"
  236. File /nonfatal /r "${BUILT}\bin\av*.dll"
  237. File /nonfatal /r "${BUILT}\bin\swscale*.dll"
  238. File /nonfatal /r "${BUILT}\bin\swresample*.dll"
  239. File /nonfatal /r "${BUILT}\bin\postproc*.dll"
  240. SectionEnd
  241. !endif
  242. !ifdef HAVE_BULLET
  243. Section "Bullet Physics" SecBullet
  244. SectionIn 1 2
  245. SetOutPath "$INSTDIR\bin"
  246. File "${BUILT}\bin\libpandabullet.dll"
  247. SectionEnd
  248. !endif
  249. !ifdef HAVE_ODE
  250. Section "ODE Physics" SecODE
  251. SectionIn 1 2
  252. SetOutPath "$INSTDIR\bin"
  253. File "${BUILT}\bin\libpandaode.dll"
  254. SectionEnd
  255. !endif
  256. SectionGroupEnd
  257. Section "Tools and utilities" SecTools
  258. SectionIn 1 2 3
  259. SetDetailsPrint both
  260. DetailPrint "Installing utilities..."
  261. SetDetailsPrint listonly
  262. SetOutPath "$INSTDIR\bin"
  263. File /r /x deploy-stub.exe /x deploy-stubw.exe "${BUILT}\bin\*.exe"
  264. File /nonfatal /r "${BUILT}\bin\*.p3d"
  265. SetOutPath "$INSTDIR\NSIS"
  266. File /r /x CVS "${NSISDIR}\*"
  267. WriteRegStr HKCU "Software\Classes\Panda3D.Model" "" "Panda3D model/animation"
  268. WriteRegStr HKCU "Software\Classes\Panda3D.Model\DefaultIcon" "" "$INSTDIR\bin\pview.exe"
  269. WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell" "" "open"
  270. WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\open\command" "" '"$INSTDIR\bin\pview.exe" -l "%1"'
  271. WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\compress" "" "Compress to .pz"
  272. WriteRegStr HKCU "Software\Classes\Panda3D.Model\shell\compress\command" "" '"$INSTDIR\bin\pzip.exe" "%1"'
  273. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed" "" "Compressed file"
  274. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" "" "$INSTDIR\bin\pzip.exe"
  275. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell" "" "open"
  276. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\open\command" "" '"$INSTDIR\bin\pview.exe" -l "%1"'
  277. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\decompress" "" "Decompress"
  278. WriteRegStr HKCU "Software\Classes\Panda3D.Compressed\shell\decompress\command" "" '"$INSTDIR\bin\punzip.exe" "%1"'
  279. WriteRegStr HKCU "Software\Classes\Panda3D.Multifile" "" "Panda3D Multifile"
  280. WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" "" "$INSTDIR\bin\multify.exe"
  281. WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell" "" "open"
  282. WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell\extract" "" "Extract here"
  283. WriteRegStr HKCU "Software\Classes\Panda3D.Multifile\shell\extract\command" "" '"$INSTDIR\bin\multify.exe" -xf "%1"'
  284. SectionEnd
  285. SectionGroup "Python modules" SecGroupPython
  286. Section "Shared code" SecPyShared
  287. SectionIn 1 2 3
  288. SetDetailsPrint both
  289. DetailPrint "Installing Panda3D shared Python modules..."
  290. SetDetailsPrint listonly
  291. SetOutPath $INSTDIR\direct\directscripts
  292. File /r /x CVS /x Opt?-Win32 "${BUILT}\direct\directscripts\*"
  293. SetOutPath $INSTDIR\direct
  294. File /r /x CVS /x Opt?-Win32 "${BUILT}\direct\*.py"
  295. Delete "$INSTDIR\panda3d.py"
  296. Delete "$INSTDIR\panda3d.pyc"
  297. Delete "$INSTDIR\panda3d.pyo"
  298. SetOutPath $INSTDIR\pandac
  299. File /r "${BUILT}\pandac\*.py"
  300. SetOutPath $INSTDIR\panda3d
  301. File /r "${BUILT}\panda3d\*.py"
  302. SectionEnd
  303. !insertmacro PyBindingSection 2.7 .pyd
  304. !if "${REGVIEW}" == "32"
  305. !insertmacro PyBindingSection 3.5-32 .cp35-win32.pyd
  306. !insertmacro PyBindingSection 3.6-32 .cp36-win32.pyd
  307. !insertmacro PyBindingSection 3.7-32 .cp37-win32.pyd
  308. !insertmacro PyBindingSection 3.8-32 .cp38-win32.pyd
  309. !insertmacro PyBindingSection 3.9-32 .cp39-win32.pyd
  310. !else
  311. !insertmacro PyBindingSection 3.5 .cp35-win_amd64.pyd
  312. !insertmacro PyBindingSection 3.6 .cp36-win_amd64.pyd
  313. !insertmacro PyBindingSection 3.7 .cp37-win_amd64.pyd
  314. !insertmacro PyBindingSection 3.8 .cp38-win_amd64.pyd
  315. !insertmacro PyBindingSection 3.9 .cp39-win_amd64.pyd
  316. !endif
  317. SectionGroupEnd
  318. !ifdef INCLUDE_PYVER
  319. Section "Python ${INCLUDE_PYVER}" SecPython
  320. SectionIn 1 2 3
  321. !ifdef REGVIEW
  322. SetRegView ${REGVIEW}
  323. !endif
  324. SetDetailsPrint both
  325. DetailPrint "Installing Python ${INCLUDE_PYVER} interpreter (${REGVIEW}-bit)..."
  326. SetDetailsPrint listonly
  327. SetOutPath "$INSTDIR\bin"
  328. File /nonfatal "${BUILT}\bin\python*.dll"
  329. SetOutPath "$INSTDIR\python"
  330. File /r /x *.pdb "${BUILT}\python\*"
  331. SetDetailsPrint both
  332. DetailPrint "Adding registry keys for Python..."
  333. SetDetailsPrint listonly
  334. ; Check if a copy of Python is installed for this user.
  335. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  336. StrCmp "$0" "$INSTDIR\python" RegPath 0
  337. StrCmp "$0" "" SkipFileCheck 0
  338. IfFileExists "$0\python.exe" AskRegPath 0
  339. SkipFileCheck:
  340. ; Check if a system-wide copy of Python is installed.
  341. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  342. StrCmp "$0" "$INSTDIR\python" RegPath 0
  343. StrCmp "$0" "" RegPath 0
  344. IfFileExists "$0\python.exe" AskRegPath RegPath
  345. AskRegPath:
  346. MessageBox MB_YESNO|MB_ICONQUESTION \
  347. "You already have a copy of Python ${INCLUDE_PYVER} installed in:$\r$\n$0$\r$\n$\r$\nPanda3D installs its own copy of Python ${INCLUDE_PYVER}, which will install alongside your existing copy. Would you like to make Panda's copy the default Python for your user account?" \
  348. IDNO SkipRegPath
  349. RegPath:
  350. WriteRegStr HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" "" "$INSTDIR\python"
  351. WriteRegStr HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" "ExecutablePath" "$INSTDIR\python\python.exe"
  352. SkipRegPath:
  353. SectionEnd
  354. Section "Install pip" SecEnsurePip
  355. SectionIn 1 2 3
  356. SetDetailsPrint both
  357. DetailPrint "Installing the pip package manager..."
  358. SetDetailsPrint listonly
  359. SetOutPath $INSTDIR
  360. nsExec::ExecToLog '"$INSTDIR\python\python.exe" -m ensurepip --default-pip'
  361. Pop $0
  362. DetailPrint "Command returned exit status $0"
  363. SectionEnd
  364. !endif
  365. !macro MaybeEnablePyBindingSection PYVER
  366. !if "${INCLUDE_PYVER}" != "${PYVER}"
  367. !ifdef SecPyBindings${PYVER}
  368. ; Check if a copy of Python is installed for this user.
  369. Push $0
  370. ReadRegStr $0 HKCU "Software\Python\PythonCore\${PYVER}\InstallPath" ""
  371. StrCmp "$0" "" +2 0
  372. IfFileExists "$0\python.exe" Py${PYVER}Exists 0
  373. ; Check if a system-wide copy of Python is installed.
  374. ReadRegStr $0 HKLM "Software\Python\PythonCore\${PYVER}\InstallPath" ""
  375. StrCmp "$0" "" Py${PYVER}ExistsNot 0
  376. IfFileExists "$0\python.exe" Py${PYVER}Exists Py${PYVER}ExistsNot
  377. Py${PYVER}Exists:
  378. SectionSetFlags ${SecPyBindings${PYVER}} ${SF_SELECTED}
  379. SectionSetInstTypes ${SecPyBindings${PYVER}} 3
  380. Py${PYVER}ExistsNot:
  381. Pop $0
  382. !endif
  383. !endif
  384. !macroend
  385. Function .onInit
  386. ${If} ${REGVIEW} = 64
  387. ${AndIfNot} ${RunningX64}
  388. MessageBox MB_OK|MB_ICONEXCLAMATION "You are attempting to install the 64-bit version of Panda3D on a 32-bit version of Windows. Please download and install the 32-bit version of Panda3D instead."
  389. Abort
  390. ${EndIf}
  391. !ifdef REGVIEW
  392. SetRegView ${REGVIEW}
  393. !endif
  394. ; We never check for 2.7; it is always disabled in Auto mode
  395. !if "${REGVIEW}" == "32"
  396. !insertmacro MaybeEnablePyBindingSection 3.5-32
  397. !insertmacro MaybeEnablePyBindingSection 3.6-32
  398. !insertmacro MaybeEnablePyBindingSection 3.7-32
  399. !insertmacro MaybeEnablePyBindingSection 3.8-32
  400. !insertmacro MaybeEnablePyBindingSection 3.9-32
  401. !else
  402. !insertmacro MaybeEnablePyBindingSection 3.5
  403. !insertmacro MaybeEnablePyBindingSection 3.6
  404. !insertmacro MaybeEnablePyBindingSection 3.7
  405. !insertmacro MaybeEnablePyBindingSection 3.8
  406. !insertmacro MaybeEnablePyBindingSection 3.9
  407. !endif
  408. FunctionEnd
  409. Function .onSelChange
  410. ; If someone selects any Python version, the "shared modules" must be on.
  411. ${If} ${SectionIsPartiallySelected} ${SecGroupPython}
  412. SectionGetFlags ${SecPyShared} $R0
  413. IntOp $R0 $R0 | ${SF_SELECTED}
  414. SectionSetFlags ${SecPyShared} $R0
  415. ${EndIf}
  416. !ifdef INCLUDE_PYVER
  417. ${If} ${SectionIsSelected} ${SecPython}
  418. !insertmacro SectionFlagIsSet ${SecEnsurePip} ${SF_RO} 0 SkipSelectEnsurePip
  419. !insertmacro SelectSection ${SecEnsurePip}
  420. SkipSelectEnsurePip:
  421. !insertmacro ClearSectionFlag ${SecEnsurePip} ${SF_RO}
  422. ${Else}
  423. !insertmacro UnselectSection ${SecEnsurePip}
  424. !insertmacro SetSectionFlag ${SecEnsurePip} ${SF_RO}
  425. ${EndIf}
  426. !endif
  427. FunctionEnd
  428. !ifdef INCLUDE_PYVER
  429. Function ConfirmPythonSelection
  430. ; Check the current state of the "Python" section selection.
  431. SectionGetFlags ${SecPython} $R0
  432. IntOp $R1 $R0 & ${SF_SELECTED}
  433. ; Is the "Python" selection deselected?
  434. StrCmp $R1 ${SF_SELECTED} SkipCheck 0
  435. ; Maybe the user just doesn't want Python support at all?
  436. !insertmacro SectionFlagIsSet ${SecGroupPython} ${SF_PSELECTED} 0 SkipCheck
  437. !ifdef REGVIEW
  438. SetRegView ${REGVIEW}
  439. !endif
  440. ; Check for a user installation of Python.
  441. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  442. StrCmp $0 "$INSTDIR\python" CheckSystemWidePython 0
  443. StrCmp $0 "" CheckSystemWidePython 0
  444. IfFileExists "$0\ppython.exe" CheckSystemWidePython 0
  445. IfFileExists "$0\python.exe" SkipCheck CheckSystemWidePython
  446. ; Check for a system-wide Python installation.
  447. CheckSystemWidePython:
  448. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  449. StrCmp $0 "$INSTDIR\python" AskConfirmation 0
  450. StrCmp $0 "" AskConfirmation 0
  451. IfFileExists "$0\ppython.exe" AskConfirmation 0
  452. IfFileExists "$0\python.exe" SkipCheck AskConfirmation
  453. ; No compatible Python version found (that wasn't shipped as part
  454. ; of a different Panda3D build.) Ask the user if he's sure about this.
  455. AskConfirmation:
  456. MessageBox MB_YESNO|MB_ICONQUESTION \
  457. "You do not appear to have a ${REGVIEW}-bit version of Python ${INCLUDE_PYVER} installed. Are you sure you don't want Panda to install a compatible copy of Python?$\r$\n$\r$\nIf you choose Yes, you will not be able to do Python development with Panda3D until you install a ${REGVIEW}-bit version of Python and install the bindings for this version." \
  458. IDYES SkipCheck
  459. ; User clicked no, so re-enable the select box and abort.
  460. IntOp $R0 $R0 | ${SF_SELECTED}
  461. SectionSetFlags ${SecPython} $R0
  462. Abort
  463. SkipCheck:
  464. FunctionEnd
  465. !endif
  466. Section "C++ support" SecHeadersLibs
  467. SectionIn 1 2
  468. SetDetailsPrint both
  469. DetailPrint "Installing header files..."
  470. SetDetailsPrint listonly
  471. SetOutPath $INSTDIR\include
  472. File /r /x *.exp "${BUILT}\include\*"
  473. SetDetailsPrint both
  474. DetailPrint "Installing library archives..."
  475. SetDetailsPrint listonly
  476. SetOutPath $INSTDIR\lib
  477. File /r /x *.exp "${BUILT}\lib\*"
  478. SectionEnd
  479. !ifdef HAVE_SAMPLES
  480. Section "Sample programs" SecSamples
  481. SectionIn 1 2
  482. ; Necessary for proper start menu shortcut installation
  483. SetShellVarContext current
  484. SetDetailsPrint both
  485. DetailPrint "Installing sample programs..."
  486. SetDetailsPrint listonly
  487. SetOutPath $INSTDIR\samples
  488. File /nonfatal /r /x CVS "${SOURCE}\samples\*"
  489. SetDetailsPrint both
  490. DetailPrint "Creating shortcuts..."
  491. SetDetailsPrint listonly
  492. SetOutPath $INSTDIR
  493. WriteINIStr $INSTDIR\Website.url "InternetShortcut" "URL" "https://www.panda3d.org/"
  494. WriteINIStr $INSTDIR\Manual.url "InternetShortcut" "URL" "https://www.panda3d.org/manual/index.php"
  495. WriteINIStr $INSTDIR\Samples.url "InternetShortcut" "URL" "https://www.panda3d.org/manual/index.php/Sample_Programs_in_the_Distribution"
  496. SetOutPath $INSTDIR
  497. CreateShortCut "$SMPROGRAMS\${TITLE}\Panda3D Manual.lnk" "$INSTDIR\Manual.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Panda3D Manual"
  498. CreateShortCut "$SMPROGRAMS\${TITLE}\Panda3D Website.lnk" "$INSTDIR\Website.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Panda3D Website"
  499. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Program Manual.lnk" "$INSTDIR\Samples.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Sample Program Manual"
  500. FindFirst $0 $1 $INSTDIR\samples\*
  501. loop:
  502. StrCmp $1 "" done
  503. StrCmp $1 "." next
  504. StrCmp $1 ".." next
  505. FindFirst $2 $3 $INSTDIR\samples\$1\*.py
  506. StrCmp $3 "" next
  507. Push $1
  508. Push "-"
  509. Push " "
  510. Call StrRep
  511. Call Capitalize
  512. Pop $R0
  513. StrCpy $READABLE $R0
  514. Push $1
  515. Push "-"
  516. Push "_"
  517. Call StrRep
  518. Pop $R0
  519. StrCpy $MANPAGE $R0
  520. DetailPrint "Creating shortcuts for sample program $READABLE"
  521. CreateDirectory "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE"
  522. SetOutPath $INSTDIR\samples\$1
  523. WriteINIStr $INSTDIR\samples\$1\ManualPage.url "InternetShortcut" "URL" "https://www.panda3d.org/wiki/index.php/Sample_Programs:_$MANPAGE"
  524. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\Manual Page.lnk" "$INSTDIR\samples\$1\ManualPage.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Manual Entry on this Sample Program"
  525. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\View Source Code.lnk" "$INSTDIR\samples\$1"
  526. iloop:
  527. StrCmp $3 "" idone
  528. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\Run $3.lnk" "$INSTDIR\python\python.exe" "-E $3" "$INSTDIR\pandaIcon.ico" 0 SW_SHOWMINIMIZED "" "Run $3"
  529. CreateShortCut "$INSTDIR\samples\$1\Run $3.lnk" "$INSTDIR\python\python.exe" "-E $3" "$INSTDIR\pandaIcon.ico" 0 SW_SHOWMINIMIZED "" "Run $3"
  530. FindNext $2 $3
  531. goto iloop
  532. idone:
  533. next:
  534. FindNext $0 $1
  535. Goto loop
  536. done:
  537. SectionEnd
  538. !endif
  539. !ifdef HAVE_MAX_PLUGINS
  540. Section "3ds Max plug-ins" SecMaxPlugins
  541. SectionIn 1 2
  542. SetDetailsPrint both
  543. DetailPrint "Installing Autodesk 3ds Max plug-ins..."
  544. SetDetailsPrint listonly
  545. SetOutPath $INSTDIR\plugins
  546. File /nonfatal /r "${BUILT}\plugins\*.dle"
  547. File /nonfatal /r "${BUILT}\plugins\*.dlo"
  548. File /nonfatal /r "${BUILT}\plugins\*.ms"
  549. SectionEnd
  550. !endif
  551. !ifdef HAVE_MAYA_PLUGINS
  552. Section "Maya plug-ins" SecMayaPlugins
  553. SectionIn 1 2
  554. SetDetailsPrint both
  555. DetailPrint "Installing Autodesk Maya plug-ins..."
  556. SetDetailsPrint listonly
  557. SetOutPath $INSTDIR\plugins
  558. File /nonfatal /r "${BUILT}\plugins\*.mll"
  559. File /nonfatal /r "${BUILT}\plugins\*.mel"
  560. SectionEnd
  561. !endif
  562. Section -post
  563. !ifdef REGVIEW
  564. SetRegView ${REGVIEW}
  565. !endif
  566. ; Run eggcacher. We can't do this in SecCore because we haven't
  567. ; installed eggcacher at that point yet.
  568. SetDetailsPrint both
  569. DetailPrint "Preloading .egg files into the model cache..."
  570. SetDetailsPrint listonly
  571. SetOutPath $INSTDIR
  572. nsExec::ExecToLog '"$INSTDIR\python\python.exe" -m direct.directscripts.eggcacher --concise models samples'
  573. Pop $0
  574. DetailPrint "Command returned exit status $0"
  575. SetDetailsPrint both
  576. DetailPrint "Writing the uninstaller ..."
  577. SetDetailsPrint listonly
  578. Delete "$INSTDIR\uninst.exe"
  579. WriteUninstaller "$INSTDIR\uninst.exe"
  580. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "DisplayName" "${TITLE}"
  581. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "UninstallString" '"$INSTDIR\uninst.exe"'
  582. SetOutPath $INSTDIR
  583. CreateShortcut "$SMPROGRAMS\${TITLE}\Uninstall ${TITLE}.lnk" "$INSTDIR\uninst.exe" ""
  584. SetDetailsPrint both
  585. DetailPrint "Registering file type associations..."
  586. SetDetailsPrint listonly
  587. ; Even though we need the runtime to run these, we might as well tell
  588. ; Windows what this kind of file is.
  589. WriteRegStr HKCU "Software\Classes\.p3d" "" "Panda3D applet"
  590. WriteRegStr HKCU "Software\Classes\.p3d" "Content Type" "application/x-panda3d"
  591. WriteRegStr HKCU "Software\Classes\.p3d" "PerceivedType" "application"
  592. ; Register various model files
  593. WriteRegStr HKCU "Software\Classes\.egg" "" "Panda3D.Model"
  594. WriteRegStr HKCU "Software\Classes\.egg" "Content Type" "application/x-egg"
  595. WriteRegStr HKCU "Software\Classes\.egg" "PerceivedType" "gamemedia"
  596. WriteRegStr HKCU "Software\Classes\.bam" "" "Panda3D.Model"
  597. WriteRegStr HKCU "Software\Classes\.bam" "Content Type" "application/x-bam"
  598. WriteRegStr HKCU "Software\Classes\.bam" "PerceivedType" "gamemedia"
  599. WriteRegStr HKCU "Software\Classes\.pz" "" "Panda3D.Compressed"
  600. WriteRegStr HKCU "Software\Classes\.pz" "PerceivedType" "compressed"
  601. WriteRegStr HKCU "Software\Classes\.mf" "" "Panda3D.Multifile"
  602. WriteRegStr HKCU "Software\Classes\.mf" "PerceivedType" "compressed"
  603. WriteRegStr HKCU "Software\Classes\.prc" "" "inifile"
  604. WriteRegStr HKCU "Software\Classes\.prc" "Content Type" "text/plain"
  605. WriteRegStr HKCU "Software\Classes\.prc" "PerceivedType" "text"
  606. ; For convenience, if nobody registered .pyd, we will.
  607. ReadRegStr $0 HKCR "Software\Classes\.pyd" ""
  608. StrCmp $0 "" 0 +2
  609. WriteRegStr HKCU "Software\Classes\.pyd" "" "dllfile"
  610. SetDetailsPrint both
  611. DetailPrint "Adding directories to system PATH..."
  612. SetDetailsPrint listonly
  613. # Add the "bin" directory to the PATH.
  614. Push "$INSTDIR\python"
  615. Call RemoveFromPath
  616. Push "$INSTDIR\python\Scripts"
  617. Call RemoveFromPath
  618. Push "$INSTDIR\bin"
  619. Call RemoveFromPath
  620. Push "$INSTDIR\python;$INSTDIR\python\Scripts;$INSTDIR\bin"
  621. Call AddToPath
  622. # This is needed for the environment variable changes to take effect.
  623. DetailPrint "Broadcasting WM_WININICHANGE message..."
  624. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=500
  625. # Now dump the log to disk.
  626. StrCpy $0 "$INSTDIR\install.log"
  627. Push $0
  628. Call DumpLog
  629. SectionEnd
  630. Section Uninstall
  631. SetDetailsPrint listonly
  632. SetShellVarContext current
  633. !ifdef REGVIEW
  634. SetRegView ${REGVIEW}
  635. !endif
  636. SetDetailsPrint both
  637. DetailPrint "Removing registry entries..."
  638. SetDetailsPrint listonly
  639. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}"
  640. DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}"
  641. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Model\DefaultIcon" ""
  642. StrCmp $0 "$INSTDIR\bin\pview.exe" 0 +3
  643. DeleteRegKey HKCU "Software\Classes\Panda3D.Model\DefaultIcon"
  644. DeleteRegKey HKCU "Software\Classes\Panda3D.Model\shell"
  645. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" ""
  646. StrCmp $0 "$INSTDIR\bin\pzip.exe" 0 +3
  647. DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon"
  648. DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\shell"
  649. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" ""
  650. StrCmp $0 "$INSTDIR\bin\multify.exe" 0 +3
  651. DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon"
  652. DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\shell"
  653. !ifdef INCLUDE_PYVER
  654. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  655. StrCmp $0 "$INSTDIR\python" 0 +2
  656. DeleteRegKey HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}"
  657. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  658. StrCmp $0 "$INSTDIR\python" 0 +2
  659. DeleteRegKey HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}"
  660. !endif
  661. !insertmacro RemovePythonPath 2.7
  662. !if "${REGVIEW}" == "32"
  663. !insertmacro RemovePythonPath 3.5-32
  664. !insertmacro RemovePythonPath 3.6-32
  665. !insertmacro RemovePythonPath 3.7-32
  666. !insertmacro RemovePythonPath 3.8-32
  667. !insertmacro RemovePythonPath 3.9-32
  668. !else
  669. !insertmacro RemovePythonPath 3.5
  670. !insertmacro RemovePythonPath 3.6
  671. !insertmacro RemovePythonPath 3.7
  672. !insertmacro RemovePythonPath 3.8
  673. !insertmacro RemovePythonPath 3.9
  674. !endif
  675. SetDetailsPrint both
  676. DetailPrint "Deleting files..."
  677. SetDetailsPrint listonly
  678. Delete "$INSTDIR\uninst.exe"
  679. RMDir /r "$INSTDIR"
  680. SetDetailsPrint both
  681. DetailPrint "Removing Start Menu entries..."
  682. SetDetailsPrint listonly
  683. SetShellVarContext current
  684. RMDir /r "$SMPROGRAMS\${TITLE}"
  685. SetShellVarContext all
  686. RMDir /r "$SMPROGRAMS\${TITLE}"
  687. SetDetailsPrint both
  688. DetailPrint "Removing entries from PATH..."
  689. SetDetailsPrint listonly
  690. Push "$INSTDIR\python"
  691. Call un.RemoveFromPath
  692. Push "$INSTDIR\python\Scripts"
  693. Call un.RemoveFromPath
  694. Push "$INSTDIR\bin"
  695. Call un.RemoveFromPath
  696. # This is needed for the environment variable changes to take effect.
  697. DetailPrint "Broadcasting WM_WININICHANGE message..."
  698. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=500
  699. SectionEnd
  700. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  701. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(DESC_SecCore)
  702. !ifdef HAVE_GL
  703. !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenGL} $(DESC_SecOpenGL)
  704. !endif
  705. !ifdef HAVE_DX9
  706. !insertmacro MUI_DESCRIPTION_TEXT ${SecDirect3D9} $(DESC_SecDirect3D9)
  707. !endif
  708. !ifdef HAVE_OPENAL
  709. !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenAL} $(DESC_SecOpenAL)
  710. !endif
  711. !ifdef HAVE_FMOD
  712. !insertmacro MUI_DESCRIPTION_TEXT ${SecFMOD} $(DESC_SecFMOD)
  713. !endif
  714. !ifdef HAVE_FFMPEG
  715. !insertmacro MUI_DESCRIPTION_TEXT ${SecFFMpeg} $(DESC_SecFFMpeg)
  716. !endif
  717. !ifdef HAVE_BULLET
  718. !insertmacro MUI_DESCRIPTION_TEXT ${SecBullet} $(DESC_SecBullet)
  719. !endif
  720. !ifdef HAVE_ODE
  721. !insertmacro MUI_DESCRIPTION_TEXT ${SecODE} $(DESC_SecODE)
  722. !endif
  723. !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} $(DESC_SecTools)
  724. !insertmacro MUI_DESCRIPTION_TEXT ${SecGroupPython} $(DESC_SecGroupPython)
  725. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyShared} $(DESC_SecPyShared)
  726. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings2.7} $(DESC_SecPyBindings2.7)
  727. !if "${REGVIEW}" == "32"
  728. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5-32} $(DESC_SecPyBindings3.5-32)
  729. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6-32} $(DESC_SecPyBindings3.6-32)
  730. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.7-32} $(DESC_SecPyBindings3.7-32)
  731. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.8-32} $(DESC_SecPyBindings3.8-32)
  732. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.9-32} $(DESC_SecPyBindings3.9-32)
  733. !else
  734. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5} $(DESC_SecPyBindings3.5)
  735. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6} $(DESC_SecPyBindings3.6)
  736. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.7} $(DESC_SecPyBindings3.7)
  737. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.8} $(DESC_SecPyBindings3.8)
  738. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.9} $(DESC_SecPyBindings3.9)
  739. !endif
  740. !ifdef INCLUDE_PYVER
  741. !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython)
  742. !insertmacro MUI_DESCRIPTION_TEXT ${SecEnsurePip} $(DESC_SecEnsurePip)
  743. !endif
  744. !insertmacro MUI_DESCRIPTION_TEXT ${SecHeadersLibs} $(DESC_SecHeadersLibs)
  745. !ifdef HAVE_SAMPLES
  746. !insertmacro MUI_DESCRIPTION_TEXT ${SecSamples} $(DESC_SecSamples)
  747. !endif
  748. !ifdef HAVE_MAX_PLUGINS
  749. !insertmacro MUI_DESCRIPTION_TEXT ${SecMaxPlugins} $(DESC_SecMaxPlugins)
  750. !endif
  751. !ifdef HAVE_MAYA_PLUGINS
  752. !insertmacro MUI_DESCRIPTION_TEXT ${SecMayaPlugins} $(DESC_SecMayaPlugins)
  753. !endif
  754. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  755. # --[ Utility Functions ]------------------------------------------------------
  756. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  757. Function IsNT
  758. Push $0
  759. ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
  760. StrCmp $0 "" 0 IsNT_yes
  761. ; we are not NT.
  762. Pop $0
  763. Push 0
  764. Return
  765. IsNT_yes:
  766. ; NT!!!
  767. Pop $0
  768. Push 1
  769. FunctionEnd
  770. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  771. Function un.IsNT
  772. Push $0
  773. ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
  774. StrCmp $0 "" 0 unIsNT_yes
  775. ; we are not NT.
  776. Pop $0
  777. Push 0
  778. Return
  779. unIsNT_yes:
  780. ; NT!!!
  781. Pop $0
  782. Push 1
  783. FunctionEnd
  784. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  785. Function StrStr
  786. Push $0
  787. Exch
  788. Pop $0 ; $0 now have the string to find
  789. Push $1
  790. Exch 2
  791. Pop $1 ; $1 now have the string to find in
  792. Exch
  793. Push $2
  794. Push $3
  795. Push $4
  796. Push $5
  797. StrCpy $2 -1
  798. StrLen $3 $0
  799. StrLen $4 $1
  800. IntOp $4 $4 - $3
  801. unStrStr_loop:
  802. IntOp $2 $2 + 1
  803. IntCmp $2 $4 0 0 unStrStrReturn_notFound
  804. StrCpy $5 $1 $3 $2
  805. StrCmp $5 $0 unStrStr_done unStrStr_loop
  806. unStrStrReturn_notFound:
  807. StrCpy $2 -1
  808. unStrStr_done:
  809. Pop $5
  810. Pop $4
  811. Pop $3
  812. Exch $2
  813. Exch 2
  814. Pop $0
  815. Pop $1
  816. FunctionEnd
  817. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  818. Function un.StrStr
  819. Push $0
  820. Exch
  821. Pop $0 ; $0 now have the string to find
  822. Push $1
  823. Exch 2
  824. Pop $1 ; $1 now have the string to find in
  825. Exch
  826. Push $2
  827. Push $3
  828. Push $4
  829. Push $5
  830. StrCpy $2 -1
  831. StrLen $3 $0
  832. StrLen $4 $1
  833. IntOp $4 $4 - $3
  834. unStrStr_loop:
  835. IntOp $2 $2 + 1
  836. IntCmp $2 $4 0 0 unStrStrReturn_notFound
  837. StrCpy $5 $1 $3 $2
  838. StrCmp $5 $0 unStrStr_done unStrStr_loop
  839. unStrStrReturn_notFound:
  840. StrCpy $2 -1
  841. unStrStr_done:
  842. Pop $5
  843. Pop $4
  844. Pop $3
  845. Exch $2
  846. Exch 2
  847. Pop $0
  848. Pop $1
  849. FunctionEnd
  850. ; Capitalizes the first letter of every word.
  851. Function Capitalize
  852. Exch $R0
  853. Push $0
  854. Push $1
  855. Push $2
  856. StrCpy $0 0
  857. capNext:
  858. ; Grab the next character.
  859. StrCpy $1 $R0 1 $0
  860. StrCmp $1 '' end
  861. ; Capitalize it.
  862. ${StrFilter} '$1' '+eng' '' '' $1
  863. ${StrFilter} '$1' '+rus' '' '' $1
  864. ; Splice it into the string.
  865. StrCpy $2 $R0 $0
  866. IntOp $0 $0 + 1
  867. StrCpy $R0 $R0 '' $0
  868. StrCpy $R0 '$2$1$R0'
  869. ; Keep looping through the characters until we find a
  870. ; delimiter or reach the end of the string.
  871. loop:
  872. StrCpy $1 $R0 1 $0
  873. IntOp $0 $0 + 1
  874. StrCmp $1 '' end
  875. StrCmp $1 ' ' capNext
  876. StrCmp $1 '_' capNext
  877. StrCmp $1 '-' capNext
  878. StrCmp $1 '(' capNext
  879. StrCmp $1 '[' capNext
  880. Goto loop
  881. end:
  882. Pop $2
  883. Pop $1
  884. Pop $0
  885. Exch $R0
  886. FunctionEnd
  887. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  888. ; Commentary and smarter ';' checking by Jon Parise <[email protected]>
  889. Function AddToPath
  890. Exch $0
  891. Push $1
  892. Push $2
  893. Push $3
  894. Call IsNT
  895. Pop $1
  896. DetailPrint "Adding to PATH: $0"
  897. StrCmp $1 1 AddToPath_NT
  898. ; We're not on NT, so modify the AUTOEXEC.BAT file.
  899. StrCpy $1 $WINDIR 2
  900. FileOpen $1 "$1\autoexec.bat" a
  901. FileSeek $1 0 END
  902. GetFullPathName /SHORT $0 $0
  903. FileWrite $1 "$\r$\nSET PATH=%PATH%;$0$\r$\n"
  904. FileClose $1
  905. Goto AddToPath_done
  906. AddToPath_NT:
  907. ClearErrors
  908. ReadRegStr $1 HKCU "Environment" "PATH"
  909. ; If we reached an error, WATCH OUT. Either this means that
  910. ; the registry key did not exist, or that it didn't fit in
  911. ; NSIS' string limit. If the latter, we have to be very
  912. ; careful not to overwrite the user's PATH.
  913. IfErrors AddToPath_Error
  914. DetailPrint "Current PATH value is set to $1"
  915. StrCmp $1 "" AddToPath_NTAddPath
  916. ; Pull off the last character of the PATH string. If it's a semicolon,
  917. ; we don't need to add another one, so jump to the section where we
  918. ; append the new PATH component(s).
  919. StrCpy $2 $1 1 -1
  920. StrCmp $2 ";" AddToPath_NTAddPath AddToPath_NTAddSemi
  921. AddToPath_Error:
  922. DetailPrint "Encountered error reading PATH variable."
  923. ; Does the variable exist? If it doesn't, then the
  924. ; error happened because we need to create the
  925. ; variable. If it does, then we failed to read it
  926. ; because we reached NSIS' string limit.
  927. StrCpy $3 0
  928. AddToPath_loop:
  929. EnumRegValue $4 HKCU "Environment" $3
  930. StrCmp $4 "PATH" AddToPath_ExceedLimit
  931. StrCmp $4 "" AddToPath_NTAddPath
  932. IntOp $3 $3 + 1
  933. Goto AddToPath_loop
  934. AddToPath_ExceedLimit:
  935. MessageBox MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION "Your PATH environment variable is too long! Please remove extraneous entries before proceeding. Panda3D needs to add the following the PATH so that the Panda3D utilities and libraries can be located correctly.$\n$\n$0$\n$\nIf you wish to add Panda3D to the path yourself, choose Ignore." IDIGNORE AddToPath_done IDRETRY AddToPath_NT
  936. SetDetailsPrint both
  937. DetailPrint "Cannot append to PATH - variable is likely too long."
  938. SetDetailsPrint listonly
  939. Abort
  940. AddToPath_NTAddSemi:
  941. StrCpy $1 "$1;"
  942. Goto AddToPath_NTAddPath
  943. AddToPath_NTAddPath:
  944. StrCpy $0 "$1$0"
  945. WriteRegExpandStr HKCU "Environment" "PATH" $0
  946. AddToPath_done:
  947. Pop $3
  948. Pop $2
  949. Pop $1
  950. Pop $0
  951. FunctionEnd
  952. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  953. Function RemoveFromPath
  954. Exch $0
  955. Push $1
  956. Push $2
  957. Push $3
  958. Push $4
  959. Push $5
  960. Call IsNT
  961. Pop $1
  962. DetailPrint "Removing from PATH: $0"
  963. StrCmp $1 1 unRemoveFromPath_NT
  964. ; Not on NT
  965. StrCpy $1 $WINDIR 2
  966. FileOpen $1 "$1\autoexec.bat" r
  967. GetTempFileName $4
  968. FileOpen $2 $4 w
  969. GetFullPathName /SHORT $0 $0
  970. StrCpy $0 "SET PATH=%PATH%;$0"
  971. SetRebootFlag true
  972. Goto unRemoveFromPath_dosLoop
  973. unRemoveFromPath_dosLoop:
  974. FileRead $1 $3
  975. StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
  976. StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
  977. StrCmp $3 "$0" unRemoveFromPath_dosLoop
  978. StrCmp $3 "" unRemoveFromPath_dosLoopEnd
  979. FileWrite $2 $3
  980. Goto unRemoveFromPath_dosLoop
  981. unRemoveFromPath_dosLoopEnd:
  982. FileClose $2
  983. FileClose $1
  984. StrCpy $1 $WINDIR 2
  985. Delete "$1\autoexec.bat"
  986. CopyFiles /SILENT $4 "$1\autoexec.bat"
  987. Delete $4
  988. Goto unRemoveFromPath_done
  989. unRemoveFromPath_NT:
  990. Push $0
  991. StrLen $2 $0
  992. ReadRegStr $1 HKCU "Environment" "PATH"
  993. Push $1
  994. Push $0
  995. Call StrStr ; Find $0 in $1
  996. Pop $0 ; pos of our dir
  997. IntCmp $0 -1 unRemoveFromPath_NT_System
  998. ; else, it is in path
  999. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1000. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1001. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1002. StrLen $0 $1
  1003. StrCpy $1 $1 $0 $2
  1004. StrCpy $3 "$3$1"
  1005. WriteRegExpandStr HKCU "Environment" "PATH" $3
  1006. unRemoveFromPath_NT_System:
  1007. Pop $0
  1008. StrLen $2 $0
  1009. ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
  1010. Push $1
  1011. Push $0
  1012. Call StrStr ; Find $0 in $1
  1013. Pop $0 ; pos of our dir
  1014. IntCmp $0 -1 unRemoveFromPath_done
  1015. ; else, it is in path
  1016. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1017. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1018. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1019. StrLen $0 $1
  1020. StrCpy $1 $1 $0 $2
  1021. StrCpy $3 "$3$1"
  1022. WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
  1023. unRemoveFromPath_done:
  1024. Pop $5
  1025. Pop $4
  1026. Pop $3
  1027. Pop $2
  1028. Pop $1
  1029. Pop $0
  1030. FunctionEnd
  1031. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  1032. Function un.RemoveFromPath
  1033. Exch $0
  1034. Push $1
  1035. Push $2
  1036. Push $3
  1037. Push $4
  1038. Push $5
  1039. Call un.IsNT
  1040. Pop $1
  1041. StrCmp $1 1 unRemoveFromPath_NT
  1042. ; Not on NT
  1043. StrCpy $1 $WINDIR 2
  1044. FileOpen $1 "$1\autoexec.bat" r
  1045. GetTempFileName $4
  1046. FileOpen $2 $4 w
  1047. GetFullPathName /SHORT $0 $0
  1048. StrCpy $0 "SET PATH=%PATH%;$0"
  1049. SetRebootFlag true
  1050. Goto unRemoveFromPath_dosLoop
  1051. unRemoveFromPath_dosLoop:
  1052. FileRead $1 $3
  1053. StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
  1054. StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
  1055. StrCmp $3 "$0" unRemoveFromPath_dosLoop
  1056. StrCmp $3 "" unRemoveFromPath_dosLoopEnd
  1057. FileWrite $2 $3
  1058. Goto unRemoveFromPath_dosLoop
  1059. unRemoveFromPath_dosLoopEnd:
  1060. FileClose $2
  1061. FileClose $1
  1062. StrCpy $1 $WINDIR 2
  1063. Delete "$1\autoexec.bat"
  1064. CopyFiles /SILENT $4 "$1\autoexec.bat"
  1065. Delete $4
  1066. Goto unRemoveFromPath_done
  1067. unRemoveFromPath_NT:
  1068. Push $0
  1069. StrLen $2 $0
  1070. ReadRegStr $1 HKCU "Environment" "PATH"
  1071. Push $1
  1072. Push $0
  1073. Call un.StrStr ; Find $0 in $1
  1074. Pop $0 ; pos of our dir
  1075. IntCmp $0 -1 unRemoveFromPath_NT_System
  1076. ; else, it is in path
  1077. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1078. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1079. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1080. StrLen $0 $1
  1081. StrCpy $1 $1 $0 $2
  1082. StrCpy $3 "$3$1"
  1083. WriteRegExpandStr HKCU "Environment" "PATH" $3
  1084. unRemoveFromPath_NT_System:
  1085. Pop $0
  1086. StrLen $2 $0
  1087. ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
  1088. Push $1
  1089. Push $0
  1090. Call un.StrStr ; Find $0 in $1
  1091. Pop $0 ; pos of our dir
  1092. IntCmp $0 -1 unRemoveFromPath_done
  1093. ; else, it is in path
  1094. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1095. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1096. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1097. StrLen $0 $1
  1098. StrCpy $1 $1 $0 $2
  1099. StrCpy $3 "$3$1"
  1100. WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
  1101. unRemoveFromPath_done:
  1102. Pop $5
  1103. Pop $4
  1104. Pop $3
  1105. Pop $2
  1106. Pop $1
  1107. Pop $0
  1108. FunctionEnd
  1109. Function StrRep
  1110. ;Written by dirtydingus 2003-02-20 04:30:09
  1111. ; USAGE
  1112. ;Push String to do replacement in (haystack)
  1113. ;Push String to replace (needle)
  1114. ;Push Replacement
  1115. ;Call StrRep
  1116. ;Pop $R0 result
  1117. ;StrCpy $Result STR $R0
  1118. Exch $R4 ; $R4 = Replacement String
  1119. Exch
  1120. Exch $R3 ; $R3 = String to replace (needle)
  1121. Exch 2
  1122. Exch $R1 ; $R1 = String to do replacement in (haystack)
  1123. Push $R2 ; Replaced haystack
  1124. Push $R5 ; Len (needle)
  1125. Push $R6 ; len (haystack)
  1126. Push $R7 ; Scratch reg
  1127. StrCpy $R2 ""
  1128. StrLen $R5 $R3
  1129. StrLen $R6 $R1
  1130. loop:
  1131. StrCpy $R7 $R1 $R5
  1132. StrCmp $R7 $R3 found
  1133. StrCpy $R7 $R1 1 ; - optimization can be removed if U know len needle=1
  1134. StrCpy $R2 "$R2$R7"
  1135. StrCpy $R1 $R1 $R6 1
  1136. StrCmp $R1 "" done loop
  1137. found:
  1138. StrCpy $R2 "$R2$R4"
  1139. StrCpy $R1 $R1 $R6 $R5
  1140. StrCmp $R1 "" done loop
  1141. done:
  1142. StrCpy $R3 $R2
  1143. Pop $R7
  1144. Pop $R6
  1145. Pop $R5
  1146. Pop $R2
  1147. Pop $R1
  1148. Pop $R4
  1149. Exch $R3
  1150. FunctionEnd
  1151. !ifndef LVM_GETITEMCOUNT
  1152. !define LVM_GETITEMCOUNT 0x1004
  1153. !endif
  1154. !ifndef LVM_GETITEMTEXT
  1155. !define LVM_GETITEMTEXT 0x102D
  1156. !endif
  1157. Function DumpLog
  1158. Exch $5
  1159. Push $0
  1160. Push $1
  1161. Push $2
  1162. Push $3
  1163. Push $4
  1164. Push $6
  1165. FindWindow $0 "#32770" "" $HWNDPARENT
  1166. GetDlgItem $0 $0 1016
  1167. StrCmp $0 0 exit
  1168. FileOpen $5 $5 "w"
  1169. StrCmp $5 "" exit
  1170. SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
  1171. System::Alloc ${NSIS_MAX_STRLEN}
  1172. Pop $3
  1173. StrCpy $2 0
  1174. System::Call "*(i, i, i, i, i, i, i, i, i) i \
  1175. (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
  1176. loop: StrCmp $2 $6 done
  1177. System::Call "User32::SendMessageA(i, i, i, i) i \
  1178. ($0, ${LVM_GETITEMTEXT}, $2, r1)"
  1179. System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
  1180. FileWrite $5 "$4$\r$\n"
  1181. IntOp $2 $2 + 1
  1182. Goto loop
  1183. done:
  1184. FileClose $5
  1185. System::Free $1
  1186. System::Free $3
  1187. exit:
  1188. Pop $6
  1189. Pop $4
  1190. Pop $3
  1191. Pop $2
  1192. Pop $1
  1193. Pop $0
  1194. Exch $5
  1195. FunctionEnd