Skip to content

A Windows installer, in the style of RubyInstaller - #38

Merged
Largo merged 5 commits into
masterfrom
feat/windows-installer
Oct 28, 2026
Merged

Largo merged 5 commits into
masterfrom
feat/windows-installer

Conversation

@Largo

@Largo Largo commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Util/installer/ironruby.iss is an Inno Setup 6 script for the win-x64 release archive. Util/installer/build-installer.sh unpacks the zip and compiles ironruby-<version>-win-x64-setup.exe, which installs the archive's tree unchanged.

  • C:\IronRuby40-x64 by default, as RubyInstaller uses C:\Ruby40-x64. igem install writes into the install tree, so the directory must be writable without admin rights, and Bundler's RUBYOPT, the Rails templates and mspec break on a path with a space. You can choose another directory: a path with a space gets a warning, and a directory that already holds other files is refused, because the uninstaller removes Src from it whole.
  • For the current user (the default, no admin) or for all users. It puts the install directory first on that PATH, so ironruby, ir, irb and igem work from a new terminal. IronRuby's irb then comes before CRuby's; ruby and gem stay CRuby's.
  • Running .rb files with IronRuby is optional and off by default. On uninstall, .rb goes back to the program it had before, such as RubyInstaller's RubyFile.
  • The uninstaller removes the files, the gems installed since and the PATH entry. The rest of PATH stays byte for byte as it was.

CI (release.yml, win-x64 package job):

  • Inno Setup 6.7.3 is downloaded from its GitHub release and checked against the asset's SHA-256.
  • The installer is built from the zip the job just made.
  • Util/installer/test-installer.ps1 installs it into C:\IronRuby40-x64, once for the current user and once for all users. Each time it runs ironruby -v, ir, irb and igem install rack + require 'rack' with the PATH a new terminal gets, then uninstalls and checks that no file and no PATH entry is left.
  • The installer gets the same pinned actions/attest step as the archives (dist/ironruby-*-<rid>*.*), is uploaded with the zip and is published by the release job, SHA256SUMS included.

No binaries are committed: check-no-executables.rb passes on the new files. Documented in the README's binary-release section and in Docs/releases/v4.0.3.md.

Tested on Windows 11 with the v4.0.2 zip (checksum and attestation verified), built with Inno Setup 6.7.3:

  • A per-user install into C:\IronRuby40-x64 passed: PATH, ironruby -v, ir, igem install rack, require 'rack', then an uninstall that removed the directory and left PATH unchanged.
  • The .rb association worked, and the uninstall restored RubyFile.

irb on Windows crashed at startup in the 4.0.2 build. It is fixed on master by #39, which this branch has merged: Fiddle finds a Win32 function's A export, and pack("p") is a real address, so reline runs unmodified. The irb check in this PR's installer test (Util/installer/test-installer.ps1) covers it from the installed tree. A real console with typed input (p 6 * 7, exit) was checked by hand on Windows 11.

Util/installer/ironruby.iss is an Inno Setup 6 script for the win-x64 release archive:
Util/installer/build-installer.sh unpacks the zip and compiles
ironruby-<version>-win-x64-setup.exe, which installs the tree unchanged.

- It installs into C:\IronRuby40-x64 by default, as RubyInstaller into C:\Ruby40-x64:
  igem install writes into the install tree, so the directory must be writable without
  admin rights, and Bundler's RUBYOPT, the Rails templates and mspec break on a path with
  a space. Another directory can be chosen; a space gets a warning, a directory that
  already holds other files is refused.
- For the current user (the default, no admin) or for all users. It puts the install
  directory first on that PATH, so ironruby, ir, irb and igem work from a new terminal.
- Running .rb files with IronRuby is an option, off by default, and gives .rb back to the
  program it had before (RubyInstaller's RubyFile) on uninstall.
- The uninstaller removes the files, Src as a whole with the gems installed since, and
  the PATH entry, leaving the rest of PATH as it was.

release.yml builds it in the win-x64 package job with Inno Setup 6.7.3, downloaded from
its GitHub release and checked against the asset's SHA-256, then installs, runs and
uninstalls it with Util/installer/test-installer.ps1, once for the current user and once
for all users: ironruby -v, ir, irb and igem install rack from the PATH a new terminal
gets, and no file or PATH entry left afterwards. It is attested with the same pinned
actions/attest step as the archives and published next to the zip.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 514889b1-bb6f-4197-9cc2-320f8cddcb09
Commits

Reviewing files that changed from the base of the PR and between 79aec55 and 8f98ff3.

Files selected for processing: 6
  • .github/workflows/release.yml
  • Docs/releases/v4.0.3.md
  • README.md
  • Util/installer/build-installer.sh
  • Util/installer/ironruby.iss
  • Util/installer/test-installer.ps1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Largo added 2 commits October 28, 2026 15:42
…es Strings

irb in the 4.0.2 Windows build stopped at once:

    reline/io/windows.rb:112:in 'Handle#sym': unknown symbol "FillConsoleOutputCharacter"

reline binds the console API through Fiddle by the functions' bare names, and kernel32
exports only FillConsoleOutputCharacterA and ...W (ScrollConsoleScreenBuffer likewise).
CRuby's fiddle looks a missing name up again with "A" appended on Windows; Handle#sym and
#sym_defined? now do too. (CRuby also tries 32-bit stdcall decorations, name@N, which x64
does not have.)

Past that, irb in a console crashed with an access violation: reline's Win32API#call
passes each pointer argument as [str].pack("p").unpack("q*"), and IronRuby's pack("p")
writes an index into the packed string's list, not an address, so Windows wrote through
address 1. The vendored reline now hands Fiddle the String itself, which Fiddle passes as
a pointer to its bytes and copies back what C wrote - the buffer CRuby's address names.

irb now reaches its prompt in a Windows console, and runs piped input; the installer test
in release.yml runs irb from the installed tree.
…n packaging

Handle#sym and #sym_defined? on Windows now try a name in the order of fiddle 1.1.8's
fiddle_handle_find_func: as given, with the "A" suffix, then with the stdcall
decorations "@0" to "@252", plain and after the "A". The previous commit tried only the
"A". Linux and macOS are unchanged.

- Fiddle_AnsiSuffix1 (MiscTests): GetModuleHandle is GetModuleHandleA,
  FillConsoleOutputCharacter is found, and an unknown name gives CRuby's message.
- ci.yml's console smoke test and package-release.sh's check of the unpacked tree pipe
  `puts 6 * 7` into irb and want 42, on Windows and on Linux: irb died at a pipe as at a
  console in 4.0.2, so both catch that.

Written in the session that found the bug alongside this one, and taken over here.
Largo added 2 commits October 28, 2026 21:58
…upstream ships it

#39 makes [str].pack("p") a real address, so reline's Win32API works as Ruby ships it.
This branch's change to Src/StdLib/ruby/4.0/reline/io/windows.rb goes back to upstream's
file, as on master. RubyTests.cs and MiscTests.cs are #39's, which hold this branch's
Fiddle_AnsiSuffix1 and #39's PackPointer tests; the release note says how irb was fixed.
@Largo
Largo merged commit 61e99e9 into master Oct 28, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant