New online installer/launcher

Hi, I’m running macOS 15.5 on an Apple Silicon machine. I tried this new installer pre-release version. My thoughts:

1: Installation takes quite some time compared to before. I understand why, but I don’t think this will be appreciated by somebody new to Anki that is used to other software.

2: For me it first opened a terminal and spit out all kinds of information. Fine for me, but again if any other non-technical person from my family/friends would go through this installation process they would be highly sceptical of the software they’re about to use. (For no good reason of course, but that doesn’t change the outcome sadly.)

3: After installation was complete, the Terminal window didn’t close but stayed open. Non-technical users may not know how to close it properly or that they should/can.

4: After installation was complete, Anki was automatically launched. However in the Dock and in the menu bar it does not have an icon and is not named “Anki” but “python”. That looks unfinished.

The application itself seems to work just the same. I only did some of my reviews, but my cards were displayed correctly etc. everything was good.

I hope this post doesn’t come across as too negative, that’s not the intention. Just the things that I thought that if they can be improved, should be improved upon going forward. I know this is an early test :slight_smile:

Also if there in the future is the possibility for an auto-updater that would be great I think. Personally I have no issues doing updates, but I know other people who use very old Anki versions because they are just used to everything auto-updating with zero intervention needed.

Maybe somehow instead of showing the Terminal window there could be a simple GUI with a progress bar? For example if you can take a look at the 1Password installer for macOS the concept is similar: You start the installer .app file and it will show a little window with a progress bar during download and installation with no additional intervention from the user needed, but there’s no Terminal window or any text output (which yes having the text is probably great for debugging if there are any errors during installation, but I don’t think appreciated by most unfortunately).

Edit:
Because people are sharing what they see there in this thread, I see this now as version info. Not sure why they don’t all match?
Version ⁨25.06 (70c6bdf9)⁩
Python 3.9.23 Qt 6.8.1 PyQt 6.8.0

6 Likes

As the Anki package maintainer for Alpine Linux, I would like to still have a normal offline installer.

An online installer assumes that the user will be online on their first launch and they will be aware of the requirement to be online when they first launch the app.
It also assumes that there will be no problems downloading, the network speed will be reasonably fast and the official download site won’t go down.

The current model with an offline installer is incredibly resilient.
Linux/BSD have mirrors: a decentralised way to ensure that the package will always be available.
For all operating systems, if your internet is slow or non-existent, you can install the package from a USB or similar and then use it completely offline if required.

10 Likes

I think we could approach it differently: The installer package itself could include both Anki’s required dependencies and the launcher. Anki would still be launched through the launcher, which would also handle automatic updates.

The advantage of this approach is that it enables normal installation and usage offline. The only downside is that a new version of the installer package would need to be rebuilt each time Anki is updated. However, the benefits clearly outweigh this drawback (at least for my use case).

1 Like

I really hate that experience when an app starts to download itself after installation. Internet is not always fast and free (e.g. when living abroad).
Hope, Anki will not be one of those.

Anki definitely needs a modern installer having an ability to install updates automatically without manual unpacking ZIP each time.
Offline installer should be an option along with the online one.

4 Likes

New installers

The link at the top has been updated with new installer versions to try. Some of the previously-mentioned points have not been addressed yet, and I’ll follow up with some replies shortly.

Once we get past the initial testing process, updates won’t require you to fetch an updated installer each time - they can be reused over multiple Anki releases. When you run them, they’ll fetch whatever the latest Anki release is, and install that. Users who wish to install a specific version will be able to make a quick edit to a config file to select that version instead. After an initial install, running the installer again will trigger an update if one is available.

Prereleases

You can ignore this section, as I’ve updated the installers to opt in to prereleases for now.

Summary

The launcher will exclude betas/RCs by default. As there are no stable releases with this setup yet, you’ll need to run the following command to opt-in to prereleases, or you’ll get an error when starting Anki.

If you didn’t try the installer earlier, please run it once first. Then:

Windows: run ‘cmd.exe’, then paste in the following and press enter:
echo > %LOCALAPPDATA%\AnkiProgramFiles\prerelease

