ocran 1.3.17 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.txt +306 -272
  3. data/LICENSE.txt +22 -22
  4. data/README.md +549 -531
  5. data/exe/ocran +5 -5
  6. data/ext/extconf.rb +15 -0
  7. data/lib/ocran/build_constants.rb +16 -16
  8. data/lib/ocran/build_facade.rb +17 -17
  9. data/lib/ocran/build_helper.rb +110 -105
  10. data/lib/ocran/command_output.rb +22 -22
  11. data/lib/ocran/dir_builder.rb +162 -0
  12. data/lib/ocran/direction.rb +623 -386
  13. data/lib/ocran/file_path_set.rb +69 -69
  14. data/lib/ocran/gem_spec_queryable.rb +172 -172
  15. data/lib/ocran/host_config_helper.rb +57 -37
  16. data/lib/ocran/inno_setup_script_builder.rb +111 -111
  17. data/lib/ocran/launcher_batch_builder.rb +85 -85
  18. data/lib/ocran/library_detector.rb +61 -61
  19. data/lib/ocran/library_detector_posix.rb +55 -0
  20. data/lib/ocran/option.rb +323 -273
  21. data/lib/ocran/refine_pathname.rb +104 -104
  22. data/lib/ocran/runner.rb +115 -105
  23. data/lib/ocran/runtime_environment.rb +46 -46
  24. data/lib/ocran/stub_builder.rb +298 -224
  25. data/lib/ocran/version.rb +5 -5
  26. data/lib/ocran/windows_command_escaping.rb +15 -15
  27. data/lib/ocran.rb +7 -7
  28. data/share/ocran/lzma.exe +0 -0
  29. data/src/Makefile +75 -0
  30. data/src/edicon.c +161 -0
  31. data/src/error.c +100 -0
  32. data/src/error.h +66 -0
  33. data/src/inst_dir.c +334 -0
  34. data/src/inst_dir.h +157 -0
  35. data/src/lzma/7zTypes.h +529 -0
  36. data/src/lzma/Compiler.h +43 -0
  37. data/src/lzma/LzmaDec.c +1363 -0
  38. data/src/lzma/LzmaDec.h +236 -0
  39. data/src/lzma/Precomp.h +10 -0
  40. data/src/script_info.c +246 -0
  41. data/src/script_info.h +7 -0
  42. data/src/stub.c +133 -0
  43. data/src/stub.manifest +29 -0
  44. data/src/stub.rc +3 -0
  45. data/src/system_utils.c +1002 -0
  46. data/src/system_utils.h +209 -0
  47. data/src/system_utils_posix.c +500 -0
  48. data/src/unpack.c +574 -0
  49. data/src/unpack.h +85 -0
  50. data/src/vit-ruby.ico +0 -0
  51. metadata +55 -22
  52. data/share/ocran/edicon.exe +0 -0
  53. data/share/ocran/stub.exe +0 -0
  54. data/share/ocran/stubw.exe +0 -0
