installers.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Installer details
  2. =================
  3. The installers pynsist builds do a number of things:
  4. 1. Install a number of files in the installation directory the user selects:
  5. - An embedded build of Python, including the standard library.
  6. - A copy of the necessary Microsoft C runtime for Python to run, if this
  7. is not already installed on the system.
  8. - The launcher script(s) that start your application
  9. - The icon(s) for your application launchers
  10. - Python packages your application needs
  11. - Any other files you specified
  12. 2. Create a start menu shortcut for each launcher script. If there is only one
  13. launcher, it will go in the top level of the start menu. If there's more than
  14. one, the installer will make a folder named after the application.
  15. 3. If you have specified any :ref:`commands <command_config>`, modify the
  16. :envvar:`PATH` environment variable in the registry, so that your commands
  17. will be available in a system command prompt.
  18. 4. Byte-compile all Python files in the ``pkgs`` subdirectory. This should
  19. slightly improve the startup time of your application.
  20. 5. Write an uninstaller, and the registry keys to put it in 'Add/remove programs'.
  21. The installer (and uninstaller) is produced using `NSIS
  22. <http://nsis.sourceforge.net/Main_Page>`_, with the Modern UI.
  23. Uncaught exceptions
  24. -------------------
  25. If there is an uncaught exception in your application - for instance if it fails
  26. to start because a package is missing - the traceback will be written to
  27. :file:`%APPDATA%\\{scriptname}.log`. On Windows 7, :envvar:`APPDATA` defaults to
  28. :file:`C:\\Users\\{username}\\AppData\\Roaming`. If users report crashes, details
  29. of the problem will probably be found there.
  30. You can override this by setting :func:`sys.excepthook`.
  31. This is only provided if you specify your application using ``entry_point``.
  32. You can also debug an installed application by using the installed Python to
  33. launch the application. This will show tracebacks in the Command Prompt.
  34. In the installation directory run::
  35. C:\\Program Files\\Application>Python\\python.exe "Application.launch.pyw"
  36. Working directory
  37. -----------------
  38. If users start your application from the start menu shortcuts, the working
  39. directory will be set to their home directory (``%HOMEDRIVE%%HOMEPATH%``). If
  40. they double-click on the scripts in the installation directory, the working
  41. directory will be the installation directory. Your application shouldn't
  42. rely on having a particular working directory; if it does, use :func:`os.chdir`
  43. to set it first.