Mac: open Terminal.app, then paste the following and press enter:
touch ~/Library/Application\ Support/AnkiProgramFiles/prerelease

Linux: in a terminal:
touch ~/.local/share/AnkiProgramFiles/prerelease

Then run the installer/launcher again.

Once we get past the initial testing, you can remove that file again if you want to stick to stable releases.

25.06beta4

As part of this, I’ve made a new beta release, so you should see the same version number and build hash on all platforms this time around. The previous test was built over a number of days, so there was skew between the platforms.

Automatic updates

This build introduces support for automatic updates. When Anki’s ‘update available’ pop-up appears, answering yes to “download it now?” will trigger an automatic upgrade on the next launch. We can’t easily test this during beta testing, but I’ll provide steps to manually trigger it when the next beta is available (likely tomorrow), so you can see how much faster/convenient it is.

Installer tweaks

The Windows installer automatically launches Anki at the end of installing, so the remaining download starts immediately.

4 Likes

Noisy first run

Quite a few people have voiced concerns about the terminal output being too technical/daunting for the average user. The Mac and Linux launchers already attempt to lessen this a bit by adding some leading/trailing text:

One potential change we could make is to to lead with a brief explanation, and require the user to confirm first. E.g: “Anki needs to download its program files. Press the enter key to continue.”. It makes install/updates a bit more cumbersome for experienced users, but would avoid a wall of text all of a sudden.

We can’t easily replace the output with a GUI progress bar, as the underlying tool we’re using for this does not support that. We could hide all output and show an indeterminate spinner, but that offers no insight into how much progress is being made, and how much is being downloaded.

On subsequent updates, fewer packages are likely to change, so it will be less of a wall of text.

Offline installers

Internet is only required for the first run, or after explicitly agreeing to update. Once installed, you can copy the AnkiProgramFiles folder onto a flash drive or across to other computers as you please (preserving modification times), and the launcher will use them instead of downloading the files again. Or you can skip the launcher and open Anki directly from that folder.

Third-party packages

Linux distros take multiple approaches to packaging Anki, with the most common being:

  1. building everything themselves (uses system Qt)
  2. using the aqt/anki wheels we distribute on PyPI with their system’s Qt/other Python packages
  3. a thin wrapper over our old PyOxidizer bundles (uses PyPi Qt)

Linux distros are predominately using approach #1 or #2. Package tools like homebrew and winget tend to use #3.

The first and second approach can continue to function like before, though distros that use #1 may need to make some minor tweaks to deal with the new uv.lock file and changes to the build.

#3 will no longer work, since we’re no longer providing those bundles. But since that approach did not use the system libraries, the only real advantage over downloading Anki’s packages directly was that you got access to automatic updates. And as this new approach has built-in support for that, I don’t think this will be a big deal in practice.

Unlike Windows and macOS, the Linux/BSD desktop environment is fairly heterogenous, and that makes it difficult for binary packages to fully integrate with each system, leading to theming issues, broken keyboard input methods, etc. From an “integrates well into the desktop” perspective, using the system’s Qt is a better approach if the distro has relatively up-to-date Qt libraries.

It might be possible to in the future to give the launcher an option to use the system Python/Qt. Uv doesn’t have support for something akin to --system-site-packages, but it may be technically possible with sys path hacks.

Other feedback

I’ve logged some of the reported issues on Assorted minor issues with new launcher · Issue #4107 · ankitects/anki · GitHub

Replying to some of the above posts:

I can’t reproduce this - perhaps related to an add-on you have installed?

Does it persist with the latest update?

That doesn’t surprise me - our old packaging process stripped out some Python modules Anki itself wasn’t using, and some documentation/support files. The flip side of this is that sometimes add-on authors couldn’t use an add-on module that would normally be available.

If the cache were removed, uv would need to download everything again each time Anki got an update, even a tiny one. I think it makes sense to keep on by default, but users could remove it themselves if they wished (run ‘uv cache clean’).

This was a recent regression in the development code, and unrelated to the installer. Thank you for the report!

That doesn’t happen for me - does it still occur for you if you remove the AnkiProgramData folder and try again?

4 Likes

I can’t reproduce this today with the latest update. Not sure what fixed it, but doesn’t matter.

