Installing a File Under a Different Name

SCons User Guide 0.98.0
Prev | Chapter 11. Installing Files in Other Directories: the `Install` Builder | Next

# 11.2. Installing a File Under a Different Name

The `Install` method preserves the name of the file when it is copied into the destination directory. If you need to change the name of the file when you copy it, use the `InstallAs` function:

           env = Environment()
           hello = env.Program('hello.c')
           env.InstallAs('/usr/bin/hello-new', hello)
           env.Alias('install', '/usr/bin')

This installs the `hello` program with the name `hello-new` as follows:

           % scons -Q install
           cc -o hello.o -c hello.c
           cc -o hello hello.o
           Install file: "hello" as "/usr/bin/hello-new"

Prev | Home | Next
Installing Files in Other Directories: the `Install` Builder | Up | Installing Multiple Files Under Different Names