Files
winget.pro/templates/admin/index.html
2023-01-23 17:43:08 +01:00

82 lines
3.6 KiB
HTML

{% extends "admin/index.html" %}
{% load i18n static %}
{% block content %}
<div id="content-main">
<h1>Welcome!</h1>
<p>
Use the
<a href="{% url 'admin:winget_package_changelist' %}">Winget</a>
link on the left to add packages and versions.
</p>
<ul>
<li>
A <em>package</em> is an application, such as Visual Studio
Code.
</li>
<li>
A <em>version</em> is a specific release of a package, such as
1.2.3.4.
</li>
<li>
Every version has at least one <em>installer</em>. These are
often .exes that install the version on a user's system.
</li>
</ul>
<p>
To set up your repository on a system, use your unique URL:
</p>
{# 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. #}
<pre>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"</pre>
<p>
This creates a winget source with name
<code>{{ request.get_host }}</code>.
To install a package from this source, use the following command:
</p>
<pre>winget install &lt;your package name&gt; -s {{ request.get_host }}</pre>
<p>
To play with this, you can for example install the open source
<a href="https://github.com/alacritty/alacritty">Alacritty</a>
terminal emulator:
</p>
<ol>
<li>
Create a package with name <em>Alacritty</em> and identifier <em>{db0555c4-110f-48ca-b25f-98e6ec6fbf15}</em>
<a href="{% url 'admin:winget_package_add' %}">here</a>. The name and identifier must be exactly as shown here.
</li>
<li>
<a href="{% url 'admin:winget_installer_add' %}">Add version</a>
0.8.0 for Alacritty, uploading its
<a href="https://github.com/alacritty/alacritty/releases/download/v0.8.0/Alacritty-v0.8.0-installer.msi">
official MSI installer</a>. Select <em>x64</em> as Architecture and <em>msi</em> as Type.
</li>
<li>
Install your package with
<code>winget install alacritty -s {{ request.get_host }}</code>.
</li>
<li>
To test updates,
<a href="{% url 'admin:winget_installer_add' %}">add another
version</a>: 0.9.0. Upload the associated
<a href="https://github.com/alacritty/alacritty/releases/download/v0.9.0/Alacritty-v0.9.0-installer.msi">
installer</a>.
</li>
<li>
Upgrade your package via: <code>winget upgrade alacritty -s api.winget.pro</code>.
This should download and install the newer version.
</li>
<li>
Uninstall Alacritty again via
<code>winget uninstall alacritty</code>.
</li>
</ol>
<p>
To remove the winget source you added at the beginning, you can use:
</p>
<pre>winget source remove {{ request.get_host }}</pre>
</div>
{% endblock %}
{% block sidebar %}{% endblock %}