The Anvil App Server Windows Installer is a simple tool designed to save time and ensure consistency when setting up the Anvil App Server on Windows. If you've struggled with installation and configuration in the past, this installer will streamline the process and get you up and running quickly.
This installer automates the installation of:
- Git (version 2.47)
- Python (version 3.13.1)
- vcredist 2013
- Amazon Corretto (version 21.0.5.11.1)
All components are installed to their default locations, and the following files are placed in C:\AnvilAppServer
(default location, customizable):
nssm.exe
: Tool for registering a Windows service.install.bat
: Script to initialize your Anvil project and set up the Windows service.run.bat
: Script that runs the Anvil App Server in a controlled environment.
- Create a Windows user account called
anvil-user
with non-admin rights. - Download the installer from the releases page.
- Follow the instructions provided by the installer.
- Download your Anvil project (e.g., using
git clone
) insideC:\AnvilAppServer
(or your chosen location). - Run
install.bat
and you're done! 🎉
Here’s a general overview of what happens when the provided scripts are executed:
- Creates a log directory: Ensures logs are stored in
C:\AnvilAppServer\log
for debugging and monitoring purposes. - Checks for an existing service: If the Anvil App Server service (
AnvilAppService
) already exists, it stops and removes the service to avoid conflicts. - Registers a new service: Uses
nssm.exe
to create a Windows service calledAnvilAppService
, configured to run as the non-admin useranvil-user
. - Sets up logging: Configures the service to log all output (both
stdout
andstderr
) to a single log file. - Starts the service: Ensures the service is up and running after setup.
- Sets up a Python environment:
- Checks for an existing virtual environment. If it doesn’t exist, it creates one.
- Activates the virtual environment and upgrades
pip
to the latest version.
- Installs the Anvil App Server: Downloads and installs the
anvil-app-server
Python package into the virtual environment. - Configures SSL certificates: Points the
SSL_CERT_FILE
environment variable to the appropriate certificate file for secure connections. - Starts the Anvil App Server: Launches the server, using a placeholder for the project name that you replace with your actual project.
To build the installer, follow these steps:
-
Clone the Repository:
Use the following command in your terminal or Git Bash:
git clone https://github.com/carlbomsdata/anvil-app-server-installer.git
-
Download Required Executables:
The following files need to be downloaded manually and placed in the directory where you cloned this repository:- Git (version 2.47): Download Git
- Python (version 3.13.1): Download Python
- vcredist 2013: Download vcredist
- Amazon Corretto (version 21.0.5.11.1): Download Corretto
-
Update Paths:
Ensure the paths to these executables are correctly referenced in the installer script files. -
Customize the Installer (optional):
Modify the batch scripts (install.bat
andrun.bat
) or other resources as needed for your specific use case. -
Create the Installer:
Package the scripts and required files into an installer using tools like Inno Setup or other Windows installer frameworks. -
Test:
Test the installer on a clean machine or virtual environment to ensure it works as expected.
- This installer is in early development. It's recommended to test it on a fresh computer or virtual machine to avoid any conflicts with existing installations.
- The scripts are designed to work with the default setup. Adjustments might be needed for custom configurations.
- Feedback and contributions are welcome!
Setting up the Anvil App Server on Windows can be tricky and time-consuming. This installer ensures:
- Consistent installation across projects.
- Quick setup with minimal manual configuration.
- Preconfigured environment for running Anvil App Server as a Windows service.
This project is licensed under the MIT License.