# Patches

Ainx makes installing Pterodactyl addons almost as easy as [blueprint](https://blueprint.zip), but for any panel.

### Installing an Addon with Patches

For very (and I mean very) heavily modfied panels, ainx installs may modify files you do not want it to. You can use the `genpatch` command in order to avoid this.

### Step 1:

Move the `.ainx` file to your current directory. If you want to upgrade an addon, also move the old `.ainx` file under a different name.

### Step 2:

Make sure ainx is installed and ready-to-use. Follow the steps in the [installation of ainx](https://rjns.gitbook.io/ainx/getting-started/installation) if you haven't already.

### Step 3:

{% hint style="warning" %}
Please read details on the `includeCompat` flag before running anything.
{% endhint %}

Run the ainx genpatch command, make sure to replace `<addon>` with the full `.ainx` filename.

```bash
ainx genpatch <addon>
```

Following arguments exist, that you should know about:

<table><thead><tr><th width="278">Argument</th><th>Description</th></tr></thead><tbody><tr><td><code>--outfile</code></td><td>The output file location for the patch.</td></tr><tr><td><code>--skipSteps</code></td><td>Skip Ainx Metadata installation steps, only use if you really know what you are doing.</td></tr><tr><td><code>--skipRoutes</code></td><td>Skips the route adding process, useful when using the default pterodactyl <code>panel.tar.gz</code> to avoid conflicts.</td></tr><tr><td><code>--remote</code></td><td>This argument decides the base of the ainx patch, by default it downloads the latest <code>panel.tar.gz</code> and uses it as the patch base, you can enter any network address that resolves to a zip/tar or a local directory.</td></tr><tr><td><code>--old</code></td><td>The old Ainx file to update from, if provided will install the old <code>.ainx</code> file first, then the new one above it and you get a patch for the changes between both addon versions.</td></tr><tr><td><code>--includeCompat</code></td><td><strong>VERY IMPORTANT! READ:</strong> This argument makes sure that the patch includes ainx <strong>required</strong> compatibility changes. If you haven't installed any ainx 1.9.0+ addon on your panel, you will need to have atleast 1 addon use this option to include ainx changes.</td></tr></tbody></table>

### Step 4:

The addon patch should now be found (by default) at `<addon>.patch`. To install it you would usually use the following but it all depends on your goal:

```sh
patch -Np1 -i <addon>.patch
```
