installer.nsi 52 KB

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