I think it still makes sense to strip out the documentation/support files. I don’t know about installation via uv but Python installation via a setup file allows stripping out unnecessary components.

Also, as a good news, the size of %LOCALAPPDATA%\AnkiProgramFiles has reduced from 611 MB in the previous build to 575 MB in today’s build.

But, if the same version of the package is already installed in the installation directory, does uv still need to download the package? (if yes, this feels more like a uv issue than an Anki issue, though)

Edit:
I did some testing. I ran uv cache clean and then reran the installer. In this case, the installation took less than 2 seconds while the initial installation took more than 2 minutes (iirc). So, uv didn’t redownload the packages, at least for installing the same Anki version. The %LOCALAPPDATA%\uv directory built up a cache of about 12 MB during this second installation.

Also, is there any specific reason for using a new installation folder? Can’t Anki be installed in a subfolder of the old installation location (%LOCALAPPDATA%\Programs\Anki)?

1 Like

Regarding the new Anki installer, I conducted installation and uninstallation tests and would like to share the following observations:

  1. Reinstallation Speed: The initial installation of the new Anki launcher took some time as it set up the environment (e.g., venv ). However, reinstalling Anki was significantly faster, as it skipped this environment setup. This suggests that some components or environment configurations were not completely removed during uninstallation. The question is whether this is the expected behavior or if the uninstallation should perform a more thorough “cleanup.” This observation aims to contribute to the improvement of the new installer.

  2. Post-Installation Behavior: Anki opened automatically after installation, without a “completion” message or the option to open the program later. I suggest considering the inclusion of an installation completion notification, allowing the user to decide when to launch Anki.

Overall, the experience was very good, and the new installer seems promising. Congratulations on the work!

1 Like

It’s uv caching as noted here:

1 Like

At the moment, it’s definitely a downgrade in user experience, but currently necessary due to nobody doing the work until all of those CVEs piled up.

I do wish that you include in your list (or in other GH issues) some other real problems people stated here, even if you don’t want to fix them yourself, like the installation size increment and the terminal showing up.

Also, this also has the same issue of the PyOxidizer installer of not checking if Anki is open before running the installer.

2 Likes

No idea if this is practical, but maybe something like Tauri can be used to show a simple GUI?

2 Likes

Ok I ran: rm -rf "~/Library/Application Support/AnkiProgramFiles" Then I downloaded the new launcher released a few hours ago and replaced my old Anki.app folder and started Anki. The Terminal opened again and it went through some installation steps. Everything happens relatively quickly until it gets to This may take a few minutes. Please wait... and then it takes a while.

Ultimately Anki starts but yes the Terminal window stays open in my case. Not sure why. Have I maybe changed some settings? If it doesn’t happen for anybody else I guess it’s not an issue :slight_smile: Looks like this:

1 Like

Just my two cents since some people here wish to auto-close the terminal:

The terminal contains all the logs of the installation. Closing it automatically would also remove the chance to look at the logs again after it finishes (especially relevant with fast internet and hardware).

I think the terminal should stay open. And if a GUI is implemented, the GUI should show the logs as well and only close if specifically instructed by the user (e.g. with a button). Such popup windows already exist, e.g. synaptic (a linux GUI package manager) does that.

1 Like

With the new installer, how can I easily switch to a different version?

For testing purposes, currently I sometimes download a specific version’s installer, unzip it with 7zip to a new directory, and use that as a portable installation in parallel to my main one. Just a few clicks and I know whether something broke with an Anki update or it’s something else.

What would be the closest workflow with the new installer?

2 Likes

I don’t think uv supports that, and don’t see this as a particularly high priority personally, but someone else is welcome to look into it if they wish.

That is good news. If a user wishes to switch between two versions, any packages that get removed/re-added would still need to be redownloaded, but that’s admittedly not the common case. A cleanup after install could potentially be added as an option.

I think it does make sense to put the cache folder inside AnkiProgramFiles, so it can easily be removed at the same time as the rest of the program.

The AnkiProgramFiles location is hard-coded, but the user can install the app elsewhere on Windows, including a location that the current user may not be able to write to.

