This page aims to capture the requirements of a new Windows Installer.
Goal
Improve the Windows install flow by combining I2P and Java into a single package, which can be signed and re-distributed.
Proposed Solution
- jpackage + AdoptOpenJDK 16 JRE
- Non-modular JRE. Modular is too hard, and doesn't anticipate the classes that plugins may require
- base dir is inside of %PROGRAMFILES%\I2P, same as existing installs
- config dir same as existing installs, usually %LOCALAPPDATA%\I2P
- Installer should reduce number of steps required to install and use I2P successfully
- One-step update should be possible in any case.
- Size estimate: 60-65 MB (vs. 14 MB for current i2pupdate.su3)
Target Platforms
- Windows 10, will probably work on earlier(unsupported) versions though
- x86_64, x86
Justification
- The current installation process on Windows requires 25 clicks across 4 installers, not including navigating to download the installers themselves.
- If a JRE is not available, the installer will fail with a message like "javaw.exe not found," leaving the user with no useful feedback.
- The current "step-by-step" install guide uses the same Oracle recommendation as the Mac one. If that site disappears in 2021 then a new JRE would need to become the recommendation.
- The JRE is installed system-wide and requires separate set of actions to uninstall.
- The current installer creates 3 shortcuts, "Start I2P" "Start I2P
(Restartable)," and "I2P Router Console" which has been reported as
"confusing." Adding the "Profile Bundle" on top of that brings us to 5
shortcuts. Not only that, clicking "Start I2P" or "Start I2P (Restartable)"
while I2P isn't running will launch the I2P router in either
routerconsole.browser
or in Internet Explorer. We're now up to 2 minimum, 4 recommended installers, one browser people use on purpose and one which people use to download a better browser. Each deploying configuration, creating shortcuts, start menu entries, starting and stopping programs. - Performance benefits of JRE 16 vs. 8 or 11?
- in 13 the garbage collector was updated to release memory back to the OS, so memory usage as reported by the OS should be generally lower.
- Hide "Java" from the user completely. To what extent is Java maligned today?
- anecdotally the first comment on our Reddit survey was whether we can avoid Java.
- This is at this point an FAQ, and one which has/had an equivalent in i2pd world which is "how do I statically compile i2pd." People are doing bundles like this now because disk space is a relatively cheap price to pay for convenience.
- People still have an irrational fear of Java, and they consider Java to be "Nagware" with a somewhat notorious update mechanism.
Why not IzPack
- Doesn't solve the problem
Why bundled JRE is better
- It does not require a JRE to be installed by user action.
- It does not change any system settings, making it easy and clean to uninstall
- Puts us in control of updating the JRE when there are vulnerabilities. Yes that increases burden on us but assuming we do so promptly increases the security of our users
- Puts us in control of the Java version the users will be using. While we currently do not have plans to use any features not present in Java 8, with a bundled JRE we can ensure that should we decide to use Java 16 features we can safely do so.
Changes to Profile Bundle Install
- Instead of "Failing" on the absence of an IzPacked I2P router unpack a jpackaged router instead
- Instead of "Failing" on the absence of Firefox offer to download, verify, and run the Firefox installer from the NSIS script. This avoids violating Mozilla's trademark rules without interrupting the install.
Tradeoffs
- We may not be able to use the existing "Install as a service" configuration available in the IzPack installer.
- TODO? There's no reason to think that the update process would change from the user's point of view. Possibly a UAC prompt before the installer runs in silent mode?
User demand for native installer
- Getting Java installed is one of the most frequent "Sticking Points" of the I2P installation on Windows, in the same way that getting a browser properly configured was.
Non-goals
- Installation over an existing JRE+IzPacked Installer I2P Install.
Status
- The EXPERIMENTAL-jpackage branch of the i2p.firefox repository contains an example jpackage installer combined with the browser profile. On a Windows 10 PC with Firefox or Tor Browser installed, the jpackaged router will be unpacked along with browser configuration and a launcher script.
- If an IzPacked install is detected, it is left untouched and the installer behaves as a normal i2p.firefox installer.
- If a previous jpackaged router is detected, the jpackaged router from inside the installer is unpacked over the one in %PROGRAMFILES%\I2P
Resource estimates
Development
- Package scripts: done, but as a component of an experimental profile bundle. It will need to be extracted to act as a standalone I2P router. It's actually just an NSIS function so this is straightforward.
- Router update subsystem: should probably simply download and exec the NSIS
installer with
\s
to run silently. - Testing: testing of the bundle (w/o updates) is underway and so far successful.
Maintenance
No ongoing maintenance effort is anticipated, once initial development and testing are complete. This could change if jpackage breaks something. It's pretty unlikely that Windows will do something that prevents us from installing or running things into or running things from %PROGRAMFILES%. For releases, see below.
Releases
- 8 per year (4 I2P + 4 JRE)
- Are additional fast releases due to JRE vulnerabilities anticipated?
What does upstream JRE do? What monitoring do we need to do to track upstream
and react as necessary?
- yes but that should be a matter of joining a mailing list or following an rss feed. If we're doing this for both Windows and OSX, we'll also have some redundancy in terms of eyes on the updates.
- Time required per release?
- See README.md in EXPERIMENTAL-jpackage branch. It's possible to do from end-to-end in Cygwin on Windows 10, requiring approximately 30 minutes. With a pre-packaged I2P app-image built on a Windows 10 machine, it can be built in about 5 minutes on any platform.
- JRE selection criteria: GA only? LTS only? Stay on 16 or go straight to 17
later this year?
- Same a Mac, switch to 17 LTS and go to EOL.
Licensing
- AdoptOpenJRE is GPLv2 + classpath exception, should be fine
- License of build scripts - MIT
Rollout plan
- Experimental Releases: An experimental pre-release has been positively recieved on Reddit. It is non-updatable. If this project is not successful, users will need instructions to uninstall and reinstall I2P.
- Beta Releases: Add as a "Beta All-in-One Variant" build of /en/firefox, for X releases.
- Remove beta, promote to top of "Windows" section on /en/download
- Once the update mechanism is done
- Leave izpack on d/l page for Install as Service maybe?
Interaction with existing installs
If a user already has a router installed by IzPack using a JRE, then the NSIS installer which unpackes the jpackaged router will not be installed at all. Installing a jpackaged router requires uninstalling the IzPacked router by the standard means. It does not require uninstalling the JRE.
Remaining issues
Update functionality
For discussion of update channels see http://git.idk.i2p/i2p-hackers/i2p.i2p/-/wikis/Update-Channels
Proposed implementation:
- Exec installer on exit, restart on completing installer.
- It is trivial to run an NSIS installer silently.
Proposed update workflow for admins:
- Credentials and build platform required - who can do it, do we have backup
- A Windows Machine and a certificate signed by Microsoft, currently only zlatinb has this.
- Workflow:
- Build an I2P App Image on a Windows machine as in the README.md file in EXPERIMENTAL-jpackage.
- Wrap the .exe inside an .su3? Is that necessary? I don't know either.
- Set up a torrent same way as currently
- Update news.xml with torrent details
- Flip the switch
Proposed update workflow for users:
- If the user has configured the router to "download and verify" updates, an update is automatically downloaded. Otherwise they are prompted to download the update.
- When the update is downloaded, an "Update" button appears on the router console. Upon clicking that, the router enters a shutdown sequence.
- Last thing before the JVM exits, exec the newly downloaded and unpacked NSIS installer in silent mode.
- Last thing before the NSIS installer completes, `start \D "%LOCALAPPDATA%\I2P" 'i2p' "%PROGRAMFILES%\I2P\I2P.exe"