{% extends "admin/index.html" %} {% load i18n static %} {% block content %}

Welcome!

Use the Winget link on the left to add packages and versions.

To set up your repository on a system, use your unique URL:

{# We check for the existence of a tenant_uuid because superusers #} {# might not have one. If we didn't perform this check, then in that #} {# case the `url tenant_uuid=...` call would fail. #}
winget source add -n {{ request.get_host }} -a https://{{ request.get_host }}{% if not request.user.tenant_set.get.uuid and request.user.is_superuser %}/...{% else %}{% url 'winget:index' tenant_uuid=request.user.tenant_set.get.uuid %}{% endif %} -t "Microsoft.Rest"

This creates a winget source with name {{ request.get_host }}. To install a package from this source, use the following command:

winget install <your package name> -s {{ request.get_host }}

To play with this, you can for example install the open source Alacritty terminal emulator:

  1. Create a package with name Alacritty and identifier {db0555c4-110f-48ca-b25f-98e6ec6fbf15} here. The name and identifier must be exactly as shown here.
  2. Add version 0.8.0 for Alacritty, uploading its official MSI installer. Select x64 as Architecture and msi as Type.
  3. Install your package with winget install alacritty -s {{ request.get_host }}.
  4. To test updates, add another version: 0.9.0. Upload the associated installer.
  5. Upgrade your package via: winget upgrade alacritty -s api.winget.pro. This should download and install the newer version.
  6. Uninstall Alacritty again via winget uninstall alacritty.

To remove the winget source you added at the beginning, you can use:

winget source remove {{ request.get_host }}
{% endblock %} {% block sidebar %}{% endblock %}