It’s a list of low-hanging fruit I plan to tackle promptly (as the name of the ticket implies!). The other issues are still being discussed, and the terminal one at least will likely get its own issue in the future.

Are you talking about anki-install.exe, or the launcher you invoke afterwards? The former should already be checking.

Yep, or something else lightweight like egui (which I have no experience with either). The terminal approach was the simplest and faster way to implement this, and there is certainly room for more elaborate approaches in the future.

My apologies, I think it’s more likely that I changed some of mine.

Will provide instructions later tonight or tomorrow once a new beta is out.

2 Likes

A new beta has been released:

Auto-update

If you start Anki, you’ll notice nothing has changed, because update checks do not happen on every run.

To simulate what happens after agreeing to an update pop-up, open the debug console and run the following:

from aqt.update import update_and_restart as u; u()

Or you can remove the pyproject.toml file mentioned below.

Switching between versions

The standard pyproject.toml that you’ll find in your AnkiProgramFiles folder (see top post) looks like this:

[project]
name = "anki-launcher"
version = "0.1.0"
description = "UV-based launcher for Anki."
requires-python = ">=3.9"
dependencies = [
  "anki-release",
]

To get a specific version, edit the anki-release line, then restart Anki:

[project]
name = "anki-launcher"
version = "0.1.0"
description = "UV-based launcher for Anki."
requires-python = ">=3.9"
dependencies = [
  "anki-release==25.02b4",
]

To go back to a version prior to these packaging changes:

[project]
name = "anki-launcher"
version = "0.1.0"
description = "UV-based launcher for Anki."
requires-python = ">=3.9"
dependencies = [
  "aqt[qt6]==24.11",
]

To select Qt 6.6 with the current beta:

[project]
name = "anki-launcher"
version = "0.1.0"
description = "UV-based launcher for Anki."
requires-python = ">=3.9"
dependencies = [
  "aqt[qt66,audio]==25.06b5",
]

qt67 and qt69 is also available.

If you want multiple installs in parallel, you can select a version, then copy the AnkiProgramFiles folder elsewhere. Anki can be launched from scripts\anki (windows) or bin/anki.

3 Likes

I did this and the update experience does seem to be a lot better than the old PyOxidizer based installers.

But, instead of this console command, it would be great to have a Check for updates button to force updates when the auto-update check wasn’t triggered.

I don’t think this is the correct explanation as I later found out that uv installs Python in another location (%APPDATA%\uv), which is not included in the total size I mentioned above. So, the increment of installed size is even greater than I thought previously.

For today’s update, it downloaded only 3 new packages (likely those that were updated since yesterday) even though I ran uv cache clean yesterday. So, automatically cleaning the cache seems to be a very reasonable thing to do.

Not a high priority thing, but hardcoded by whom? If it is hardcoded on Anki’s side and there’s no specific reason for choosing a new folder, installing these files in the same folder as the current stable version makes more sense.

1 Like

@dae Let me check if I understood this correctly. From version B6 onwards, does Anki now update itself automatically whenever I open it, without needing to manually download the installer anymore? Is that correct?

1 Like

With the new installer package, I cannot launch Anki anymore:

Preparing to start Anki…

Using CPython 3.13.5
Creating virtual environment at: .venv
Resolved 64 packages in 12.90s
error: Distribution anki==25.6b5 @ registry+https://pypi.org/simple can’t be installed because it doesn’t have a source distribution or wheel for the current platform

hint: You’re on Linux (manylinux_2_35_x86_64), but anki (v25.6b5) only has wheels for the following platforms: manylinux_2_36_aarch64, manylinux_2_36_x86_64, macosx_12_0_arm64, macosx_12_0_x86_64, win_amd64; consider adding your platform to tool.uv.required-environments to ensure uv resolves to a version with compatible wheels
Error: Failed with code Some(2): /home/tim/Downloads/anki-launcher/uv.amd64 sync --upgrade --managed-python
Press enter to close…

I fear that won’t make installing easier. Some big distributions like Opensuse, Fedora, Ubuntu either still deliver Anki 2.1.15 or have dropped it completely. Will Flathub be able to still deliver up-to-date Anki packages?

4 Likes