cfgfile.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. The Config File
  2. ===============
  3. All paths in the config file are relative to the directory where the config
  4. file is located, unless noted otherwise.
  5. Application section
  6. -------------------
  7. .. describe:: name
  8. The user-readable name of your application. This will be used for various
  9. display purposes in the installer, and for shortcuts and the folder in
  10. 'Program Files'.
  11. .. describe:: version
  12. The version number of your application.
  13. .. describe:: entry_point
  14. The function to launch your application, in the format ``module:function``.
  15. Dots are allowed in the module part. pynsist will create a script like this,
  16. plus some boilerplate::
  17. from module import function
  18. function()
  19. .. describe:: script (optional)
  20. Path to the Python script which launches your application, as an alternative
  21. to ``entry_point``.
  22. Ensure that this boilerplate code is at the top of your script::
  23. #!python3.3
  24. import sys
  25. sys.path.insert(0, 'pkgs')
  26. The first line tells it which version of Python to run with. If you use
  27. binary packages, packages compiled for Python 3.3 won't work with Python 3.4.
  28. The other lines make sure it can find the packages installed along with your
  29. application.
  30. .. note::
  31. Either ``entry_point`` or ``script`` must be specified, but not both. Specifying
  32. ``entry_point`` is normally easier and more reliable.
  33. .. describe:: icon (optional)
  34. Path to a ``.ico`` file to be used for shortcuts to your application. pynsis
  35. has a default generic icon, but you probably want to replace it.
  36. .. describe:: console (optional)
  37. If ``true``, shortcuts will be created using the ``py`` launcher, which opens
  38. a console for the process. If ``false``, or not specified, they will use the
  39. ``pyw`` launcher, which doesn't create a console.
  40. Shortcut sections
  41. -----------------
  42. One shortcut will always be generated for the application. You can add extra
  43. shortcuts by defining sections titled :samp:`Shortcut {Name}`. For example:
  44. .. code-block:: ini
  45. [Shortcut IPython Notebook]
  46. entry_point=IPython.html.notebookapp:launch_new_instance
  47. icon=scripts/ipython_nb.ico
  48. console=true
  49. .. describe:: entry_point
  50. script (optional)
  51. icon (optional)
  52. console (optional)
  53. These options all work the same way as in the Application section.
  54. .. versionadded:: 0.2
  55. .. _cfg_python:
  56. Python section
  57. --------------
  58. .. describe:: version
  59. The Python version to download and bundle with your application. At present,
  60. this needs to be at least ``3.3.0``.
  61. .. describe:: bitness (optional)
  62. ``32`` or ``64``, to use 32-bit (x86) or 64-bit (x64) Python. On Windows, this
  63. defaults to the version you're using, so that compiled modules will match. On
  64. other platforms, it defaults to 32-bit.
  65. Include section
  66. ---------------
  67. .. describe:: packages (optional)
  68. A list of importable package and module names to include in the installer.
  69. Specify only top-level packages, i.e. without a ``.`` in the name.
  70. .. describe:: files (optional)
  71. Extra files to be installed with your application.
  72. Build section
  73. -------------
  74. .. describe:: directory (optional)
  75. The build directory. Defaults to ``build/nsis/``.
  76. .. describe:: installer_name (optional)
  77. The filename of the installer, relative to the build directory. The default
  78. is made from your application name and version.
  79. .. describe:: nsi_template (optional)
  80. The path of a template .nsi file to specify further details of the installer.
  81. The default template is `part of pynsist <https://github.com/takluyver/pynsist/blob/master/nsist/template.nsi>`_.
  82. pynsist will add a definitions section at the top of the template, and look
  83. for tags ``;EXTRA_FILES_INSTALL`` and ``;EXTRA_FILES_UNINSTALL`` to insert lists
  84. of extra files and folders to be installed. See the
  85. `NSIS Scripting Reference <http://nsis.sourceforge.net/Docs/Chapter4.html>`_
  86. for details of the format.