data/README.md CHANGED
@@ -1,531 +1,549 @@
1
- # ocran
2
-
3
- home :: https://github.com/largo/ocran/
4
-
5
- issues :: http://github.com/largo/ocran/issues
6
-
7
- ## Description
8
-
9
- OCRAN (One-Click Ruby Application Next) builds Windows executables from Ruby
10
- source code. The executable is a self-extracting, self-running
11
- executable that contains the Ruby interpreter, your source code and
12
- any additionally needed ruby libraries or DLL.
13
-
14
- OCRAN is a fork of Ocra (https://github.com/larsch/ocra) in order to
15
- maintain compatibility with newer Ruby versions after 3.0
16
-
17
- ## Recommended usage
18
- Most commonly you will needs this, when you want to ship your program to windows servers / users that don't have Ruby installed.
19
- By default each time the .exe is opened it will extract the ruby interpeter along with the code to the temp directory.
20
- Since this process takes time, we recommend using the innosetup edition which will install your program together with the ruby intepreter into
21
- a directory.
22
-
23
- ## Features
24
-
25
- * LZMA Compression (optional, default on)
26
- * Both windowed/console mode supported
27
- * Includes gems based on usage, or from a Bundler Gemfile
28
-
29
- ## Problems & Bug Reporting
30
-
31
- * Windows support only
32
-
33
- If you experience problems with OCRAN or have found a bug, please use
34
- the issue tracker on GitHub (http://github.com/largo/ocran/issues).
35
-
36
- ## Safety
37
-
38
- As this gem comes with binaries, we have taken actions to insure your safety.
39
- The gem releases are built on Github Actions. Feel free verify that it matches the version on rubygems.
40
- It ships with seb.exe and LZMA.exe in this repository, which come from official sources.
41
-
42
- ## Installation
43
-
44
- Gem:
45
-
46
- gem install ocran
47
-
48
- Alternatively you can download the gem at either
49
- http://rubygems.org/gems/ocran or
50
- https://github.com/largo/ocran/releases/.
51
-
52
- ## Synopsis
53
-
54
- ### Building an executable:
55
-
56
- ocran script.rb
57
-
58
- Will package `script.rb`, the Ruby interpreter and all
59
- dependencies (gems and DLLs) into an executable named
60
- `script.exe`.
61
-
62
- ### Command line:
63
-
64
- ocran [options] script.rb [<other files> ...] [-- <script arguments> ...]
65
-
66
- ### Options:
67
-
68
- ocran --help
69
-
70
- Ocran options:
71
-
72
- --help Display this information.
73
- --quiet Suppress output while building executable.
74
- --verbose Show extra output while building executable.
75
- --version Display version number and exit.
76
-
77
- Packaging options:
78
-
79
- --dll dllname Include additional DLLs from the Ruby bindir.
80
- --add-all-core Add all core ruby libraries to the executable.
81
- --gemfile <file> Add all gems and dependencies listed in a Bundler Gemfile.
82
- --no-enc Exclude encoding support files
83
-
84
- Gem content detection modes:
85
-
86
- --gem-minimal[=gem1,..] Include only loaded scripts
87
- --gem-guess=[gem1,...] Include loaded scripts & best guess (DEFAULT)
88
- --gem-all[=gem1,..] Include all scripts & files
89
- --gem-full[=gem1,..] Include EVERYTHING
90
- --gem-spec[=gem1,..] Include files in gemspec (Does not work with Rubygems 1.7+)
91
-
92
- --[no-]gem-scripts[=..] Other script files than those loaded
93
- --[no-]gem-files[=..] Other files (e.g. data files)
94
- --[no-]gem-extras[=..] Extra files (README, etc.)
95
-
96
- Gem modes:
97
-
98
- * *minimal*: loaded scripts
99
- * *guess*: loaded scripts and other files
100
- * *all*: loaded scripts, other scripts, other files (except extras)
101
- * *full*: Everything found in the gem directory
102
-
103
- File groups:
104
-
105
- * *scripts*: .rb/.rbw files
106
- * *extras*: C/C++ sources, object files, test, spec, README
107
- * *files*: all other files
108
-
109
- Auto-detection options:
110
-
111
- --no-dep-run Don't run script.rb to check for dependencies.
112
- --no-autoload Don't load/include script.rb's autoloads.
113
- --no-autodll Disable detection of runtime DLL dependencies.
114
-
115
- Output options:
116
-
117
- --output <file> Name the exe to generate. Defaults to ./<scriptname>.exe.
118
- --no-lzma Disable LZMA compression of the executable.
119
- --innosetup <file> Use given Inno Setup script (.iss) to create an installer.
120
-
121
- Executable options:
122
-
123
- --windows Force Windows application (rubyw.exe)
124
- --console Force console application (ruby.exe)
125
- --chdir-first When exe starts, change working directory to app dir.
126
- --icon <ico> Replace icon with a custom one.
127
- --rubyopt <str> Set the RUBYOPT environment variable when running the executable
128
- --debug Executable will be verbose.
129
- --debug-extract Executable will unpack to local dir and not delete after.
130
-
131
-
132
- ### Compilation:
133
-
134
- * OCRAN will load your script (using `Kernel#load`) and build
135
- the executable when it exits.
136
-
137
- * Your program should 'require' all necessary files when invoked without
138
- arguments, so OCRAN can detect all dependencies.
139
-
140
- * DLLs are detected automatically but only those located in your Ruby
141
- installation are included.
142
-
143
- * .rb files will become console applications. .rbw files will become
144
- windowed application (without a console window popping
145
- up). Alternatively, use the `--console` or
146
- `--windows` options.
147
-
148
- ### Running your application:
149
-
150
- * The 'current working directory' is not changed by OCRAN when running
151
- your application. You must change to the installation or temporary
152
- directory yourself. See also below.
153
- * When the application is running, the OCRAN_EXECUTABLE environment
154
- variable points to the .exe (with full path).
155
- * The temporary location of the script can be obtained by inspected
156
- the $0 variable.
157
- * OCRAN does not set up the include path. Use `$:.unshift
158
- File.dirname($0)` at the start of your script if you need to
159
- 'require' additional source files from the same directory as your
160
- main script.
161
-
162
- ### Pitfalls:
163
-
164
- * Avoid modifying load paths at run time. Specify load paths using -I
165
- or RUBYLIB if you must, but don't expect OCRAN to preserve them for
166
- runtime. OCRAN may pack sources into other directories than you
167
- expect.
168
- * If you use .rbw files or the `--windows` option, then check
169
- that your application works with rubyw.exe before trying with OCRAN.
170
- * Avoid absolute paths in your code and when invoking OCRAN.
171
-
172
- ### Multibyte path and filename support:
173
-
174
- * OCRAN-built executables can correctly handle multibyte paths and filenames
175
- (e.g., Japanese or emoji) on Windows. To use this feature, the executable
176
- must be run on Windows 10 version 1903 or later.
177
- * When using OCRAN-built executables from the console, we recommend running
178
- `chcp 65001` to switch the code page to UTF-8. This ensures proper
179
- input/output of multibyte characters in Command Prompt (CMD) and
180
- PowerShell.
181
-
182
- ## REQUIREMENTS:
183
-
184
- * Windows
185
- * Working Ruby installation.
186
- * Ruby Installation with devkit from rubyinstaller (when working with the source code only)
187
-
188
- ## Development
189
-
190
- ### Quick start
191
-
192
- Quickly set up the development environment and run the full test suite:
193
-
194
- git clone https://github.com/largo/ocran.git
195
- cd ocran
196
- bin/setup # install Bundler & all dev gems, generate stub for tests
197
- bundle exec rake # run the entire Minitest suite
198
-
199
- ### Developer Utilities (bin/ scripts)
200
-
201
- All scripts in the `bin/` directory are designed for developers and can be executed in any standard Windows shell, including Command Prompt (CMD), PowerShell, and Git Bash.
202
-
203
- | Script | Purpose |
204
- |---------------|--------------------------------------------------------------------------|
205
- | `bin/setup` | Installs Bundler and all required development gems, then builds stub.exe |
206
- | `bin/console` | Launches an IRB console with OCRAN preloaded |
207
-
208
-
209
- ### Rake tasks (Windows compatible)
210
-
211
- | Task | Purpose |
212
- |--------------|------------------------------------------------------------------------|
213
- | `rake build` | Compile stub.exe (requires MSVC or mingw‑w64 + DevKit) |
214
- | `rake clean` | Remove generated binaries (e.g., stub.exe); temp files are not deleted |
215
- | `rake test` | Execute all unit & integration tests |
216
-
217
- ## Technical details
218
-
219
- OCRAN first runs the target script in order to detect any files that
220
- are loaded and used at runtime (Using `Kernel#require` and
221
- `Kernel#load`).
222
-
223
- OCRAN embeds everything needed to run a Ruby script into a single
224
- executable file. The file contains the .exe stub which is compiled
225
- from C-code, and a custom opcode format containing instructions to
226
- create directories, save files, set environment variables and run
227
- programs. The OCRAN script generates this executable and the
228
- instructions to be run when it is launched.
229
-
230
- When executed, the OCRAN stub extracts the Ruby interpreter and your
231
- scripts into a temporary directory. The directory will contains the
232
- same directory layout as your Ruby installlation. The source files for
233
- your application will be put in the 'src' subdirectory.
234
-
235
- ### Libraries
236
-
237
- Any code that is loaded through `Kernel#require` when your
238
- script is executed will be included in the OCRAN
239
- executable. Conditionally loaded code will not be loaded and included
240
- in the executable unless the code is actually run when OCRAN invokes
241
- your script. Otherwise, OCRAN won't know about it and will not include
242
- the source files.
243
-
244
- RubyGems are handled specially. Whenever a file from a Gem is
245
- detected, OCRAN will attempt to include all the required files from
246
- that specific Gem, expect some unlikely needed files such as readme's
247
- and other documentation. This behaviour can be controlled by using the
248
- --gem-* options. Behaviour can be changed for all gems or specific
249
- gems using --gem-*=gemname.
250
-
251
- Libraries found in non-standard path (for example, if you invoke OCRAN
252
- with "ruby -I some/path") will be placed into the site dir
253
- (lib/ruby/site_ruby). Avoid changing `$LOAD_PATH` or
254
- `$:` from your script to include paths outside your source
255
- tree, since OCRAN may place the files elsewhere when extracted into the
256
- temporary directory.
257
-
258
- In case your script (or any of its dependencies) sets up autoloaded
259
- module using `Kernel#autoload`, OCRAN will automatically try to
260
- load them to ensure that they are all included in the
261
- executable. Modules that doesn't exist will be ignored (a warning will
262
- be logged).
263
-
264
- Dynamic link libraries (.dll files, for example WxWidgets, or other
265
- source files) will be detected and included by OCRAN.
266
-
267
- ### Including libraries non-automatically
268
-
269
- If an application or framework is complicated enough that it tends
270
- to confuse Ocran's automatic dependency resolution, then you can
271
- use other means to specify what needs to be packaged with your app.
272
-
273
- To disable automatic dependency resolution, use the `--no-dep-run`
274
- option; with it, Ocran will skip executing your program during the
275
- build process. This on the other hand requires using `--gem-full` option
276
- (see more below); otherwise Ocran will not include all the necessary
277
- files for the gems.
278
-
279
- You will also probably need to use the `--add-all-core` option to
280
- include the Ruby core libraries.
281
-
282
- If your app uses gems, then you can specify them in a
283
- Bundler (http://gembundler.com) Gemfile, then use the --gemfile
284
- option to supply it to Ocran. Ocran will automatically include all
285
- gems specified, and all their dependencies.
286
-
287
- (Note: This assumes that the gems are installed in your system,
288
- *not* locally packaged inside the app directory by "bundle package")
289
-
290
- These options are particularly useful for packaging Rails
291
- applications. For example, to package a Rails 3 app in the
292
- directory "someapp" and create an exe named "someapp.exe", without
293
- actually running the app during the build, you could use the
294
- following command:
295
-
296
- ocran someapp/script/rails someapp --output someapp.exe --add-all-core \
297
- --gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first -- server
298
-
299
- Note the space between `--` and `server`! It's important; `server` is
300
- an argument to be passed to rails when the script is ran.
301
-
302
- Rails 2 apps can be packaged similarly, though you will have to
303
- integrate them with Bundler (http://gembundler.com/rails23.html)
304
- first.
305
-
306
- ### Gem handling
307
-
308
- By default, Ocran includes all scripts that are loaded by your script
309
- when it is run before packaging. Ocran detects which gems are using and
310
- includes any additional non-script files from those gems, except
311
- trivial files such as C/C++ source code, object files, READMEs, unit
312
- tests, specs, etc.
313
-
314
- This behaviour can be changed by using the --gem-* options. There are
315
- four possible modes:
316
-
317
- * *minimal*: Include only loaded scripts
318
- * *guess*: Include loaded scripts and important files (DEFAULT)
319
- * *all*: Include all scripts and important files
320
- * *full*: Include all files
321
-
322
- If you find that files are missing from the resulting executable, try
323
- first with --gem-all=gemname for the gem that is missing, and if that
324
- does not work, try --gem-full=gemname. The paranoid can use --gem-full
325
- to include all files for all required gems.
326
-
327
- ### Creating an installer for your application
328
-
329
- To make your application start up quicker, or to allow it to
330
- keep files in its application directory between runs, or if
331
- you just want to make your program seem more like a "regular"
332
- Windows application, you can have Ocran generate an installer
333
- for your app with the free Inno Setup software.
334
-
335
- You will first have to download and install Inno Setup 5 or
336
- later, and also add its directory to your PATH (so that Ocran
337
- can find the ISCC compiler program). Once you've done that,
338
- you can use the `--innosetup` option to Ocran to supply an
339
- Inno Setup script. Do not add any [Files] or [Dirs] sections
340
- to the script; Ocran will figure those out itself.
341
-
342
- To continue the Rails example above, let's package the Rails 3
343
- app into an installer. Save the following as `someapp.iss`:
344
-
345
- [Setup]
346
- AppName=SomeApp
347
- AppVersion=0.1
348
- DefaultDirName={pf}\SomeApp
349
- DefaultGroupName=SomeApp
350
- OutputBaseFilename=SomeAppInstaller
351
-
352
- [Icons]
353
- Name: "{group}\SomeApp"; Filename: "{app}\someapp.bat"; IconFilename: "{app}\someapp.ico"; Flags: runminimized;
354
- Name: "{group}\Uninstall SomeApp"; Filename: "{uninstallexe}"
355
-
356
- Then, run Ocran with this command:
357
-
358
- ocran someapp/script/rails someapp --output someapp.exe --add-all-core \
359
- --gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first --no-lzma \
360
- --icon someapp.ico --innosetup someapp.iss -- server
361
-
362
- If all goes well, a file named "SomeAppInstaller.exe" will be placed
363
- into the Output directory.
364
-
365
- ### Environment variables
366
-
367
- OCRAN executables clear the RUBYLIB environment variable before your
368
- script is launched. This is done to ensure that your script does not
369
- use load paths from the end user's Ruby installation.
370
-
371
- OCRAN executables set the RUBYOPT environment variable to the value it
372
- had when you invoked OCRAN. For example, if you had "RUBYOPT=rubygems"
373
- on your build PC, OCRAN ensures that it is also set on PC's running the
374
- executables.
375
-
376
- OCRAN executables set OCRAN_EXECUTABLE to the full path of the
377
- executable, for example
378
-
379
- ENV["OCRAN_EXECUTABLE"] # => C:\Program Files\MyApp\MyApp.exe
380
-
381
- ### Working directory
382
-
383
- The OCRAN executable does not change the working directory when it is
384
- launched, unless you use the `--chdir-first` option.
385
-
386
- You should not assume that the current working directory when invoking
387
- an executable built with .exe is the location of the source script. It
388
- can be the directory where the executable is placed (when invoked
389
- through the Windows Explorer), the users' current working directory
390
- (when invoking from the Command Prompt), or even
391
- `C:\\WINDOWS\\SYSTEM32` when the executable is invoked through
392
- a file association.
393
-
394
- With the `--chdir-first` option, the working directory will
395
- always be the common parent directory of your source files. This
396
- should be fine for most applications. However, if your application
397
- is designed to run from the command line and take filenames as
398
- arguments, then you cannot use this option.
399
-
400
- If you wish to maintain the user's working directory, but need to
401
- `require` additional Ruby scripts from the source directory, you can
402
- add the following line to your script:
403
-
404
- $LOAD_PATH.unshift File.dirname($0)
405
-
406
- ### Load path mangling
407
-
408
- Adding paths to `$LOAD_PATH` or `$:` at runtime is not
409
- recommended. Adding relative load paths depends on the working
410
- directory being the same as where the script is located (See
411
- above). If you have additional library files in directories below the
412
- directory containing your source script you can use this idiom:
413
-
414
- $LOAD_PATH.unshift File.join(File.dirname($0), 'path/to/script')
415
-
416
- ### Detecting
417
-
418
- You can detect whether OCRAN is currently building your script by
419
- looking for the 'Ocran' constant. If it is defined, OCRAN is currenly
420
- building the executable from your script. For example, you can use
421
- this to avoid opening a GUI window when compiling executables:
422
-
423
- app = MyApp.new
424
- app.main_loop unless defined?(Ocran)
425
-
426
- ### Additional files and resources
427
-
428
- You can add additional files to the OCRAN executable (for example
429
- images) by appending them to the command line. They should be placed
430
- in the source directory with your main script (or a subdirectory).
431
-
432
- ocran mainscript.rb someimage.jpeg docs/document.txt
433
-
434
- This will create the following layout in the temporary directory when
435
- your program is executed:
436
-
437
- src/mainscript.rb
438
- src/someimage.jpeg
439
- src/docs/document.txt
440
-
441
- Both files, directoriess and glob patterns can be specified on the
442
- command line. Files will be added as-is. If a directory is specified,
443
- OCRAN will include all files found below that directory. Glob patterns
444
- (See Dir.glob) can be used to specify a specific set of files, for
445
- example:
446
-
447
- ocran script.rb assets/**/*.png
448
-
449
- ### Command Line Arguments
450
-
451
- To pass command line argument to your script (both while building and
452
- when run from the resulting executable), specify them after a
453
- `--` marker. For example:
454
-
455
- ocran script.rb -- --some-options=value
456
-
457
- This will pass `--some-options=value` to the script when
458
- build and when running the executable. Any extra argument specified by
459
- the user when invoking the executable will be appended after the
460
- compile-time arguments.
461
-
462
- ### Window/Console
463
-
464
- By default, OCRAN builds console application from .rb-files and
465
- windowed applications (without console window) from .rbw-files.
466
-
467
- Ruby on Windows provides two executables: ruby.exe is a console mode
468
- application and rubyw.exe is a windowed application which does not
469
- bring up a console window when launched using the Windows Explorer.
470
- By default, or if the `--console` option is used, OCRAN will
471
- use the console runtime (ruby.exe). OCRAN will automatically select the
472
- windowed runtime when your script has the ".rbw" extension, or if you
473
- specify the `--windows` command line option.
474
-
475
- If your application works in console mode but not in windowed mode,
476
- first check if your script works without OCRAN using rubyw.exe. A
477
- script that prints to standard output (using puts, print etc.) will
478
- eventually cause an exception when run with rubyw.exe (when the IO
479
- buffers run full).
480
-
481
- You can also try wrapping your script in an exception handler that
482
- logs any errors to a file:
483
-
484
- begin
485
- # your script here
486
- rescue Exception => e
487
- File.open("except.log") do |f|
488
- f.puts e.inspect
489
- f.puts e.backtrace
490
- end
491
- end
492
-
493
- ## CREDITS:
494
-
495
- Lars Christensen and contributors for the OCRA project which this is forked from.
496
-
497
- Kevin Walzer of codebykevin, Maxim Samsonov for ocra2, John Mair for codesigining support (to be merged)
498
-
499
- Thanks for Igor Pavlov for the LZMA compressor and decompressor. The
500
- source code used was place into Public Domain by Igor Pavlov.
501
-
502
- Erik Veenstra for rubyscript2exe which provided inspiration.
503
-
504
- Dice for the default .exe icon (vit-ruby.ico,
505
- http://ruby.morphball.net/vit-ruby-ico_en.html)
506
-
507
- ## LICENSE:
508
-
509
- (The MIT License)
510
-
511
- Copyright (c) 2009-2020 Lars Christensen
512
- Copyright (c) 2020-2025 The OCRAN Committers Team
513
-
514
- Permission is hereby granted, free of charge, to any person obtaining
515
- a copy of this software and associated documentation files (the
516
- 'Software'), to deal in the Software without restriction, including
517
- without limitation the rights to use, copy, modify, merge, publish,
518
- distribute, sublicense, and/or sell copies of the Software, and to
519
- permit persons to whom the Software is furnished to do so, subject to
520
- the following conditions:
521
-
522
- The above copyright notice and this permission notice shall be
523
- included in all copies or substantial portions of the Software.
524
-
525
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
526
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
527
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
528
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
529
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
530
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
531
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # ocran
2
+
3
+ home :: https://github.com/largo/ocran/
4
+
5
+ issues :: http://github.com/largo/ocran/issues
6
+
7
+ ## Description
8
+
9
+ OCRAN (One-Click Ruby Application Next) packages Ruby applications for
10
+ distribution. It bundles your script, the Ruby interpreter, gems, and native
11
+ libraries into a single self-contained artifact that runs without requiring
12
+ Ruby to be installed on the target machine.
13
+
14
+ OCRAN supports four output formats, all cross-platform:
15
+
16
+ * **Self-extracting executable** — bundles everything into a single binary that unpacks and runs transparently, with no Ruby installation required. Produces a `.exe` on Windows, and a native executable on Linux and macOS.
17
+ * **macOS app bundle** (`--macosx-bundle`) — wraps the executable in a `.app` bundle for Finder integration, Dock icons, and code signing.
18
+ * **Directory** (`--output-dir`) copies all files into a folder with a ready-to-run launch script (`.sh` on Linux/macOS, `.bat` on Windows).
19
+ * **Zip archive** (`--output-zip`) same as directory output, packed into a `.zip`.
20
+
21
+ OCRAN is a fork of [OCRA](https://github.com/larsch/ocra) maintained for
22
+ Ruby 3.2+ compatibility.
23
+
24
+ ## Recommended usage
25
+
26
+ The most common use-case is shipping a program to Windows servers or users
27
+ who do not have Ruby installed. By default, each time the `.exe` is opened it
28
+ extracts the Ruby interpreter and your code to a temporary directory and runs
29
+ them from there.
30
+
31
+ Because extraction takes time on each launch, consider using the Inno Setup
32
+ option (`--innosetup`) to produce a proper installer that extracts once to a
33
+ permanent directory.
34
+
35
+ For cross-platform packaging or CI artifacts, use `--output-dir` or
36
+ `--output-zip` to produce a portable directory/archive that runs with the
37
+ bundled Ruby on Linux, macOS, or Windows.
38
+
39
+ ## Features
40
+
41
+ * **Windows/Linux/macOS executable** — self-extracting, self-running executable (primary output)
42
+ * **macOS app bundle** — `.app` bundle with `Info.plist` for Finder/Dock/code-signing (`--macosx-bundle`)
43
+ * **Directory output** — portable directory with a launch script (`--output-dir`)
44
+ * **Zip archive output** — portable zip with a launch script (`--output-zip`)
45
+ * LZMA compression (optional, default on, for `.exe` only)
46
+ * Both windowed and console mode supported (Windows)
47
+ * Gems included based on actual usage, or from a Bundler Gemfile
48
+ * Code-signing compatible
49
+ * Multibyte (UTF-8) path support on Windows 10 1903+
50
+
51
+ ## Problems & Bug Reporting
52
+
53
+ If you experience problems with OCRAN or have found a bug, please use the
54
+ issue tracker on GitHub (http://github.com/largo/ocran/issues).
55
+
56
+ ## Safety
57
+
58
+ As this gem ships with binary blobs, releases are securely built on GitHub
59
+ Actions. Feel free to verify that the published gem matches the source.
60
+
61
+ This repository includes `lzma.exe` from the
62
+ [official ip7z/7zip release](https://github.com/ip7z/7zip/releases)
63
+ (version 22.01, from `lzma2201.7z`), used to compress Windows executables.
64
+
65
+ `stub.exe`, `stubw.exe`, and `edicon.exe` are compiled from source in this
66
+ repository.
67
+
68
+ ## Installation
69
+
70
+ gem install ocran
71
+
72
+ Alternatively, download from http://rubygems.org/gems/ocran or
73
+ https://github.com/largo/ocran/releases/.
74
+
75
+ ## Synopsis
76
+
77
+ ### Building a Windows executable:
78
+
79
+ ocran script.rb
80
+
81
+ Packages `script.rb`, the Ruby interpreter, and all dependencies (gems and
82
+ DLLs) into `script.exe`.
83
+
84
+ ### Building a portable directory (Linux / macOS / Windows):
85
+
86
+ ocran --output-dir myapp/ script.rb
87
+
88
+ Copies all files into `myapp/` and writes a `script.sh` (or `script.bat` on
89
+ Windows) launch script.
90
+
91
+ ### Building a macOS app bundle:
92
+
93
+ ocran --macosx-bundle script.rb
94
+
95
+ Produces `script.app/` — a standard macOS `.app` bundle containing the
96
+ self-extracting executable at `Contents/MacOS/script` and an `Info.plist`.
97
+ Open it with `open script.app` or double-click it in Finder.
98
+
99
+ ocran --macosx-bundle --output MyApp --bundle-id com.example.myapp --icon icon.icns script.rb
100
+
101
+ Custom name, bundle identifier and icon (must be `.icns` format). The icon is
102
+ placed at `Contents/Resources/AppIcon.icns` and referenced in `Info.plist`.
103
+
104
+ ### Building a zip archive:
105
+
106
+ ocran --output-zip myapp.zip script.rb
107
+
108
+ Same as `--output-dir`, but packages the result into a zip file. Requires
109
+ `zip` on Linux/macOS or PowerShell on Windows.
110
+
111
+ ### Command line:
112
+
113
+ ocran [options] script.rb [<other files> ...] [-- <script arguments> ...]
114
+
115
+ ### Options:
116
+
117
+ ocran --help
118
+
119
+ #### General options:
120
+
121
+ * `--help`: Display available command-line options.
122
+ * `--quiet`: Suppress all output during the build process.
123
+ * `--verbose`: Provide detailed output during the build process.
124
+ * `--version`: Display the OCRAN version number and exit.
125
+
126
+ #### Packaging options:
127
+
128
+ * `--dll <dllname>`: Include additional DLLs from the Ruby `bin` directory.
129
+ * `--add-all-core`: Add all standard Ruby core libraries to the executable.
130
+ * `--gemfile <file>`: Include all gems and dependencies listed in a Bundler `Gemfile`.
131
+ * `--no-enc`: Exclude encoding support files to reduce output size.
132
+
133
+ #### Gem content detection modes:
134
+
135
+ These options control which files from included gems are added to the output.
136
+
137
+ * `--gem-minimal[=gem1,..]`: Include only scripts actually loaded during the dependency run.
138
+ * `--gem-guess[=gem1,..]`: Include loaded scripts and a best guess of other needed files (DEFAULT).
139
+ * `--gem-all[=gem1,..]`: Include all scripts and important files from the gem.
140
+ * `--gem-full[=gem1,..]`: Include every file in the gem directory.
141
+ * `--gem-spec[=gem1,..]`: Include files listed in the gemspec (not compatible with newer RubyGems).
142
+
143
+ Fine-tuning flags:
144
+
145
+ * `--[no-]gem-scripts[=..]`: Include/exclude non-loaded script files (`.rb`, `.rbw`).
146
+ * `--[no-]gem-files[=..]`: Include/exclude data files.
147
+ * `--[no-]gem-extras[=..]`: Include/exclude extras (READMEs, tests, C sources).
148
+
149
+ #### Auto-detection options:
150
+
151
+ * `--no-dep-run`: Skip running the script to detect dependencies. Use this if your script has side effects during load or if you are manually specifying all dependencies. Requires `--add-all-core` and `--gem-full`.
152
+ * `--no-autoload`: Do not attempt to load `autoload`ed constants.
153
+ * `--no-autodll`: Disable automatic detection of runtime DLL dependencies.
154
+
155
+ #### Output options:
156
+
157
+ * `--output <file>`: Name the generated executable. Defaults to `./<scriptname>.exe` on Windows and `./<scriptname>` on Linux/macOS.
158
+ * `--output-dir <dir>`: Output all files to a directory with a launch script instead of building an executable. Works on Linux, macOS, and Windows.
159
+ * `--output-zip <file>`: Output a zip archive containing all files and a launch script. Requires `zip` (Linux/macOS) or PowerShell (Windows).
160
+ * `--macosx-bundle`: Build a macOS `.app` bundle. Use `--output` to set the bundle name (default: `<scriptname>.app`). (macOS)
161
+ * `--bundle-id <id>`: Set the `CFBundleIdentifier` in `Info.plist` (default: `com.example.<appname>`). Used with `--macosx-bundle`.
162
+ * `--no-lzma`: Disable LZMA compression (faster build, larger executable).
163
+ * `--innosetup <file>`: Use an Inno Setup script (`.iss`) to create a Windows installer.
164
+
165
+ #### Executable options:
166
+
167
+ * `--windows`: Force a Windows GUI application (uses `rubyw.exe`). (Windows only)
168
+ * `--console`: Force a console application (uses `ruby.exe`). (Windows only)
169
+ * `--chdir-first`: Change working directory to the app's extraction directory before the script starts.
170
+ * `--icon <ico>`: Replace the default icon with a custom `.ico` file.
171
+ * `--rubyopt <str>`: Set `RUBYOPT` when the executable runs.
172
+ * `--debug`: Enable verbose output when the generated executable runs.
173
+ * `--debug-extract`: Unpack to a local directory and do not delete after execution (useful for troubleshooting).
174
+
175
+ ### Compilation:
176
+
177
+ * OCRAN runs your script (using `Kernel#load`) and builds the output when it exits.
178
+ * Your program should `require` all necessary files when invoked without arguments so OCRAN can detect all dependencies.
179
+ * DLLs are detected automatically; only those within your Ruby installation are included.
180
+ * `.rb` files become console applications; `.rbw` files become windowed applications (without a console window popping up on Windows). Use `--console` or `--windows` to override.
181
+
182
+ ### Running your application:
183
+
184
+ * The working directory is not changed by OCRAN unless you use `--chdir-first`. You must change to the installation or temporary
185
+ directory yourself. See also below.
186
+ * When a `.exe` is running, `OCRAN_EXECUTABLE` points to the `.exe` with its full path.
187
+ * The temporary location of the script is available via `$0`.
188
+ * OCRAN does not set up the include path. Add `$:.unshift File.dirname($0)` at the start of your script if you need to `require` additional files from the same directory as your main script.
189
+
190
+ ### Directory and zip output (Linux / macOS / Windows):
191
+
192
+ When using `--output-dir` or `--output-zip`, OCRAN produces the same file
193
+ layout as a `.exe` would extract to:
194
+
195
+ bin/ # Ruby interpreter and shared libraries
196
+ lib/ # Ruby standard library
197
+ gems/ # Bundled gems
198
+ src/ # Your application source files
199
+ script.sh # Launch script (Linux/macOS) — or script.bat on Windows
200
+
201
+ The launch script sets `RUBYLIB`, `GEM_HOME`, `GEM_PATH`, and any other
202
+ environment variables, then runs your script with the bundled Ruby.
203
+
204
+ On Linux/macOS, make the script executable and run it:
205
+
206
+ chmod +x myapp/script.sh
207
+ ./myapp/script.sh
208
+
209
+ On Windows, run the batch file:
210
+
211
+ myapp\script.bat
212
+
213
+ ### Pitfalls:
214
+
215
+ * Avoid modifying load paths at runtime. Use `-I` or `RUBYLIB` if needed, but don't expect OCRAN to preserve them for runtime. OCRAN may pack sources into other directories than you
216
+ expect
217
+ * If you use `.rbw` files or `--windows`, verify your application works with `rubyw.exe` before building.
218
+ * Avoid absolute paths in your code and when invoking OCRAN.
219
+
220
+ ### Multibyte path and filename support:
221
+
222
+ * OCRAN-built executables correctly handle multibyte paths (e.g. Japanese, emoji) on Windows 10 1903+.
223
+ * When using the executable from the console, run `chcp 65001` first to switch to UTF-8 on windows.
224
+
225
+ ## Requirements
226
+
227
+ * Ruby 3.2+
228
+ * For building Windows `.exe`: Windows with RubyInstaller DevKit (mingw-w64), or Wine on Linux/macOS
229
+ * For `--output-dir` / `--output-zip`: any platform with Ruby 3.2+
230
+ * For `--output-zip` on Linux/macOS: the `zip` command must be available
231
+ * For `--output-zip` on Windows: PowerShell (included in Windows 8+)
232
+
233
+ ### Output architecture
234
+
235
+ The architecture of the generated executable matches the Ruby interpreter used to run OCRAN:
236
+
237
+ * **macOS (Intel / Apple Silicon)** — The output binary targets the same CPU as your Ruby installation. If you build with an ARM64 Ruby (Apple Silicon), the result is an ARM64 executable and will not run on Intel Macs. Build on Intel (or with an Intel Ruby under Rosetta) to produce a universally compatible x86-64 binary.
238
+
239
+ * **Windows on ARM (Windows 11 ARM)** — RubyInstaller recently started shipping ARM64 builds; Installing the ARM64 RubyInstaller on a Windows ARM machine and running OCRAN from it will produce an ARM64 `.exe`. These run on ARM Windows natively. Installing the standard x86-64 RubyInstaller on a Windows ARM machine and running OCRAN from it will (probably?) produce an x86-64 `.exe`. These run on ARM Windows via the built-in x86-64 emulation layer, so the executables work on both ARM and x86-64 Windows targets. If you use `--no-lzma`, note that `lzma.exe` (the bundled compressor) is also x86-64 and relies on the same emulation.
240
+
241
+ ## Development
242
+
243
+ ### Quick start
244
+
245
+ git clone https://github.com/largo/ocran.git
246
+ cd ocran
247
+ bin/setup # install Bundler & all dev gems, build stubs
248
+ bundle exec rake # run the full Minitest suite
249
+ exe/ocran filename.rb # build filename.rb as an executable
250
+
251
+ ### Developer utilities (`bin/` scripts)
252
+
253
+ | Script | Purpose |
254
+ |---------------|--------------------------------------------------------------------------|
255
+ | `bin/setup` | Installs Bundler and all required development gems, then builds stub.exe |
256
+ | `bin/console` | Launches an IRB console with OCRAN preloaded |
257
+
258
+ ### Rake tasks
259
+
260
+ | Task | Purpose |
261
+ |--------------|------------------------------------------------------------------------|
262
+ | `rake build` | Compile stub(.exe) (requires MSVC or mingw-w64 + DevKit or Unix build tools) |
263
+ | `rake clean` | Remove generated binaries |
264
+ | `rake test` | Execute all unit & integration tests |
265
+
266
+ ## Technical details
267
+
268
+ OCRAN first runs the target script to detect files loaded at runtime (via
269
+ `Kernel#require` and `Kernel#load`).
270
+
271
+ For `.exe` output, OCRAN embeds everything into a single executable: a C stub,
272
+ and a custom opcode stream containing instructions to create directories,
273
+ extract files, set environment variables, and launch the script. The stub
274
+ extracts everything to a temporary directory at runtime and runs the script.
275
+
276
+ For `--output-dir` / `--output-zip`, OCRAN performs the same file collection
277
+ but writes directly to the filesystem and generates a shell/batch launch
278
+ script instead of an opcode stream.
279
+
280
+ ### Libraries
281
+
282
+ Any code loaded through `Kernel#require` when your script runs is included.
283
+ Conditionally loaded code is only included if it is actually executed during
284
+ the OCRAN build run.
285
+ Otherwise, OCRAN won't know about it and will not include
286
+ the source files.
287
+ You can use `defined?(OCRAN)` to check if the script is running while OCRAN is building it and exit the script after dependencies are loaded but before the main logic runs.
288
+
289
+ RubyGems are handled specially: when a file from a gem is detected, OCRAN
290
+ includes the required files from that gem. It does not automatically include all the files of the Gem, which could be required at runtime. This behavior is controlled with
291
+ the `--gem-*` options.
292
+
293
+ Libraries found in non-standard path (for example, if you invoke OCRAN
294
+ with "ruby -I some/path") will be placed into the site dir
295
+ (lib/ruby/site_ruby). Avoid changing `$LOAD_PATH` or
296
+ `$:` from your script to include paths outside your source
297
+ tree, since OCRAN may place the files elsewhere when extracted into the
298
+ temporary directory.
299
+
300
+ If your script uses `Kernel#autoload`, OCRAN will attempt to load those
301
+ constants so they are included in the output. Missing modules are ignored
302
+ with a warning.
303
+
304
+ Dynamic link libraries (.dll files, for example WxWidgets, or other
305
+ source files) will be detected and included by OCRAN.
306
+
307
+ ### Including libraries non-automatically
308
+
309
+ If automatic dependency resolution is insufficient, use `--no-dep-run` to
310
+ skip running your script. This requires `--gem-full` and typically
311
+ `--add-all-core`.
312
+
313
+ You can specify gems via a Bundler Gemfile with `--gemfile`. OCRAN includes
314
+ all listed gems and their dependencies (they must be installed, not vendored
315
+ via `bundle package`).
316
+
317
+ Example packaging a Rails app without running it:
318
+
319
+ ocran someapp/script/rails someapp --output someapp.exe --add-all-core \
320
+ --gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first -- server
321
+
322
+ Note the space between `--` and `server`! It's important; `server` is
323
+ an argument to be passed to rails when the script is ran.
324
+ ### Gem handling
325
+
326
+ By default, OCRAN includes all scripts loaded by your script plus important
327
+ non-script files from those gems, excluding C/C++ sources, object files,
328
+ READMEs, tests, and specs.
329
+
330
+ Four modes:
331
+
332
+ * *minimal*: Loaded scripts only
333
+ * *guess*: Loaded scripts and important files (DEFAULT)
334
+ * *all*: All scripts and important files
335
+ * *full*: All files in the gem directory
336
+
337
+ If files are missing from the output, try `--gem-all=gemname` first, then
338
+ `--gem-full=gemname`. Use `--gem-full` to include everything for all gems.
339
+
340
+ ### Code-signing a macOS app bundle
341
+
342
+ After building with `--macosx-bundle`, sign the bundle with your Developer ID:
343
+
344
+ codesign --deep --force --verify --verbose \
345
+ --sign "Developer ID Application: Your Name (TEAMID)" \
346
+ MyApp.app
347
+
348
+ Verify the signature:
349
+
350
+ codesign --verify --deep --strict --verbose=2 MyApp.app
351
+ spctl --assess --type execute --verbose MyApp.app
352
+
353
+ For distribution outside the Mac App Store, notarize with Apple:
354
+
355
+ # Submit for notarization (requires app-specific password or API key)
356
+ xcrun notarytool submit MyApp.app \
357
+ --apple-id you@example.com \
358
+ --team-id TEAMID \
359
+ --password APP_SPECIFIC_PASSWORD \
360
+ --wait
361
+
362
+ # Staple the notarization ticket so it works offline
363
+ xcrun stapler staple MyApp.app
364
+
365
+ Requirements:
366
+ * Xcode Command Line Tools (`xcode-select --install`)
367
+ * An Apple Developer account with a "Developer ID Application" certificate in Keychain
368
+
369
+ ### Creating a Windows installer
370
+
371
+ To make your application start faster or keep files between runs, use
372
+ `--innosetup` to generate an Inno Setup installer.
373
+
374
+ Install Inno Setup 5+ and add it to your `PATH`, then supply an `.iss` script:
375
+
376
+ Make sure that iss is in the PATH environment variable by running the command `iss` in your terminal.
377
+
378
+ Do not add any [Files] or [Dirs] sections
379
+ to the script; Ocran will figure those out itself.
380
+ To continue the Rails example above, let's package the Rails application
381
+ into an installer. Save the following as `someapp.iss`:
382
+
383
+ [Setup]
384
+ AppName=SomeApp
385
+ AppVersion=0.1
386
+ DefaultDirName={pf}\SomeApp
387
+ DefaultGroupName=SomeApp
388
+ OutputBaseFilename=SomeAppInstaller
389
+
390
+ [Icons]
391
+ Name: "{group}\SomeApp"; Filename: "{app}\someapp.bat"; IconFilename: "{app}\someapp.ico"; Flags: runminimized;
392
+ Name: "{group}\Uninstall SomeApp"; Filename: "{uninstallexe}"
393
+
394
+ ocran someapp/script/rails someapp --output someapp.exe --add-all-core \
395
+ --gemfile someapp/Gemfile --no-dep-run --gem-full --chdir-first --no-lzma \
396
+ --icon someapp.ico --innosetup someapp.iss -- server
397
+
398
+ If all goes well, a file named "SomeAppInstaller.exe" will be placed
399
+ into the Output directory.
400
+
401
+ ### Environment variables
402
+
403
+ OCRAN clears the `RUBYLIB` environment variable before running your script so it does not pick up load
404
+ paths from the end user's Ruby installation.
405
+
406
+ OCRAN sets the `RUBYOPT` environment variable to the value it had when you invoked OCRAN. For `.exe`
407
+ output, `OCRAN_EXECUTABLE` is set to the full path of the running executable:
408
+
409
+ ENV["OCRAN_EXECUTABLE"] # => C:\Program Files\MyApp\MyApp.exe
410
+
411
+ ### Working directory
412
+
413
+ The OCRAN executable does not change the working directory when it starts. It only changes the working directory when you use
414
+ `--chdir-first`.
415
+
416
+ You should not assume that the current working directory when invoking
417
+ an executable built with .exe is the location of the source script. It
418
+ can be the directory where the executable is placed (when invoked
419
+ through the Windows Explorer), the users' current working directory
420
+ (when invoking from the Command Prompt), or even
421
+ `C:\\WINDOWS\\SYSTEM32` when the executable is invoked through
422
+ a file association.
423
+
424
+ With `--chdir-first`, the working directory is always the common parent
425
+ directory of your source files. Do not use this if your application takes
426
+ filenames as command-line arguments.
427
+
428
+ To `require` additional files from the source directory while keeping the
429
+ user's working directory:
430
+
431
+ $LOAD_PATH.unshift File.dirname($0)
432
+
433
+ ### Detecting OCRAN at build time
434
+
435
+ Check for the `Ocran` constant to detect whether OCRAN is currently building
436
+ your script:
437
+
438
+ app = MyApp.new
439
+ app.main_loop unless defined?(Ocran)
440
+
441
+ ### Additional files and resources
442
+
443
+ Append extra files, directories, or glob patterns to the command line:
444
+
445
+ ocran mainscript.rb someimage.jpeg docs/document.txt
446
+ ocran script.rb assets/**/*.png
447
+
448
+ This produces the following layout in the output (temp dir for `.exe`,
449
+ or the output directory for `--output-dir`):
450
+
451
+ src/mainscript.rb
452
+ src/someimage.jpeg
453
+ src/docs/document.txt
454
+
455
+ Both files, directoriess and glob patterns can be specified on the
456
+ command line. Files will be added as-is. If a directory is specified,
457
+ OCRAN will include all files found below that directory. Glob patterns
458
+ (See Dir.glob) can be used to specify a specific set of files, for
459
+ example:
460
+
461
+ ocran script.rb assets/**/*.png
462
+
463
+ ### Command Line Arguments
464
+
465
+ Pass arguments to your script (both during the build run and at runtime)
466
+ after a `--` marker:
467
+
468
+ ocran script.rb -- --some-option=value
469
+
470
+ Extra arguments supplied by the user at runtime are appended after the
471
+ compile-time arguments.
472
+
473
+ ### Load path mangling
474
+
475
+ Adding paths to `$LOAD_PATH` or `$:` at runtime is not recommended. Adding
476
+ relative load paths depends on the working directory being the same as where
477
+ the script is located (see above). If you have additional library files in
478
+ directories below the directory containing your source script, use this idiom:
479
+
480
+ $LOAD_PATH.unshift File.join(File.dirname($0), 'path/to/script')
481
+
482
+ ### Window/Console
483
+
484
+ By default, OCRAN builds console applications from `.rb` files and windowed
485
+ applications (without a console window) from `.rbw` files.
486
+
487
+ Ruby on Windows provides two executables: `ruby.exe` is a console mode
488
+ application and `rubyw.exe` is a windowed application that does not bring up
489
+ a console window when launched from Windows Explorer. By default, or if
490
+ `--console` is used, OCRAN uses the console runtime. OCRAN automatically
491
+ selects the windowed runtime when your script has the `.rbw` extension, or
492
+ when you pass `--windows`.
493
+
494
+ If your application works in console mode but not in windowed mode, first
495
+ check that your script works without OCRAN using `rubyw.exe`. A script that
496
+ prints to standard output (`puts`, `print`, etc.) will eventually raise an
497
+ exception under `rubyw.exe` once the IO buffers fill up.
498
+
499
+ You can also wrap your script in an exception handler that logs errors to a
500
+ file:
501
+
502
+ begin
503
+ # your script here
504
+ rescue Exception => e
505
+ File.open("except.log", "w") do |f|
506
+ f.puts e.inspect
507
+ f.puts e.backtrace
508
+ end
509
+ end
510
+
511
+ ## Credits
512
+
513
+ Lars Christensen and contributors for the OCRA project which this is forked from.
514
+
515
+ Kevin Walzer of codebykevin, Maxim Samsonov for ocra2, John Mair for
516
+ codesigning support.
517
+
518
+ Igor Pavlov for the LZMA compressor and decompressor (Public Domain).
519
+
520
+ Erik Veenstra for rubyscript2exe, which provided inspiration.
521
+
522
+ Dice for the default `.exe` icon (vit-ruby.ico,
523
+ http://ruby.morphball.net/vit-ruby-ico_en.html).
524
+
525
+ ## License
526
+
527
+ (The MIT License)
528
+
529
+ Copyright (c) 2009-2020 Lars Christensen
530
+ Copyright (c) 2020-2025 The OCRAN Committers Team
531
+
532
+ Permission is hereby granted, free of charge, to any person obtaining
533
+ a copy of this software and associated documentation files (the
534
+ 'Software'), to deal in the Software without restriction, including
535
+ without limitation the rights to use, copy, modify, merge, publish,
536
+ distribute, sublicense, and/or sell copies of the Software, and to
537
+ permit persons to whom the Software is furnished to do so, subject to
538
+ the following conditions:
539
+
540
+ The above copyright notice and this permission notice shall be
541
+ included in all copies or substantial portions of the Software.
542
+
543
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
544
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
545
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
546
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
547
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
548
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
549
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.