CREATE UNITY PACKAGE INSTALLERS –
EXPERIMENTAL

What's this?

This simple API creates a .unitypackage that will install a Unity Package Manager package into your Unity project.
It will add the required scopes, automatically fetch the latest available version on installation, and remove itself after installation.
You can simply drop such a .unitypackage into Unity and click "import".
This reduces the friction of using custom registries considerably.

If this sounds kinda complicated, well, yes. The only reason this is required is because Unity is treating packages with a love/hate relationship currently; all of this could be much, much easier. See What Unity Could Do, especially if you're a Unity person.

Please report any issues on GitHub

Basic API

http://package-installer.glitch.me/v1/installer/RegistryName/com.mycompany.mypackage?registry=https://packages.myregistry.com

Minimal example – latest version, automatic scope

If you omit the version, the latest available will be used. If you omit the scope, the package name and dependencies will be used as scopes automatically.

Download Installer for Addressable Importer
Link to package on registry

http://package-installer.glitch.me/v1/installer/ api base
  OpenUPM/ registry name
    com.littlebigfun.addressable-importer package name
      ?registry=https://package.openupm.com registry url
      

Install a single package

Depending on how you set the scope, other packages from your registry will be visible and installable through PackMan.

Download Installer for Needle Compilation Visualizer
Link to package on registry

http://package-installer.glitch.me/v1/installer/ api base
  Needle/ registry name
    com.needle.compilation-visualizer package name
      @1.0.0 version to install
        ?registry=https://packages.needle.tools registry url
          &scope=com.needle scope
      

Install package & dependencies for registries with many scopes (e.g. OpenUPM)

If you don't specify the scope, the first level of dependencies will be automatically included. This helps to support e.g. packages on OpenUPM with dependencies between them. This package for example has a dependency on another OpenUPM package that will be automatically installed alongside.

Download Installer for ElZach LevelEditor
Link to package on registry

http://package-installer.glitch.me/v1/installer/ api base
  OpenUPM/ registry name
    elzach.leveleditor package name
      ?registry=https://package.openupm.com registry url
      

What Unity could do to make this easier

TODO // Unsupported

Tests

Made by 🌵 Needle

@needle-tools   @hybridherbst   @marcel_wiessler