Menu
Amazon GameLift
Developer Guide (Version )

Package Build Files

Before uploading your Amazon GameLift-enabled game server to the Amazon GameLift service for hosting, you need to package all game server files into a build directory. This directory must include all components required to run your game servers, including the following:

  • Game server binaries – The binary files required to run the game server. A build can include binaries for multiple game servers, as long as they are built to run on the same platform (see supported platforms).

  • Dependencies – Any dependent files required by your game server executables to run. Examples include assets, configuration files, and dependent libraries.

  • Install script – Script file to handle tasks that are required to fully install your game build onto Amazon GameLift hosting servers. This file must be placed at the root of the build directory. An install script is run once as part of fleet creation.

Once you've packaged your build files, make sure your game server can run on a clean installation of your target operating system (not one that's been used for development). This step helps ensure that you include all required dependencies in your package and that your install script is accurate.

To observe the build packaging process in action, see the Amazon GameDev tutorials for Amazon GameLift.

Note

If you're storing your game build files in an Amazon S3 bucket for uploading, place all build files into a .zip file.

Creating an Install Script

Create an install script the for the operating system of your game build:

  • Windows: create a batch file named "install.bat".

  • Linux: create a shell script file named "install.sh".

When creating an install script, keep in mind the following:

  • The script cannot take any user input.

  • A build is installed on a hosting server in the following locations. File directories in your build package are recreated.

    • For Windows fleets: C:\game

    • For Linux fleets: /local/game

  • During the installation process, the run-as user has limited access. It has full rights to the directory where your build files are installed. If your install script takes actions that require administrator permissions, you'll need to specify admin access (sudo for Linux, runas for Windows). Permissions failures related to the install script generate an event message indicating a problem with the script.

  • On Linux, common shell interpreter languages such as bash are supported. Add a shebang (such as #!/bin/bash) to the top of your install script. If you need to verify support for your preferred shell commands, you can remotely access an active Linux instance and open a shell prompt. Learn more at Remotely Access Fleet Instances.

Example scripts

These examples illustrate common script usage for Windows and Linux.

Windows

This example install.bat file installs Visual C++ runtime components required for the game server and writes the results to a log file. The component file is included in the build package at the root.

vcredist_x64.exe /install /quiet /norestart /log c:\game\vcredist_2013_x64.log

Linux

This example install.sh file illustrates using bash in your install script and writing results to a log file.

#!/bin/bash echo 'Hello World' > install.log