11.3. Installing Multiple Files Under Different Names
Prev | Chapter 11. Installing Files in Other Directories: the `Install` Builder | Next

## 11.3. Installing Multiple Files Under Different Names

If you have multiple files that all need to be installed with different file names, you can either call the `InstallAs` function multiple times, or as a shorthand, you can supply same-length lists for both the target and source arguments:

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

In this case, the `InstallAs` function loops through both lists simultaneously, and copies each source file into its corresponding target file name:

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

Prev | Up | Next
11.2. Installing a File Under a Different Name | Home | 11.4. Installing a Shared Library