installer.nsi 52 KB

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