This document provides instructions for using scripts to download and extract Foundry VTT modules using their manifest URLs. There are two versions:
- A bash script (
install.sh) for Linux and macOS users. - A PowerShell script (
install.ps1) for Windows users.
Choose the script appropriate for your operating system and environment.
These scripts automate the following process for each provided manifest URL:
- Fetch Initial Manifest: Downloads the
module.jsonfile from the given URL. - Extract Information: Reads this manifest to find:
- The direct URL of the module's ZIP package (usually from a
downloadfield). - The module's unique
idorname(used for naming the download directory).
- The direct URL of the module's ZIP package (usually from a
- Download Module Package: Downloads the actual module ZIP file.
- Create Directory: Creates a local directory named after the module's
idornamein the current working directory. - Unzip Package: Extracts the module's contents into this new directory.
- Cleanup: Deletes temporary downloaded files (the initial manifest and the ZIP package after successful extraction).
(For Linux and macOS)
Before running install.sh, ensure you have the following command-line tools
installed:
bash: The shell interpreter (standard on Linux and macOS).wget: For downloading files from URLs.jq: A command-line JSON processor, used to read the manifest files.unzip: For extracting ZIP archives.
Typical Installation Commands:
- Debian/Ubuntu:
sudo apt update && sudo apt install wget jq unzip - Fedora/RHEL:
sudo dnf install wget jq unzip - macOS (using Homebrew):
brew install wget jq unzip
-
Save the Script: Ensure the code for your bash script is saved as
install.shin your modules directory. -
Make it Executable: Open your terminal, navigate to the modules directory, and run:
chmod +x install.sh
Execute the script from your terminal. You can provide manifest URLs in two ways:
-
Directly as Command-Line Arguments:
./install.sh "URL1" "URL2" ...
-
From a
links.txtFile (using the-fflag):./install.sh -f
This tells the script to read URLs from a file named
links.txtlocated in the same directory where the script is run.
If using the -f option, create links.txt in the same directory as
install.sh:
- Each manifest URL should be on a new line.
- Empty lines are ignored.
(For Windows)
Before running install.ps1, ensure you meet the following requirements:
-
PowerShell Version: PowerShell 5.1 or later is recommended. This is typically pre-installed on Windows 10 and later.
- You can check your PowerShell version by opening PowerShell and running:
$PSVersionTable.PSVersion
- You can check your PowerShell version by opening PowerShell and running:
-
Execution Policy: You might need to adjust PowerShell's execution policy to allow scripts to run. If you encounter an error, you can try running the following command in PowerShell (as Administrator):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Or, for a less persistent change (for the current session only):
Set-ExecutionPolicy RemoteSigned -Scope Process
Always be cautious when changing execution policies.
-
Internet Access: Required to download manifest files and module packages.
- Save the Script: Ensure the
install.ps1script is saved in your desired modules directory. links.txt(Optional): If you plan to use the-Fileoption, create a file namedlinks.txtin the same directory asinstall.ps1. Each manifest URL should be on a new line.
- Open PowerShell:
- You can right-click in the folder containing the script and select "Open PowerShell window here" or "Open in Windows Terminal".
- Alternatively, open PowerShell manually and navigate to the script's
directory using the
cdcommand.
- Execute the script:
-
Directly providing URLs:
.\install.ps1 "URL1" "URL2" ...
(Note: If
.is not in your PATH, you might need to use the full path to the script if you are not in its directory, e.g.,C:\path\to\scripts\install.ps1 "URL1") -
From a
links.txtfile (using the-Fileswitch):.\install.ps1 -File
-
If using the -File option:
- Create
links.txtin the same directory asinstall.ps1. - Each manifest URL should be on a new line.
- Lines starting with
#(comments) and empty lines are ignored.