Skip to content

Commit

Permalink
Improve install docs, some misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Jan 20, 2025
1 parent e88d868 commit 81e0355
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 25 deletions.
4 changes: 0 additions & 4 deletions src/content/docs/dev/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ moonlight CI builds the `develop` branch automatically. This section is for publ
- We originally didn't have the types version in sync with moonlight, but we're aiming to resync. Bump the patch version until we can eventually re-synchronize them.
- Continue to publish a moonlight release like normal, and wait for CI to finish.
- [Run the types workflow](https://github.com/moonlight-mod/moonlight/actions/workflows/types.yml) to manually trigger a release to npm.
- In [the sample extension](https://github.com/moonlight-mod/sample-extension), update the types package: `pnpm update @moonlight-mod/types`
- Remember to `git pull` and `pnpm i` beforehand so you are up to date.
- Commit and push to the sample extension.
- Update [create-extension](https://github.com/moonlight-mod/create-extension) following [these instructions](#publishing-other-libraries).
- If the manifest type was updated, regenerate the schema: `pnpx ts-json-schema-generator --path './packages/types/src/*.ts' --type ExtensionManifest -f ./tsconfig.json > ../moonlight-mod.github.io/public/manifest.schema.json`

## Publishing other libraries
Expand Down
61 changes: 40 additions & 21 deletions src/content/docs/using/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: How to install, build, and use moonlight
sidebar:
order: 1
---
import { FileTree, LinkButton } from "@astrojs/starlight/components";
import { FileTree, LinkButton, Tabs, TabItem, Aside } from "@astrojs/starlight/components";

There are several ways to install moonlight. It is suggested to use the installer or CLI if you are not a developer.

Expand All @@ -16,31 +16,58 @@ Despite that, we try our best to ensure your account and system is safe. There a

## moonlight installer

<LinkButton href="https://github.com/moonlight-mod/moonlight-installer/releases/latest/download/moonlight-installer.exe" icon="seti:windows">Download</LinkButton>
<LinkButton href="https://github.com/moonlight-mod/moonlight-installer/releases/latest/download/moonlight-installer-macos.dmg" icon="apple">Download</LinkButton>
The moonlight [installer](https://github.com/moonlight-mod/moonlight-installer) automates the installation process for you. To use it, [download](https://github.com/moonlight-mod/moonlight-installer/releases/latest) and run the installer, download moonlight through it, and then patch a Discord installation.

The moonlight [installer](https://github.com/moonlight-mod/moonlight-installer) automates the installation process for you. **This is the suggested way to install moonlight for Windows and macOS users.**
Discord installations are autodetected on your machine. Keep the installer in the event that a Discord update breaks moonlight, so you can unpatch Discord or update moonlight.

<Tabs>
<TabItem label="Windows">
<LinkButton href="https://github.com/moonlight-mod/moonlight-installer/releases/latest/download/moonlight-installer.exe" icon="seti:windows">Download</LinkButton>

Download and run `moonlight-installer.exe`. Close Discord fully before patching.
</TabItem>

<TabItem label="macOS">
<LinkButton href="https://github.com/moonlight-mod/moonlight-installer/releases/latest/download/moonlight-installer-macos.dmg" icon="apple">Download</LinkButton>

Download and run `moonlight-installer-macos.dmg`.
<Aside>
Patching on macOS may cause issues with application signing, and moonlight currently does not persist between updates on macOS. This is planned to be fixed in the near future.
</Aside>
</TabItem>

<TabItem label="Linux">
<LinkButton href="https://flathub.org/apps/io.github.moonlight_mod.moonlight-installer" icon="linux">Download</LinkButton>

Install [Flatpak](https://flatpak.org/), then install the moonlight installer from Flathub.

<Aside>
Only some methods of Discord installations are supported:

- Local installations in `~/.local/share`
- A script to install Discord locally (maintained by a community member) is available [here](https://gist.github.com/maddymeows/6af1a5d5a870c13b7b159c4463edee70).
- moonlight has an auto updater for Linux in the "Native Fixes" extension.
- Discord installed through Flatpak as a user
- System installations are not supported.

Discord installations from system package managers are not supported.
</Aside>
</TabItem>
</Tabs>

To use it, [download](https://github.com/moonlight-mod/moonlight-installer/releases/latest) and run the installer, download moonlight through it, and then patch a Discord installation. Discord installations are autodetected on your machine. Keep the installer in the event that a Discord update breaks moonlight, so you can unpatch Discord or update moonlight.

## moonlight-cli

A [command line installer](https://github.com/moonlight-mod/moonlight-installer/tree/main/crates/moonlight-cli) can be compiled from source manually and used to patch moonlight. **This is the suggested way to install moonlight for Linux users.**
A [command line installer](https://github.com/moonlight-mod/moonlight-installer/tree/main/crates/moonlight-cli) can be compiled from source manually and used to patch moonlight.

```shell
cargo install --git https://github.com/moonlight-mod/moonlight-installer.git moonlight-cli
moonlight-cli install stable
moonlight-cli install stable # or `moonlight-cli install nightly`
moonlight-cli patch /path/to/discord/executable
```

You can specify a custom moonlight `dist` directory with `moonlight-cli patch -m /path/to/moonlight/dist`.

:::note
Discord installations from Linux package managers may not work well with moonlight (due to root permissions or immutability). It is suggested to install Discord locally into a path like `~/.local/share`.

A script to install Discord locally (maintained by a community member) is available [here](https://gist.github.com/maddymeows/6af1a5d5a870c13b7b159c4463edee70). You will need to patch this Discord installation manually after installing it.
:::

## Manual installations

Manual installations are suggested for those who wish to work on moonlight itself.
Expand Down Expand Up @@ -95,14 +122,6 @@ The output extension will be at `dist/browser`. Chrome users can check "Develope

Browser support is experimental and may be unreliable. Developing extensions or using custom repositories is not supported with the browser extension.

## rocketship

Linux users can install a custom Discord build with [rocketship](https://github.com/moonlight-mod/rocketship) and then install moonlight into it. Enable the rocketship extension after installation.

:::caution
rocketship is experimental and may break. If you don't care about the benefits of rocketship, use [moonlight-cli](#moonlight-cli) instead.
:::

## Nix

moonlight offers [a Nix flake](https://github.com/moonlight-mod/moonlight/blob/main/flake.nix) which has an overlay to install moonlight on top of Discord. The flake is not monitored, so if it fails to build, please leave an issue.

0 comments on commit 81e0355

Please sign in to comment.