summary refs log blame commit diff stats
path: root/doc/niminst.txt
blob: ca05cc514dc1ffbd1e2664ac05f1242da9e8f379 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

                         
                      
                      




             
                                                                       
                                                                   









                                                                              
                                                                     




























































                                                                              
                                                          

                                                                            

                                                                        



























































































                                                                               
                                                                           
                               
                                   
              
=========================
  niminst User's manual
=========================

:Author: Andreas Rumpf
:Version: |nimversion|

.. contents::

Introduction
============

niminst is a tool to generate an installer for a Nim program. Currently
it can create an installer for Windows 
via `Inno Setup <http://www.jrsoftware.org/isinfo.php>`_ as well as
installation/deinstallation scripts for UNIX. Later versions will support 
Linux' package management systems.

niminst works by reading a configuration file that contains all the 
information that it needs to generate an installer for the different operating
systems.


Configuration file
==================

niminst uses the Nim `parsecfg <parsecfg.html>`_ module to parse the 
configuration file. Here's an example of how the syntax looks like:

.. include:: doc/mytest.cfg
     :literal:

The value of a key-value pair can reference user-defined variables via
the ``$variable`` notation: They can be defined in the command line with the
``--var:name=value`` switch. This is useful to not hard-coding the
program's version number into the configuration file, for instance.

It follows a description of each possible section and how it affects the
generated installers.


Project section
---------------
The project section gathers general information about your project. It must
contain the following key-value pairs:

====================   =======================================================
Key                    description
====================   =======================================================
``Name``               the project's name; this needs to be a single word
``DisplayName``        the project's long name; this can contain spaces. If
                       not specified, this is the same as ``Name``.
``Version``            the project's version
``OS``                 the OSes to generate C code for; for example:
                       ``"windows;linux;macosx"``
``CPU``                the CPUs to generate C code for; for example:
                       ``"i386;amd64;powerpc"`` 
``Authors``            the project's authors
``Description``        the project's description
``App``                the application's type: "Console" or "GUI". If 
                       "Console", niminst generates a special batch file
                       for Windows to open up the command line shell.
``License``            the filename of the application's license
====================   =======================================================


``files`` key
-------------

Many sections support the ``files`` key. Listed filenames
can be separated by semicolon or the ``files`` key can be repeated. Wildcards
in filenames are supported. If it is a directory name, all files in the 
directory are used::

  [Config]
  Files: "configDir"
  Files: "otherconfig/*.conf;otherconfig/*.cfg"


Config section
--------------

The ``config`` section currently only supports the ``files`` key. Listed files
will be installed into the OS's configuration directory.


Documentation section
---------------------

The ``documentation`` section supports the ``files`` key. 
Listed files will be installed into the OS's native documentation directory 
(which might be ``$appdir/doc``).

There is a ``start`` key which determines whether the Windows installer 
generates a link to e.g. the ``index.html`` of your documentation.


Other section
-------------

The ``other`` section currently only supports the ``files`` key. 
Listed files will be installed into the application installation directory 
(``$appdir``).


Lib section
-----------

The ``lib`` section currently only supports the ``files`` key. 
Listed files will be installed into the OS's native library directory 
(which might be ``$appdir/lib``).


Windows section
---------------

The ``windows`` section supports the ``files`` key for Windows specific files. 
Listed files will be installed into the application installation directory 
(``$appdir``).

Other possible options are:

====================   =======================================================
Key                    description
====================   =======================================================
``BinPath``            paths to add to the Windows ``%PATH%`` environment
                       variable. Example: ``BinPath: r"bin;dist\mingw\bin"``
``InnoSetup``          boolean flag whether an Inno Setup installer should be
                       generated for Windows. Example: ``InnoSetup: "Yes"``
====================   =======================================================


UnixBin section
---------------

The ``UnixBin`` section currently only supports the ``files`` key. 
Listed files will be installed into the OS's native bin directory 
(e.g. ``/usr/local/bin``). The exact location depends on the
installation path the user specifies when running the ``install.sh`` script.


Unix section
------------

Possible options are:

====================   =======================================================
Key                    description
====================   =======================================================
``InstallScript``      boolean flag whether an installation shell script
                       should be generated. Example: ``InstallScript: "Yes"``
``UninstallScript``    boolean flag whether a deinstallation shell script
                       should be generated. 
                       Example: ``UninstallScript: "Yes"``
====================   =======================================================


InnoSetup section
-----------------

Possible options are:

====================   =======================================================
Key                    description
====================   =======================================================
``path``               Path to Inno Setup. 
                       Example: ``path = r"c:\inno setup 5\iscc.exe"``
``flags``              Flags to pass to Inno Setup.
                       Example: ``flags = "/Q"``
====================   =======================================================


C_Compiler section
------------------

Possible options are:

====================   =======================================================
Key                    description
====================   =======================================================
``path``               Path to the C compiler. 
``flags``              Flags to pass to the C Compiler.
                       Example: ``flags = "-w"``
====================   =======================================================


Real world example
==================

The installers for the Nim compiler itself are generated by niminst. Have a
look at its configuration file:

.. include:: compiler/installer.ini
     :literal:
n' href='/ahoang/Nim/blame/tools/kochdocs.nim?h=devel&id=e934ad61eb8265b7b5d3e6c385e87c5e8e95018d'>^
0a2f711b9 ^
b1b58b88c ^

b1b58b88c ^






532e2ee0b ^
4e120d599 ^
b1b58b88c ^





b1b58b88c ^


4f8cf945f ^
b1b58b88c ^

b1b58b88c ^


0a2f711b9 ^
b1b58b88c ^





























96bed814d ^
4f8cf945f ^
5df411bd6 ^
b1b58b88c ^
4f8cf945f ^
b1b58b88c ^








7d7cd6907 ^
b1b58b88c ^
















4f8cf945f ^

b1b58b88c ^



38bdf1cd7 ^
b1b58b88c ^





38bdf1cd7 ^
b1b58b88c ^













b1b58b88c ^





















































c492a7fd8 ^
b1b58b88c ^
2e5c75973 ^
b1b58b88c ^

2e5c75973 ^


ca4b971bc ^
2e5c75973 ^

b1b58b88c ^









4e120d599 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382