installer.nsi 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382
  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. "3.8", "3.7-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. !if "${REGVIEW}" == "32"
  304. !insertmacro PyBindingSection 3.5-32 .cp35-win32.pyd
  305. !insertmacro PyBindingSection 3.6-32 .cp36-win32.pyd
  306. !insertmacro PyBindingSection 3.7-32 .cp37-win32.pyd
  307. !insertmacro PyBindingSection 3.8-32 .cp38-win32.pyd
  308. !insertmacro PyBindingSection 3.9-32 .cp39-win32.pyd
  309. !else
  310. !insertmacro PyBindingSection 3.5 .cp35-win_amd64.pyd
  311. !insertmacro PyBindingSection 3.6 .cp36-win_amd64.pyd
  312. !insertmacro PyBindingSection 3.7 .cp37-win_amd64.pyd
  313. !insertmacro PyBindingSection 3.8 .cp38-win_amd64.pyd
  314. !insertmacro PyBindingSection 3.9 .cp39-win_amd64.pyd
  315. !endif
  316. SectionGroupEnd
  317. !ifdef INCLUDE_PYVER
  318. Section "Python ${INCLUDE_PYVER}" SecPython
  319. SectionIn 1 2 3
  320. !ifdef REGVIEW
  321. SetRegView ${REGVIEW}
  322. !endif
  323. SetDetailsPrint both
  324. DetailPrint "Installing Python ${INCLUDE_PYVER} interpreter (${REGVIEW}-bit)..."
  325. SetDetailsPrint listonly
  326. SetOutPath "$INSTDIR\bin"
  327. File /nonfatal "${BUILT}\bin\python*.dll"
  328. SetOutPath "$INSTDIR\python"
  329. File /r /x *.pdb "${BUILT}\python\*"
  330. SetDetailsPrint both
  331. DetailPrint "Adding registry keys for Python..."
  332. SetDetailsPrint listonly
  333. ; Check if a copy of Python is installed for this user.
  334. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  335. StrCmp "$0" "$INSTDIR\python" RegPath 0
  336. StrCmp "$0" "" SkipFileCheck 0
  337. IfFileExists "$0\python.exe" AskRegPath 0
  338. SkipFileCheck:
  339. ; Check if a system-wide copy of Python is installed.
  340. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  341. StrCmp "$0" "$INSTDIR\python" RegPath 0
  342. StrCmp "$0" "" RegPath 0
  343. IfFileExists "$0\python.exe" AskRegPath RegPath
  344. AskRegPath:
  345. MessageBox MB_YESNO|MB_ICONQUESTION \
  346. "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?" \
  347. IDNO SkipRegPath
  348. RegPath:
  349. WriteRegStr HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" "" "$INSTDIR\python"
  350. WriteRegStr HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" "ExecutablePath" "$INSTDIR\python\python.exe"
  351. SkipRegPath:
  352. SectionEnd
  353. Section "Install pip" SecEnsurePip
  354. SectionIn 1 2 3
  355. SetDetailsPrint both
  356. DetailPrint "Installing the pip package manager..."
  357. SetDetailsPrint listonly
  358. SetOutPath $INSTDIR
  359. nsExec::ExecToLog '"$INSTDIR\python\python.exe" -m ensurepip --default-pip'
  360. Pop $0
  361. DetailPrint "Command returned exit status $0"
  362. SectionEnd
  363. !endif
  364. !macro MaybeEnablePyBindingSection PYVER
  365. !if "${INCLUDE_PYVER}" != "${PYVER}"
  366. !ifdef SecPyBindings${PYVER}
  367. ; Check if a copy of Python is installed for this user.
  368. Push $0
  369. ReadRegStr $0 HKCU "Software\Python\PythonCore\${PYVER}\InstallPath" ""
  370. StrCmp "$0" "" +2 0
  371. IfFileExists "$0\python.exe" Py${PYVER}Exists 0
  372. ; Check if a system-wide copy of Python is installed.
  373. ReadRegStr $0 HKLM "Software\Python\PythonCore\${PYVER}\InstallPath" ""
  374. StrCmp "$0" "" Py${PYVER}ExistsNot 0
  375. IfFileExists "$0\python.exe" Py${PYVER}Exists Py${PYVER}ExistsNot
  376. Py${PYVER}Exists:
  377. SectionSetFlags ${SecPyBindings${PYVER}} ${SF_SELECTED}
  378. SectionSetInstTypes ${SecPyBindings${PYVER}} 3
  379. Py${PYVER}ExistsNot:
  380. Pop $0
  381. !endif
  382. !endif
  383. !macroend
  384. Function .onInit
  385. ${If} ${REGVIEW} = 64
  386. ${AndIfNot} ${RunningX64}
  387. 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."
  388. Abort
  389. ${EndIf}
  390. !ifdef REGVIEW
  391. SetRegView ${REGVIEW}
  392. !endif
  393. !if "${REGVIEW}" == "32"
  394. !insertmacro MaybeEnablePyBindingSection 3.5-32
  395. !insertmacro MaybeEnablePyBindingSection 3.6-32
  396. !insertmacro MaybeEnablePyBindingSection 3.7-32
  397. !insertmacro MaybeEnablePyBindingSection 3.8-32
  398. !insertmacro MaybeEnablePyBindingSection 3.9-32
  399. !else
  400. !insertmacro MaybeEnablePyBindingSection 3.5
  401. !insertmacro MaybeEnablePyBindingSection 3.6
  402. !insertmacro MaybeEnablePyBindingSection 3.7
  403. !insertmacro MaybeEnablePyBindingSection 3.8
  404. !insertmacro MaybeEnablePyBindingSection 3.9
  405. !endif
  406. FunctionEnd
  407. Function .onSelChange
  408. ; If someone selects any Python version, the "shared modules" must be on.
  409. ${If} ${SectionIsPartiallySelected} ${SecGroupPython}
  410. SectionGetFlags ${SecPyShared} $R0
  411. IntOp $R0 $R0 | ${SF_SELECTED}
  412. SectionSetFlags ${SecPyShared} $R0
  413. ${EndIf}
  414. !ifdef INCLUDE_PYVER
  415. ${If} ${SectionIsSelected} ${SecPython}
  416. !insertmacro SectionFlagIsSet ${SecEnsurePip} ${SF_RO} 0 SkipSelectEnsurePip
  417. !insertmacro SelectSection ${SecEnsurePip}
  418. SkipSelectEnsurePip:
  419. !insertmacro ClearSectionFlag ${SecEnsurePip} ${SF_RO}
  420. ${Else}
  421. !insertmacro UnselectSection ${SecEnsurePip}
  422. !insertmacro SetSectionFlag ${SecEnsurePip} ${SF_RO}
  423. ${EndIf}
  424. !endif
  425. FunctionEnd
  426. !ifdef INCLUDE_PYVER
  427. Function ConfirmPythonSelection
  428. ; Check the current state of the "Python" section selection.
  429. SectionGetFlags ${SecPython} $R0
  430. IntOp $R1 $R0 & ${SF_SELECTED}
  431. ; Is the "Python" selection deselected?
  432. StrCmp $R1 ${SF_SELECTED} SkipCheck 0
  433. ; Maybe the user just doesn't want Python support at all?
  434. !insertmacro SectionFlagIsSet ${SecGroupPython} ${SF_PSELECTED} 0 SkipCheck
  435. !ifdef REGVIEW
  436. SetRegView ${REGVIEW}
  437. !endif
  438. ; Check for a user installation of Python.
  439. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  440. StrCmp $0 "$INSTDIR\python" CheckSystemWidePython 0
  441. StrCmp $0 "" CheckSystemWidePython 0
  442. IfFileExists "$0\ppython.exe" CheckSystemWidePython 0
  443. IfFileExists "$0\python.exe" SkipCheck CheckSystemWidePython
  444. ; Check for a system-wide Python installation.
  445. CheckSystemWidePython:
  446. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  447. StrCmp $0 "$INSTDIR\python" AskConfirmation 0
  448. StrCmp $0 "" AskConfirmation 0
  449. IfFileExists "$0\ppython.exe" AskConfirmation 0
  450. IfFileExists "$0\python.exe" SkipCheck AskConfirmation
  451. ; No compatible Python version found (that wasn't shipped as part
  452. ; of a different Panda3D build.) Ask the user if he's sure about this.
  453. AskConfirmation:
  454. MessageBox MB_YESNO|MB_ICONQUESTION \
  455. "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." \
  456. IDYES SkipCheck
  457. ; User clicked no, so re-enable the select box and abort.
  458. IntOp $R0 $R0 | ${SF_SELECTED}
  459. SectionSetFlags ${SecPython} $R0
  460. Abort
  461. SkipCheck:
  462. FunctionEnd
  463. !endif
  464. Section "C++ support" SecHeadersLibs
  465. SectionIn 1 2
  466. SetDetailsPrint both
  467. DetailPrint "Installing header files..."
  468. SetDetailsPrint listonly
  469. SetOutPath $INSTDIR\include
  470. File /r /x *.exp "${BUILT}\include\*"
  471. SetDetailsPrint both
  472. DetailPrint "Installing library archives..."
  473. SetDetailsPrint listonly
  474. SetOutPath $INSTDIR\lib
  475. File /r /x *.exp "${BUILT}\lib\*"
  476. SectionEnd
  477. !ifdef HAVE_SAMPLES
  478. Section "Sample programs" SecSamples
  479. SectionIn 1 2
  480. ; Necessary for proper start menu shortcut installation
  481. SetShellVarContext current
  482. SetDetailsPrint both
  483. DetailPrint "Installing sample programs..."
  484. SetDetailsPrint listonly
  485. SetOutPath $INSTDIR\samples
  486. File /nonfatal /r /x CVS "${SOURCE}\samples\*"
  487. SetDetailsPrint both
  488. DetailPrint "Creating shortcuts..."
  489. SetDetailsPrint listonly
  490. SetOutPath $INSTDIR
  491. WriteINIStr $INSTDIR\Website.url "InternetShortcut" "URL" "https://www.panda3d.org/"
  492. WriteINIStr $INSTDIR\Manual.url "InternetShortcut" "URL" "https://www.panda3d.org/manual/index.php"
  493. WriteINIStr $INSTDIR\Samples.url "InternetShortcut" "URL" "https://www.panda3d.org/manual/index.php/Sample_Programs_in_the_Distribution"
  494. SetOutPath $INSTDIR
  495. CreateShortCut "$SMPROGRAMS\${TITLE}\Panda3D Manual.lnk" "$INSTDIR\Manual.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Panda3D Manual"
  496. CreateShortCut "$SMPROGRAMS\${TITLE}\Panda3D Website.lnk" "$INSTDIR\Website.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Panda3D Website"
  497. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Program Manual.lnk" "$INSTDIR\Samples.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Sample Program Manual"
  498. FindFirst $0 $1 $INSTDIR\samples\*
  499. loop:
  500. StrCmp $1 "" done
  501. StrCmp $1 "." next
  502. StrCmp $1 ".." next
  503. FindFirst $2 $3 $INSTDIR\samples\$1\*.py
  504. StrCmp $3 "" next
  505. Push $1
  506. Push "-"
  507. Push " "
  508. Call StrRep
  509. Call Capitalize
  510. Pop $R0
  511. StrCpy $READABLE $R0
  512. Push $1
  513. Push "-"
  514. Push "_"
  515. Call StrRep
  516. Pop $R0
  517. StrCpy $MANPAGE $R0
  518. DetailPrint "Creating shortcuts for sample program $READABLE"
  519. CreateDirectory "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE"
  520. SetOutPath $INSTDIR\samples\$1
  521. WriteINIStr $INSTDIR\samples\$1\ManualPage.url "InternetShortcut" "URL" "https://www.panda3d.org/wiki/index.php/Sample_Programs:_$MANPAGE"
  522. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\Manual Page.lnk" "$INSTDIR\samples\$1\ManualPage.url" "" "$INSTDIR\pandaIcon.ico" 0 "" "" "Manual Entry on this Sample Program"
  523. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\View Source Code.lnk" "$INSTDIR\samples\$1"
  524. iloop:
  525. StrCmp $3 "" idone
  526. CreateShortCut "$SMPROGRAMS\${TITLE}\Sample Programs\$READABLE\Run $3.lnk" "$INSTDIR\python\python.exe" "-E $3" "$INSTDIR\pandaIcon.ico" 0 SW_SHOWMINIMIZED "" "Run $3"
  527. CreateShortCut "$INSTDIR\samples\$1\Run $3.lnk" "$INSTDIR\python\python.exe" "-E $3" "$INSTDIR\pandaIcon.ico" 0 SW_SHOWMINIMIZED "" "Run $3"
  528. FindNext $2 $3
  529. goto iloop
  530. idone:
  531. next:
  532. FindNext $0 $1
  533. Goto loop
  534. done:
  535. SectionEnd
  536. !endif
  537. !ifdef HAVE_MAX_PLUGINS
  538. Section "3ds Max plug-ins" SecMaxPlugins
  539. SectionIn 1 2
  540. SetDetailsPrint both
  541. DetailPrint "Installing Autodesk 3ds Max plug-ins..."
  542. SetDetailsPrint listonly
  543. SetOutPath $INSTDIR\plugins
  544. File /nonfatal /r "${BUILT}\plugins\*.dle"
  545. File /nonfatal /r "${BUILT}\plugins\*.dlo"
  546. File /nonfatal /r "${BUILT}\plugins\*.ms"
  547. SectionEnd
  548. !endif
  549. !ifdef HAVE_MAYA_PLUGINS
  550. Section "Maya plug-ins" SecMayaPlugins
  551. SectionIn 1 2
  552. SetDetailsPrint both
  553. DetailPrint "Installing Autodesk Maya plug-ins..."
  554. SetDetailsPrint listonly
  555. SetOutPath $INSTDIR\plugins
  556. File /nonfatal /r "${BUILT}\plugins\*.mll"
  557. File /nonfatal /r "${BUILT}\plugins\*.mel"
  558. SectionEnd
  559. !endif
  560. Section -post
  561. !ifdef REGVIEW
  562. SetRegView ${REGVIEW}
  563. !endif
  564. ; Run eggcacher. We can't do this in SecCore because we haven't
  565. ; installed eggcacher at that point yet.
  566. SetDetailsPrint both
  567. DetailPrint "Preloading .egg files into the model cache..."
  568. SetDetailsPrint listonly
  569. SetOutPath $INSTDIR
  570. nsExec::ExecToLog '"$INSTDIR\python\python.exe" -m direct.directscripts.eggcacher --concise models samples'
  571. Pop $0
  572. DetailPrint "Command returned exit status $0"
  573. SetDetailsPrint both
  574. DetailPrint "Writing the uninstaller ..."
  575. SetDetailsPrint listonly
  576. Delete "$INSTDIR\uninst.exe"
  577. WriteUninstaller "$INSTDIR\uninst.exe"
  578. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "DisplayName" "${TITLE}"
  579. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}" "UninstallString" '"$INSTDIR\uninst.exe"'
  580. SetOutPath $INSTDIR
  581. CreateShortcut "$SMPROGRAMS\${TITLE}\Uninstall ${TITLE}.lnk" "$INSTDIR\uninst.exe" ""
  582. SetDetailsPrint both
  583. DetailPrint "Registering file type associations..."
  584. SetDetailsPrint listonly
  585. ; Even though we need the runtime to run these, we might as well tell
  586. ; Windows what this kind of file is.
  587. WriteRegStr HKCU "Software\Classes\.p3d" "" "Panda3D applet"
  588. WriteRegStr HKCU "Software\Classes\.p3d" "Content Type" "application/x-panda3d"
  589. WriteRegStr HKCU "Software\Classes\.p3d" "PerceivedType" "application"
  590. ; Register various model files
  591. WriteRegStr HKCU "Software\Classes\.egg" "" "Panda3D.Model"
  592. WriteRegStr HKCU "Software\Classes\.egg" "Content Type" "application/x-egg"
  593. WriteRegStr HKCU "Software\Classes\.egg" "PerceivedType" "gamemedia"
  594. WriteRegStr HKCU "Software\Classes\.bam" "" "Panda3D.Model"
  595. WriteRegStr HKCU "Software\Classes\.bam" "Content Type" "application/x-bam"
  596. WriteRegStr HKCU "Software\Classes\.bam" "PerceivedType" "gamemedia"
  597. WriteRegStr HKCU "Software\Classes\.pz" "" "Panda3D.Compressed"
  598. WriteRegStr HKCU "Software\Classes\.pz" "PerceivedType" "compressed"
  599. WriteRegStr HKCU "Software\Classes\.mf" "" "Panda3D.Multifile"
  600. WriteRegStr HKCU "Software\Classes\.mf" "PerceivedType" "compressed"
  601. WriteRegStr HKCU "Software\Classes\.prc" "" "inifile"
  602. WriteRegStr HKCU "Software\Classes\.prc" "Content Type" "text/plain"
  603. WriteRegStr HKCU "Software\Classes\.prc" "PerceivedType" "text"
  604. ; For convenience, if nobody registered .pyd, we will.
  605. ReadRegStr $0 HKCR "Software\Classes\.pyd" ""
  606. StrCmp $0 "" 0 +2
  607. WriteRegStr HKCU "Software\Classes\.pyd" "" "dllfile"
  608. SetDetailsPrint both
  609. DetailPrint "Adding directories to system PATH..."
  610. SetDetailsPrint listonly
  611. # Add the "bin" directory to the PATH.
  612. Push "$INSTDIR\python"
  613. Call RemoveFromPath
  614. Push "$INSTDIR\python\Scripts"
  615. Call RemoveFromPath
  616. Push "$INSTDIR\bin"
  617. Call RemoveFromPath
  618. Push "$INSTDIR\python;$INSTDIR\python\Scripts;$INSTDIR\bin"
  619. Call AddToPath
  620. # This is needed for the environment variable changes to take effect.
  621. DetailPrint "Broadcasting WM_WININICHANGE message..."
  622. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=500
  623. # Now dump the log to disk.
  624. StrCpy $0 "$INSTDIR\install.log"
  625. Push $0
  626. Call DumpLog
  627. SectionEnd
  628. Section Uninstall
  629. SetDetailsPrint listonly
  630. SetShellVarContext current
  631. !ifdef REGVIEW
  632. SetRegView ${REGVIEW}
  633. !endif
  634. SetDetailsPrint both
  635. DetailPrint "Removing registry entries..."
  636. SetDetailsPrint listonly
  637. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}"
  638. DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${TITLE}"
  639. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Model\DefaultIcon" ""
  640. StrCmp $0 "$INSTDIR\bin\pview.exe" 0 +3
  641. DeleteRegKey HKCU "Software\Classes\Panda3D.Model\DefaultIcon"
  642. DeleteRegKey HKCU "Software\Classes\Panda3D.Model\shell"
  643. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon" ""
  644. StrCmp $0 "$INSTDIR\bin\pzip.exe" 0 +3
  645. DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\DefaultIcon"
  646. DeleteRegKey HKCU "Software\Classes\Panda3D.Compressed\shell"
  647. ReadRegStr $0 HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon" ""
  648. StrCmp $0 "$INSTDIR\bin\multify.exe" 0 +3
  649. DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\DefaultIcon"
  650. DeleteRegKey HKCU "Software\Classes\Panda3D.Multifile\shell"
  651. !ifdef INCLUDE_PYVER
  652. ReadRegStr $0 HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  653. StrCmp $0 "$INSTDIR\python" 0 +2
  654. DeleteRegKey HKLM "Software\Python\PythonCore\${INCLUDE_PYVER}"
  655. ReadRegStr $0 HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}\InstallPath" ""
  656. StrCmp $0 "$INSTDIR\python" 0 +2
  657. DeleteRegKey HKCU "Software\Python\PythonCore\${INCLUDE_PYVER}"
  658. !endif
  659. !insertmacro RemovePythonPath 2.7
  660. !if "${REGVIEW}" == "32"
  661. !insertmacro RemovePythonPath 3.5-32
  662. !insertmacro RemovePythonPath 3.6-32
  663. !insertmacro RemovePythonPath 3.7-32
  664. !insertmacro RemovePythonPath 3.8-32
  665. !insertmacro RemovePythonPath 3.9-32
  666. !else
  667. !insertmacro RemovePythonPath 3.5
  668. !insertmacro RemovePythonPath 3.6
  669. !insertmacro RemovePythonPath 3.7
  670. !insertmacro RemovePythonPath 3.8
  671. !insertmacro RemovePythonPath 3.9
  672. !endif
  673. SetDetailsPrint both
  674. DetailPrint "Deleting files..."
  675. SetDetailsPrint listonly
  676. Delete "$INSTDIR\uninst.exe"
  677. RMDir /r "$INSTDIR"
  678. SetDetailsPrint both
  679. DetailPrint "Removing Start Menu entries..."
  680. SetDetailsPrint listonly
  681. SetShellVarContext current
  682. RMDir /r "$SMPROGRAMS\${TITLE}"
  683. SetShellVarContext all
  684. RMDir /r "$SMPROGRAMS\${TITLE}"
  685. SetDetailsPrint both
  686. DetailPrint "Removing entries from PATH..."
  687. SetDetailsPrint listonly
  688. Push "$INSTDIR\python"
  689. Call un.RemoveFromPath
  690. Push "$INSTDIR\python\Scripts"
  691. Call un.RemoveFromPath
  692. Push "$INSTDIR\bin"
  693. Call un.RemoveFromPath
  694. # This is needed for the environment variable changes to take effect.
  695. DetailPrint "Broadcasting WM_WININICHANGE message..."
  696. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=500
  697. SectionEnd
  698. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  699. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} $(DESC_SecCore)
  700. !ifdef HAVE_GL
  701. !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenGL} $(DESC_SecOpenGL)
  702. !endif
  703. !ifdef HAVE_DX9
  704. !insertmacro MUI_DESCRIPTION_TEXT ${SecDirect3D9} $(DESC_SecDirect3D9)
  705. !endif
  706. !ifdef HAVE_OPENAL
  707. !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenAL} $(DESC_SecOpenAL)
  708. !endif
  709. !ifdef HAVE_FMOD
  710. !insertmacro MUI_DESCRIPTION_TEXT ${SecFMOD} $(DESC_SecFMOD)
  711. !endif
  712. !ifdef HAVE_FFMPEG
  713. !insertmacro MUI_DESCRIPTION_TEXT ${SecFFMpeg} $(DESC_SecFFMpeg)
  714. !endif
  715. !ifdef HAVE_BULLET
  716. !insertmacro MUI_DESCRIPTION_TEXT ${SecBullet} $(DESC_SecBullet)
  717. !endif
  718. !ifdef HAVE_ODE
  719. !insertmacro MUI_DESCRIPTION_TEXT ${SecODE} $(DESC_SecODE)
  720. !endif
  721. !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} $(DESC_SecTools)
  722. !insertmacro MUI_DESCRIPTION_TEXT ${SecGroupPython} $(DESC_SecGroupPython)
  723. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyShared} $(DESC_SecPyShared)
  724. !if "${REGVIEW}" == "32"
  725. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5-32} $(DESC_SecPyBindings3.5-32)
  726. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6-32} $(DESC_SecPyBindings3.6-32)
  727. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.7-32} $(DESC_SecPyBindings3.7-32)
  728. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.8-32} $(DESC_SecPyBindings3.8-32)
  729. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.9-32} $(DESC_SecPyBindings3.9-32)
  730. !else
  731. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.5} $(DESC_SecPyBindings3.5)
  732. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.6} $(DESC_SecPyBindings3.6)
  733. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.7} $(DESC_SecPyBindings3.7)
  734. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.8} $(DESC_SecPyBindings3.8)
  735. !insertmacro MUI_DESCRIPTION_TEXT ${SecPyBindings3.9} $(DESC_SecPyBindings3.9)
  736. !endif
  737. !ifdef INCLUDE_PYVER
  738. !insertmacro MUI_DESCRIPTION_TEXT ${SecPython} $(DESC_SecPython)
  739. !insertmacro MUI_DESCRIPTION_TEXT ${SecEnsurePip} $(DESC_SecEnsurePip)
  740. !endif
  741. !insertmacro MUI_DESCRIPTION_TEXT ${SecHeadersLibs} $(DESC_SecHeadersLibs)
  742. !ifdef HAVE_SAMPLES
  743. !insertmacro MUI_DESCRIPTION_TEXT ${SecSamples} $(DESC_SecSamples)
  744. !endif
  745. !ifdef HAVE_MAX_PLUGINS
  746. !insertmacro MUI_DESCRIPTION_TEXT ${SecMaxPlugins} $(DESC_SecMaxPlugins)
  747. !endif
  748. !ifdef HAVE_MAYA_PLUGINS
  749. !insertmacro MUI_DESCRIPTION_TEXT ${SecMayaPlugins} $(DESC_SecMayaPlugins)
  750. !endif
  751. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  752. # --[ Utility Functions ]------------------------------------------------------
  753. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  754. Function IsNT
  755. Push $0
  756. ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
  757. StrCmp $0 "" 0 IsNT_yes
  758. ; we are not NT.
  759. Pop $0
  760. Push 0
  761. Return
  762. IsNT_yes:
  763. ; NT!!!
  764. Pop $0
  765. Push 1
  766. FunctionEnd
  767. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  768. Function un.IsNT
  769. Push $0
  770. ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
  771. StrCmp $0 "" 0 unIsNT_yes
  772. ; we are not NT.
  773. Pop $0
  774. Push 0
  775. Return
  776. unIsNT_yes:
  777. ; NT!!!
  778. Pop $0
  779. Push 1
  780. FunctionEnd
  781. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  782. Function StrStr
  783. Push $0
  784. Exch
  785. Pop $0 ; $0 now have the string to find
  786. Push $1
  787. Exch 2
  788. Pop $1 ; $1 now have the string to find in
  789. Exch
  790. Push $2
  791. Push $3
  792. Push $4
  793. Push $5
  794. StrCpy $2 -1
  795. StrLen $3 $0
  796. StrLen $4 $1
  797. IntOp $4 $4 - $3
  798. unStrStr_loop:
  799. IntOp $2 $2 + 1
  800. IntCmp $2 $4 0 0 unStrStrReturn_notFound
  801. StrCpy $5 $1 $3 $2
  802. StrCmp $5 $0 unStrStr_done unStrStr_loop
  803. unStrStrReturn_notFound:
  804. StrCpy $2 -1
  805. unStrStr_done:
  806. Pop $5
  807. Pop $4
  808. Pop $3
  809. Exch $2
  810. Exch 2
  811. Pop $0
  812. Pop $1
  813. FunctionEnd
  814. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  815. Function un.StrStr
  816. Push $0
  817. Exch
  818. Pop $0 ; $0 now have the string to find
  819. Push $1
  820. Exch 2
  821. Pop $1 ; $1 now have the string to find in
  822. Exch
  823. Push $2
  824. Push $3
  825. Push $4
  826. Push $5
  827. StrCpy $2 -1
  828. StrLen $3 $0
  829. StrLen $4 $1
  830. IntOp $4 $4 - $3
  831. unStrStr_loop:
  832. IntOp $2 $2 + 1
  833. IntCmp $2 $4 0 0 unStrStrReturn_notFound
  834. StrCpy $5 $1 $3 $2
  835. StrCmp $5 $0 unStrStr_done unStrStr_loop
  836. unStrStrReturn_notFound:
  837. StrCpy $2 -1
  838. unStrStr_done:
  839. Pop $5
  840. Pop $4
  841. Pop $3
  842. Exch $2
  843. Exch 2
  844. Pop $0
  845. Pop $1
  846. FunctionEnd
  847. ; Capitalizes the first letter of every word.
  848. Function Capitalize
  849. Exch $R0
  850. Push $0
  851. Push $1
  852. Push $2
  853. StrCpy $0 0
  854. capNext:
  855. ; Grab the next character.
  856. StrCpy $1 $R0 1 $0
  857. StrCmp $1 '' end
  858. ; Capitalize it.
  859. ${StrFilter} '$1' '+eng' '' '' $1
  860. ${StrFilter} '$1' '+rus' '' '' $1
  861. ; Splice it into the string.
  862. StrCpy $2 $R0 $0
  863. IntOp $0 $0 + 1
  864. StrCpy $R0 $R0 '' $0
  865. StrCpy $R0 '$2$1$R0'
  866. ; Keep looping through the characters until we find a
  867. ; delimiter or reach the end of the string.
  868. loop:
  869. StrCpy $1 $R0 1 $0
  870. IntOp $0 $0 + 1
  871. StrCmp $1 '' end
  872. StrCmp $1 ' ' capNext
  873. StrCmp $1 '_' capNext
  874. StrCmp $1 '-' capNext
  875. StrCmp $1 '(' capNext
  876. StrCmp $1 '[' capNext
  877. Goto loop
  878. end:
  879. Pop $2
  880. Pop $1
  881. Pop $0
  882. Exch $R0
  883. FunctionEnd
  884. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  885. ; Commentary and smarter ';' checking by Jon Parise <[email protected]>
  886. Function AddToPath
  887. Exch $0
  888. Push $1
  889. Push $2
  890. Push $3
  891. Call IsNT
  892. Pop $1
  893. DetailPrint "Adding to PATH: $0"
  894. StrCmp $1 1 AddToPath_NT
  895. ; We're not on NT, so modify the AUTOEXEC.BAT file.
  896. StrCpy $1 $WINDIR 2
  897. FileOpen $1 "$1\autoexec.bat" a
  898. FileSeek $1 0 END
  899. GetFullPathName /SHORT $0 $0
  900. FileWrite $1 "$\r$\nSET PATH=%PATH%;$0$\r$\n"
  901. FileClose $1
  902. Goto AddToPath_done
  903. AddToPath_NT:
  904. ClearErrors
  905. ReadRegStr $1 HKCU "Environment" "PATH"
  906. ; If we reached an error, WATCH OUT. Either this means that
  907. ; the registry key did not exist, or that it didn't fit in
  908. ; NSIS' string limit. If the latter, we have to be very
  909. ; careful not to overwrite the user's PATH.
  910. IfErrors AddToPath_Error
  911. DetailPrint "Current PATH value is set to $1"
  912. StrCmp $1 "" AddToPath_NTAddPath
  913. ; Pull off the last character of the PATH string. If it's a semicolon,
  914. ; we don't need to add another one, so jump to the section where we
  915. ; append the new PATH component(s).
  916. StrCpy $2 $1 1 -1
  917. StrCmp $2 ";" AddToPath_NTAddPath AddToPath_NTAddSemi
  918. AddToPath_Error:
  919. DetailPrint "Encountered error reading PATH variable."
  920. ; Does the variable exist? If it doesn't, then the
  921. ; error happened because we need to create the
  922. ; variable. If it does, then we failed to read it
  923. ; because we reached NSIS' string limit.
  924. StrCpy $3 0
  925. AddToPath_loop:
  926. EnumRegValue $4 HKCU "Environment" $3
  927. StrCmp $4 "PATH" AddToPath_ExceedLimit
  928. StrCmp $4 "" AddToPath_NTAddPath
  929. IntOp $3 $3 + 1
  930. Goto AddToPath_loop
  931. AddToPath_ExceedLimit:
  932. 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
  933. SetDetailsPrint both
  934. DetailPrint "Cannot append to PATH - variable is likely too long."
  935. SetDetailsPrint listonly
  936. Abort
  937. AddToPath_NTAddSemi:
  938. StrCpy $1 "$1;"
  939. Goto AddToPath_NTAddPath
  940. AddToPath_NTAddPath:
  941. StrCpy $0 "$1$0"
  942. WriteRegExpandStr HKCU "Environment" "PATH" $0
  943. AddToPath_done:
  944. Pop $3
  945. Pop $2
  946. Pop $1
  947. Pop $0
  948. FunctionEnd
  949. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  950. Function RemoveFromPath
  951. Exch $0
  952. Push $1
  953. Push $2
  954. Push $3
  955. Push $4
  956. Push $5
  957. Call IsNT
  958. Pop $1
  959. DetailPrint "Removing from PATH: $0"
  960. StrCmp $1 1 unRemoveFromPath_NT
  961. ; Not on NT
  962. StrCpy $1 $WINDIR 2
  963. FileOpen $1 "$1\autoexec.bat" r
  964. GetTempFileName $4
  965. FileOpen $2 $4 w
  966. GetFullPathName /SHORT $0 $0
  967. StrCpy $0 "SET PATH=%PATH%;$0"
  968. SetRebootFlag true
  969. Goto unRemoveFromPath_dosLoop
  970. unRemoveFromPath_dosLoop:
  971. FileRead $1 $3
  972. StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
  973. StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
  974. StrCmp $3 "$0" unRemoveFromPath_dosLoop
  975. StrCmp $3 "" unRemoveFromPath_dosLoopEnd
  976. FileWrite $2 $3
  977. Goto unRemoveFromPath_dosLoop
  978. unRemoveFromPath_dosLoopEnd:
  979. FileClose $2
  980. FileClose $1
  981. StrCpy $1 $WINDIR 2
  982. Delete "$1\autoexec.bat"
  983. CopyFiles /SILENT $4 "$1\autoexec.bat"
  984. Delete $4
  985. Goto unRemoveFromPath_done
  986. unRemoveFromPath_NT:
  987. Push $0
  988. StrLen $2 $0
  989. ReadRegStr $1 HKCU "Environment" "PATH"
  990. Push $1
  991. Push $0
  992. Call StrStr ; Find $0 in $1
  993. Pop $0 ; pos of our dir
  994. IntCmp $0 -1 unRemoveFromPath_NT_System
  995. ; else, it is in path
  996. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  997. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  998. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  999. StrLen $0 $1
  1000. StrCpy $1 $1 $0 $2
  1001. StrCpy $3 "$3$1"
  1002. WriteRegExpandStr HKCU "Environment" "PATH" $3
  1003. unRemoveFromPath_NT_System:
  1004. Pop $0
  1005. StrLen $2 $0
  1006. ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
  1007. Push $1
  1008. Push $0
  1009. Call StrStr ; Find $0 in $1
  1010. Pop $0 ; pos of our dir
  1011. IntCmp $0 -1 unRemoveFromPath_done
  1012. ; else, it is in path
  1013. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1014. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1015. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1016. StrLen $0 $1
  1017. StrCpy $1 $1 $0 $2
  1018. StrCpy $3 "$3$1"
  1019. WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
  1020. unRemoveFromPath_done:
  1021. Pop $5
  1022. Pop $4
  1023. Pop $3
  1024. Pop $2
  1025. Pop $1
  1026. Pop $0
  1027. FunctionEnd
  1028. ; From: http://nsis.sourceforge.net/archive/viewpage.php?pageid=91
  1029. Function un.RemoveFromPath
  1030. Exch $0
  1031. Push $1
  1032. Push $2
  1033. Push $3
  1034. Push $4
  1035. Push $5
  1036. Call un.IsNT
  1037. Pop $1
  1038. StrCmp $1 1 unRemoveFromPath_NT
  1039. ; Not on NT
  1040. StrCpy $1 $WINDIR 2
  1041. FileOpen $1 "$1\autoexec.bat" r
  1042. GetTempFileName $4
  1043. FileOpen $2 $4 w
  1044. GetFullPathName /SHORT $0 $0
  1045. StrCpy $0 "SET PATH=%PATH%;$0"
  1046. SetRebootFlag true
  1047. Goto unRemoveFromPath_dosLoop
  1048. unRemoveFromPath_dosLoop:
  1049. FileRead $1 $3
  1050. StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
  1051. StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
  1052. StrCmp $3 "$0" unRemoveFromPath_dosLoop
  1053. StrCmp $3 "" unRemoveFromPath_dosLoopEnd
  1054. FileWrite $2 $3
  1055. Goto unRemoveFromPath_dosLoop
  1056. unRemoveFromPath_dosLoopEnd:
  1057. FileClose $2
  1058. FileClose $1
  1059. StrCpy $1 $WINDIR 2
  1060. Delete "$1\autoexec.bat"
  1061. CopyFiles /SILENT $4 "$1\autoexec.bat"
  1062. Delete $4
  1063. Goto unRemoveFromPath_done
  1064. unRemoveFromPath_NT:
  1065. Push $0
  1066. StrLen $2 $0
  1067. ReadRegStr $1 HKCU "Environment" "PATH"
  1068. Push $1
  1069. Push $0
  1070. Call un.StrStr ; Find $0 in $1
  1071. Pop $0 ; pos of our dir
  1072. IntCmp $0 -1 unRemoveFromPath_NT_System
  1073. ; else, it is in path
  1074. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1075. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1076. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1077. StrLen $0 $1
  1078. StrCpy $1 $1 $0 $2
  1079. StrCpy $3 "$3$1"
  1080. WriteRegExpandStr HKCU "Environment" "PATH" $3
  1081. unRemoveFromPath_NT_System:
  1082. Pop $0
  1083. StrLen $2 $0
  1084. ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH"
  1085. Push $1
  1086. Push $0
  1087. Call un.StrStr ; Find $0 in $1
  1088. Pop $0 ; pos of our dir
  1089. IntCmp $0 -1 unRemoveFromPath_done
  1090. ; else, it is in path
  1091. StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
  1092. IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
  1093. IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
  1094. StrLen $0 $1
  1095. StrCpy $1 $1 $0 $2
  1096. StrCpy $3 "$3$1"
  1097. WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3
  1098. unRemoveFromPath_done:
  1099. Pop $5
  1100. Pop $4
  1101. Pop $3
  1102. Pop $2
  1103. Pop $1
  1104. Pop $0
  1105. FunctionEnd
  1106. Function StrRep
  1107. ;Written by dirtydingus 2003-02-20 04:30:09
  1108. ; USAGE
  1109. ;Push String to do replacement in (haystack)
  1110. ;Push String to replace (needle)
  1111. ;Push Replacement
  1112. ;Call StrRep
  1113. ;Pop $R0 result
  1114. ;StrCpy $Result STR $R0
  1115. Exch $R4 ; $R4 = Replacement String
  1116. Exch
  1117. Exch $R3 ; $R3 = String to replace (needle)
  1118. Exch 2
  1119. Exch $R1 ; $R1 = String to do replacement in (haystack)
  1120. Push $R2 ; Replaced haystack
  1121. Push $R5 ; Len (needle)
  1122. Push $R6 ; len (haystack)
  1123. Push $R7 ; Scratch reg
  1124. StrCpy $R2 ""
  1125. StrLen $R5 $R3
  1126. StrLen $R6 $R1
  1127. loop:
  1128. StrCpy $R7 $R1 $R5
  1129. StrCmp $R7 $R3 found
  1130. StrCpy $R7 $R1 1 ; - optimization can be removed if U know len needle=1
  1131. StrCpy $R2 "$R2$R7"
  1132. StrCpy $R1 $R1 $R6 1
  1133. StrCmp $R1 "" done loop
  1134. found:
  1135. StrCpy $R2 "$R2$R4"
  1136. StrCpy $R1 $R1 $R6 $R5
  1137. StrCmp $R1 "" done loop
  1138. done:
  1139. StrCpy $R3 $R2
  1140. Pop $R7
  1141. Pop $R6
  1142. Pop $R5
  1143. Pop $R2
  1144. Pop $R1
  1145. Pop $R4
  1146. Exch $R3
  1147. FunctionEnd
  1148. !ifndef LVM_GETITEMCOUNT
  1149. !define LVM_GETITEMCOUNT 0x1004
  1150. !endif
  1151. !ifndef LVM_GETITEMTEXT
  1152. !define LVM_GETITEMTEXT 0x102D
  1153. !endif
  1154. Function DumpLog
  1155. Exch $5
  1156. Push $0
  1157. Push $1
  1158. Push $2
  1159. Push $3
  1160. Push $4
  1161. Push $6
  1162. FindWindow $0 "#32770" "" $HWNDPARENT
  1163. GetDlgItem $0 $0 1016
  1164. StrCmp $0 0 exit
  1165. FileOpen $5 $5 "w"
  1166. StrCmp $5 "" exit
  1167. SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
  1168. System::Alloc ${NSIS_MAX_STRLEN}
  1169. Pop $3
  1170. StrCpy $2 0
  1171. System::Call "*(i, i, i, i, i, i, i, i, i) i \
  1172. (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
  1173. loop: StrCmp $2 $6 done
  1174. System::Call "User32::SendMessageA(i, i, i, i) i \
  1175. ($0, ${LVM_GETITEMTEXT}, $2, r1)"
  1176. System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
  1177. FileWrite $5 "$4$\r$\n"
  1178. IntOp $2 $2 + 1
  1179. Goto loop
  1180. done:
  1181. FileClose $5
  1182. System::Free $1
  1183. System::Free $3
  1184. exit:
  1185. Pop $6
  1186. Pop $4
  1187. Pop $3
  1188. Pop $2
  1189. Pop $1
  1190. Pop $0
  1191. Exch $5
  1192. FunctionEnd