installer.nsi 54 KB

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