niminst.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. =========================
  2. niminst User's manual
  3. =========================
  4. :Author: Andreas Rumpf
  5. :Version: |nimversion|
  6. .. default-role:: code
  7. .. include:: rstcommon.rst
  8. .. contents::
  9. Introduction
  10. ============
  11. niminst is a tool to generate an installer for a Nim program. Currently
  12. it can create an installer for Windows
  13. via `Inno Setup <http://www.jrsoftware.org/isinfo.php>`_ as well as
  14. installation/deinstallation scripts for UNIX. Later versions will support
  15. Linux' package management systems.
  16. niminst works by reading a configuration file that contains all the
  17. information that it needs to generate an installer for the different operating
  18. systems.
  19. Configuration file
  20. ==================
  21. niminst uses the Nim `parsecfg <parsecfg.html>`_ module to parse the
  22. configuration file. Here's an example of how the syntax looks like:
  23. .. include:: mytest.cfg
  24. :literal:
  25. The value of a key-value pair can reference user-defined variables via
  26. the `$variable` notation: They can be defined in the command line with the
  27. `--var:name=value`:option: switch. This is useful to not hard-coding the
  28. program's version number into the configuration file, for instance.
  29. It follows a description of each possible section and how it affects the
  30. generated installers.
  31. Project section
  32. ---------------
  33. The project section gathers general information about your project. It must
  34. contain the following key-value pairs:
  35. ==================== =======================================================
  36. Key description
  37. ==================== =======================================================
  38. `Name` the project's name; this needs to be a single word
  39. `DisplayName` the project's long name; this can contain spaces. If
  40. not specified, this is the same as `Name`.
  41. `Version` the project's version
  42. `OS` the OSes to generate C code for; for example:
  43. `"windows;linux;macosx"`
  44. `CPU` the CPUs to generate C code for; for example:
  45. `"i386;amd64;powerpc"`
  46. `Authors` the project's authors
  47. `Description` the project's description
  48. `App` the application's type: "Console" or "GUI". If
  49. "Console", niminst generates a special batch file
  50. for Windows to open up the command-line shell.
  51. `License` the filename of the application's license
  52. ==================== =======================================================
  53. `files` key
  54. -------------
  55. Many sections support the `files` key. Listed filenames
  56. can be separated by semicolon or the `files` key can be repeated. Wildcards
  57. in filenames are supported. If it is a directory name, all files in the
  58. directory are used::
  59. [Config]
  60. Files: "configDir"
  61. Files: "otherconfig/*.conf;otherconfig/*.cfg"
  62. Config section
  63. --------------
  64. The `config` section currently only supports the `files` key. Listed files
  65. will be installed into the OS's configuration directory.
  66. Documentation section
  67. ---------------------
  68. The `documentation` section supports the `files` key.
  69. Listed files will be installed into the OS's native documentation directory
  70. (which might be ``$appdir/doc``).
  71. There is a `start` key which determines whether the Windows installer
  72. generates a link to e.g. the ``index.html`` of your documentation.
  73. Other section
  74. -------------
  75. The `other` section currently only supports the `files` key.
  76. Listed files will be installed into the application installation directory
  77. (`$appdir`).
  78. Lib section
  79. -----------
  80. The `lib` section currently only supports the `files` key.
  81. Listed files will be installed into the OS's native library directory
  82. (which might be `$appdir/lib`).
  83. Windows section
  84. ---------------
  85. The `windows` section supports the `files` key for Windows-specific files.
  86. Listed files will be installed into the application installation directory
  87. (`$appdir`).
  88. Other possible options are:
  89. ==================== =======================================================
  90. Key description
  91. ==================== =======================================================
  92. `BinPath` paths to add to the Windows `%PATH%` environment
  93. variable. Example: ``BinPath: r"bin;dist\mingw\bin"``
  94. `InnoSetup` boolean flag whether an Inno Setup installer should be
  95. generated for Windows. Example: `InnoSetup: "Yes"`
  96. ==================== =======================================================
  97. UnixBin section
  98. ---------------
  99. The `UnixBin` section currently only supports the `files` key.
  100. Listed files will be installed into the OS's native bin directory
  101. (e.g. ``/usr/local/bin``). The exact location depends on the
  102. installation path the user specifies when running the `install.sh` script.
  103. Unix section
  104. ------------
  105. Possible options are:
  106. ==================== =======================================================
  107. Key description
  108. ==================== =======================================================
  109. `InstallScript` boolean flag whether an installation shell script
  110. should be generated. Example: `InstallScript: "Yes"`
  111. `UninstallScript` boolean flag whether a de-installation shell script
  112. should be generated.
  113. Example: `UninstallScript: "Yes"`
  114. ==================== =======================================================
  115. InnoSetup section
  116. -----------------
  117. Possible options are:
  118. ==================== =======================================================
  119. Key description
  120. ==================== =======================================================
  121. `path` Path to Inno Setup.
  122. Example: ``path = r"c:\inno setup 5\iscc.exe"``
  123. `flags` Flags to pass to Inno Setup.
  124. Example: `flags = "/Q"`
  125. ==================== =======================================================
  126. C_Compiler section
  127. ------------------
  128. Possible options are:
  129. ==================== =======================================================
  130. Key description
  131. ==================== =======================================================
  132. `path` Path to the C compiler.
  133. `flags` Flags to pass to the C Compiler.
  134. Example: `flags = "-w"`
  135. ==================== =======================================================
  136. Real-world example
  137. ==================
  138. The installers for the Nim compiler itself are generated by niminst. Have a
  139. look at its configuration file:
  140. .. include:: ../compiler/installer.ini
  141. :literal: