These docs have been generated using AI. Expect inaccuracies until we remove this banner.

Troy Installer

Troy Installer is a tiny plugin (~9KB) that installs Troy Client and any other plugins you specify. It's what powers Troy Packages.

Note:

You probably don't need this directly. If you create a Package on your Troy Server, it generates an Installer automatically. This page is for advanced customization.

Why Use an Installer?

When a user downloads your plugin directly (ZIP file), they might not have Troy Client. Without it, they'll never receive updates.

An Installer solves this:

  1. User downloads your Installer (tiny, ~9KB)
  2. User uploads and activates it
  3. Installer downloads Troy Client and your plugin(s)
  4. Downloads happen on the user's server—fast, even on slow WiFi
  5. Everything gets activated
  6. Installer optionally deletes itself

The user gets your 2MB plugin, but only had to download 9KB initially. Their server does the heavy lifting.

Getting Troy Installer

Download from the Troy repository:

https://repo.deploytroy.org/plugin/get/zip/troy-installer/

Or grab it from GitHub:

→ troy-installer.php

Customizing

Edit troy-installer.php before distributing. The configuration is at the top of the file:

  • PLUGIN_NAME — What users see during installation
  • OPTIONS — Timeout, auto-deactivate, auto-delete, verbosity
  • INSTALL — Array of plugins to install (in addition to Troy Client)

See the inline comments in the file for details.

Installer vs Embed vs Package

MethodSizeUser seesInstalls multiple plugins
Package~9KBProgressYes
Troy Installer~9KBProgressYes
Troy Embed~2KBNothingTroy Client only

Packages are just pre-configured Installers. If you need custom behavior, edit Troy Installer directly.

Source

→ View on GitHub