installers.rst 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. Installer details
  2. =================
  3. The installers pynsist builds do a number of things:
  4. 1. Unpack and run the Python .msi installer for the version of Python you
  5. specified.
  6. 2. Unpack and run the .msi installer for the `py launcher
  7. <https://bitbucket.org/vinay.sajip/pylauncher>`_, if you're using Python 2
  8. (in Python 3, this is installed as part of Python).
  9. 3. Install a number of files in the installation directory the user selects:
  10. - The launcher script(s) that start your application
  11. - The icon(s) for your application launchers
  12. - Python packages your application needs
  13. - Any other files you specified
  14. 4. Create a start menu shortcut for each launcher script. If there is only one
  15. launcher, it will go in the top level of the start menu. If there's more than
  16. one, the installer will make a folder named after the application.
  17. 5. Write an uninstaller, and the registry keys to put it in 'Add/remove programs'.
  18. The uninstaller only uninstalls your application (undoing steps 3-5); it
  19. leaves Python alone, because there might be other applications using Python.
  20. The installer (and uninstaller) is produced using `NSIS
  21. <http://nsis.sourceforge.net/Main_Page>`_, with the Modern UI.
  22. Uncaught exceptions
  23. -------------------
  24. If there is an uncaught exception in your application - for instance if it fails
  25. to start because a package is missing - the traceback will be written to
  26. :file:`%APPDATA%\\{scriptname}.log`. On Windows 7, :envvar:`APPDATA` defaults to
  27. :file:`C:\\Users\\{username}\\AppData\\Roaming`. If users report crashes, details
  28. of the problem will probably be found there.
  29. You can override this by setting :func:`sys.excepthook`.
  30. This is only provided if you specify your application using ``entry_point``.
  31. You can also debug an installed application by using the installed Python to
  32. launch the application. This will show tracebacks in the Command Prompt.
  33. In the installation directory run::
  34. C:\\Program Files\\Application>Python\\python.exe "Application.launch.pyw"
  35. Working directory
  36. -----------------
  37. If users start your application from the start menu shortcuts, the working
  38. directory will be set to their home directory (``%HOMEDRIVE%%HOMEPATH%``). If
  39. they double-click on the scripts in the installation directory, the working
  40. directory will be the installation directory. Your application shouldn't
  41. rely on having a particular working directory; if it does, use :func:`os.chdir`
  42. to set it first.