# \[TUTORIAL\] How to use Setup.bat and how to reduce download size

**URL:** <https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code, GitHub, Engine-Source-GitHub\
**Created:** [December 22, 2014, 12:26pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640 "2014-12-22T12:26:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![msvcrt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@msvcrt](https://forums.unrealengine.com/u/msvcrt)\
**Post date:** [December 22, 2014, 12:26pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/1 "2014-12-22T12:26:45Z")

</div>

Hi guys, here’s some useful information for those who care about download size and/or disk space taken by the engine dependencies.

By default, **Setup.bat** always downloads files for your current platform: **Win32** and **Win64** if you are on Windows and **Mac** if you are on Mac. But you will also get dependency files for iOS and Linux even if you won’t need them. It also downloads HLML5 dependencies if you have Emscripten installed and Android dependencies if you have NDK.

This is quite clever but what if you want to decide which files to download? You can use two command-line options: **-exclude** and **-include**.

Use **-exclude** to specify platforms you are _not_ going to use. For example, if you don’t want Linux and iOS dependencies run this:

```auto

Setup.bat -exclude=Linux -exclude=IOS

```

Use **-include** to specify what you _want_ to download. For example, you don’t have NDK and Emscripten installed (yet) but want to get Android and HTML5 files anyway:

```auto

Setup.bat -include=HTML5 -include=Android

```

Here is the list of platforms to use with these two options: **Win32** , **Win64** , **Mac** , **Linux** , **Android** , **IOS** , **HTML5**.

Useful, isn’t it? But this is not all! By default, when you are on Windows the script downloads library files for both VS2012 and VS2013, what if you are only going to use one version and won’t need files for the other? Just add an **-exclude** option:

```auto

Setup.bat -exclude=VS2012

```

or

```auto

Setup.bat -exclude=VS2013

```

In fact, this option simply works as a filter that will filter out all the files that contain specified folder in their paths, since all version-dependent Visual Studio libraries are located in folders “VS2012” and “VS2013” they will be filtered out by this option! This can greatly reduce your disk space usage!

Well, just wanted to share this for those who didn’t figure that out yet. 🙂  
Hope this information is useful!

Thanks for reading!

Robert.

P.S. Thanks for the sources of the _GitDependencies_ program, Epic! This is how I learned all this stuff!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_92fac9de](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_92fac9de](https://forums.unrealengine.com/u/anonymous_user_92fac9de)\
**Post date:** [December 22, 2014, 12:37pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/2 "2014-12-22T12:37:55Z")

</div>

Thanks, that’s actually very helpful! 🙂

---

<div class="post-metadata">

**Author:** ![msvcrt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@msvcrt](https://forums.unrealengine.com/u/msvcrt)\
**Post date:** [December 22, 2014, 2:45pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/4 "2014-12-22T14:45:54Z")

</div>

There are some other folders that can be filtered out. If you are not targeting Windows RT you can add **WinRT** to the list of excluded directories. Also, I noticed that some libraries store their files in non-standard folders, examples are **Linux32** , **osx64** , **x64** (instead of Win64). So if you are not targeting these platforms and want to reduce the size even more, you can add these folders too.

---

<div class="post-metadata">

**Author:** ![rcmaniac25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rcmaniac25](https://forums.unrealengine.com/u/rcmaniac25)\
**Post date:** [December 22, 2014, 8:21pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/5 "2014-12-22T20:21:11Z")

</div>

Thanks for this. Got me back about 5GB of space.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2311c7c3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2311c7c3](https://forums.unrealengine.com/u/anonymous_user_2311c7c3)\
**Post date:** [January 1, 2015, 8:57am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/6 "2015-01-01T08:57:18Z")

</div>

If I exclude the VS2012 files I get the error “LNK1181: cannot open input file 'silk\_common.lib” with UE4.6.1

---

<div class="post-metadata">

**Author:** ![SRombauts](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SRombauts](https://forums.unrealengine.com/u/SRombauts)\
**Post date:** [January 5, 2015, 9:06am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/7 "2015-01-05T09:06:14Z")

</div>

> [@dinker99;199614](#):
>
> If I exclude the VS2012 files I get the error “LNK1181: cannot open input file 'silk\_common.lib” with UE4.6.1

Same for me with **UE4.7** : **-exclude=VS2012** give a link error, but also also **-exclude=Win32**

```auto

20> [1/179] Link UE4Editor-Engine.dll
20>LINK : fatal error LNK1181: cannot open input file 'ThirdParty/libOpus/opus-1.1/win32/VS2012/x64/Release/\silk_common.lib'
20> -------- End Detailed Actions Stats -----------------------------------------------------------
20>ERROR : UBT error : Failed to produce item: C:\Users\srombauts\workspace\UE47\Engine\Binaries\Win64\UE4Editor-Engine.dll

```

This is because silk\_common.lib is only available under the path ‘ThirdParty/libOpus/opus-1.1/ **win32/VS2012** /x64/Release/\silk\_common.lib’

Currently using:

```auto

Setup.bat -exclude=WinRT -exclude=Linux -exclude=Linux32 -exclude=osx64 -exclude=IOS

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2311c7c3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2311c7c3](https://forums.unrealengine.com/u/anonymous_user_2311c7c3)\
**Post date:** [January 5, 2015, 12:06pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/8 "2015-01-05T12:06:54Z")

</div>

> [@SRombauts;201133](#):
>
> Same for me with **UE4.7** : **-exclude=VS2012** give a link error, but also also **-exclude=Win32**
> 
> ```auto
> 
> 20> [1/179] Link UE4Editor-Engine.dll
> 20>LINK : fatal error LNK1181: cannot open input file 'ThirdParty/libOpus/opus-1.1/win32/VS2012/x64/Release/\silk_common.lib'
> 20> -------- End Detailed Actions Stats -----------------------------------------------------------
> 20>ERROR : UBT error : Failed to produce item: C:\Users\srombauts\workspace\UE47\Engine\Binaries\Win64\UE4Editor-Engine.dll
> 
> ```

Presumably Mr. Khalikov posted this guide without actually testing it himself.

---

<div class="post-metadata">

**Author:** ![kassane](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kassane/32/469014_2.png) [@kassane](https://forums.unrealengine.com/u/kassane)\
**Post date:** [February 28, 2015, 1:56pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/9 "2015-02-28T13:56:35Z")

</div>

Amazing!

I’m used:

```auto

Setup.bat -exclude=Linux -exclude=Linux32 -exclude=osx32 -exclude=osx64 -exclude=IOS

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2a5c3051](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2a5c3051](https://forums.unrealengine.com/u/anonymous_user_b2a5c3051)\
**Post date:** [March 1, 2015, 4:45am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/10 "2015-03-01T04:45:36Z")

</div>

Very helpful and informative thread, Thanks.

Currently using:

```auto

Setup.bat -exclude=WinRT -exclude=Linux -exclude=Linux32 -exclude=osx64 -exclude=osx32 -exclude=IOS -include=HTML5 -include=Android

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6c6302a9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6c6302a9](https://forums.unrealengine.com/u/anonymous_user_6c6302a9)\
**Post date:** [April 7, 2015, 7:47pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/11 "2015-04-07T19:47:21Z")

</div>

i’m just confused? sorry I don’t know anything about programming but please somebody could explain where should I include the -include or -exclude option in setup.bat? do I have to include it inside the setup.bat? ei…

@  
setlocal  
pushd %~dp0

rem Sync the dependencies…  
.\Engine\Binaries\DotNET\GitDependencies.exe --prompt %\*  
if ERRORLEVEL 1 goto error

rem Setup the git hooks…  
if not exist .git\hooks goto no\_git\_hooks\_directory  
Registering git hooks…  
echo #!/bin/sh \>.git\hooks\post-checkout  
Engine/Binaries/DotNET/GitDependencies.exe \>\>.git\hooks\post-checkout  
echo #!/bin/sh \>.git\hooks\post-merge  
Engine/Binaries/DotNET/GitDependencies.exe \>\>.git\hooks\post-merge  
:no\_git\_hooks\_directory

or shoud I rename the setup.bat and include this options?  
please i’m a beginner know nothing about programming. ☹

---

<div class="post-metadata">

**Author:** ![rcmaniac25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rcmaniac25](https://forums.unrealengine.com/u/rcmaniac25)\
**Post date:** [April 9, 2015, 6:50pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/12 "2015-04-09T18:50:30Z")

</div>

You don’t include them **in** the batch file. You pass them as arguments when you run them from command line (On Windows, it’s CMD)

You run CMD, cd to the folder (cd C:&lt;some path\>\UnrealEngine4), then do “Setup.bat -include=Android -exclude=WinRT” etc.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6c6302a9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6c6302a9](https://forums.unrealengine.com/u/anonymous_user_6c6302a9)\
**Post date:** [April 9, 2015, 10:20pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/13 "2015-04-09T22:20:40Z")

</div>

> [@rcmaniac25;268233](#):
>
> You don’t include them **in** the batch file. You pass them as arguments when you run them from command line (On Windows, it’s CMD)
> 
> You run CMD, cd to the folder (cd C:&lt;some path\>\UnrealEngine4), then do “Setup.bat -include=Android -exclude=WinRT” etc.

thanks for clearing up 🙂

---

<div class="post-metadata">

**Author:** ![CloDel\_Studios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CloDel\_Studios](https://forums.unrealengine.com/u/CloDel_Studios)\
**Post date:** [April 16, 2015, 11:32pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/14 "2015-04-16T23:32:58Z")

</div>

or, open up notepad, paste in this “Setup.bat -exclude=WinRT -exclude=Linux -exclude=Linux32 -exclude=osx64 -exclude=IOS -exclude=HTML5” that will excludes what you see typed, you can add or take away from there, but I use that one for my PC and for Android.

save the file as a .bat in the same folder as the Setup.bat

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_07327ff2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_07327ff2](https://forums.unrealengine.com/u/anonymous_user_07327ff2)\
**Post date:** [March 5, 2016, 7:59am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/15 "2016-03-05T07:59:59Z")

</div>

these commands still work for version 4.10.4 !! i just want to work on win7x64  
Right now installing ue4 for learning purpose so doesn’t need all the dependencies.

can i use this “Setup.bat -exclude=WinRT -exclude=Linux -exclude=Linux32 -exclude=osx64 -exclude=IOS -exclude=HTML5”  
what is the size of these dependencies ?

Tested 🙂  
its also works on 4.10.4 🙂  
dependencies size around 3Gb & Full dependencies around 3.5 Gb but note !!  
when i download 3gb dependencies the size of the unreal folder gone to around 9Gb & after building engine its 30Gb wow :0

so adding full dependencies & building the whole engine require more space & time !!

---

<div class="post-metadata">

**Author:** ![msvcrt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@msvcrt](https://forums.unrealengine.com/u/msvcrt)\
**Post date:** [March 7, 2016, 12:25am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/16 "2016-03-07T00:25:59Z")

</div>

By the way, there’s now [a more flexible way](https://github.com/EpicGames/UnrealEngine/pull/1687) to customize dependency download. Should be included in 4.11.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_07327ff2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_07327ff2](https://forums.unrealengine.com/u/anonymous_user_07327ff2)\
**Post date:** [March 9, 2016, 2:12pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/17 "2016-03-09T14:12:25Z")

</div>

ok Sir 🙂 …

---

<div class="post-metadata">

**Author:** ![Zarkopafilis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zarkopafilis](https://forums.unrealengine.com/u/Zarkopafilis)\
**Post date:** [March 9, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/18 "2016-03-09T20:28:24Z")

</div>

I like the whole concept but then there is a chaotic situation if you want to build for many platforms. My recent experience with Linux building for example was a pain in the butt. TLDR you have to redownload dependencies,rebuild the engine,the editor , some extra modules. Stuff may not work from the first time etc.

Let alone that, the whole idea reminds me of some people spamming the facebook group in search of ways to save a ton of bandwidth while downloading the engine from github or the launcher,or trying to build the engine with a low-end system.

Anyway, It’s a no-go for me. I will stick with grabbing all the dependencies (even linux ones).

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [March 27, 2017, 6:24pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/19 "2017-03-27T18:24:21Z")

</div>

Just want to add to this, using Exclude VS2013 and VS2012 will cause your builds to fail. Tested recently in 4.15.

See findings here:

> **[Release Branch Build Fails (Slimmed Down Build)](https://forums.unrealengine.com/showthread.php?140801-Release-Branch-Build-Fails-%28Slimmed-Down-Build%29&p=686600#post686600)**
>
> I’m working from the current Release branch, and have made a few minor modifications to the setup.bat to reduce the file download size. Unfortuantely, my engine build is now failing due to some issues created by iPhonePackager. I suspect this is a...

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [May 7, 2017, 11:22am UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/20 "2017-05-07T11:22:28Z")

</div>

A few updates for this thread. I tried a few times with a 4.15 build and this is what I found.

- You can’t exclude ‘IOS’ platform, even if you’re not using it. If you do, the iPhonePackager module will be missing a few icons and won’t be able to build, preventing the engine from building at all.
- If you want to exclude ‘Switch’ dependencies, you can add

```auto

-exclude=Dingo

```

- You can’t seem to use -exclude=VS2012 or -exclude=VS2013, because there are dependencies in those folders which don’t exist in VS2015 folder, and are required.

If you want to decrease your download size, you can also add a .gitdepsignore file to the root folder of the repository, and add the following lines:

```auto

/Engine/Documentation/**
/Engine/Extras/**
/FeaturePacks/**
/Samples/**
/Templates/**!/Engine/Extras/Redist/**!/Engine/Extras/VisualStudioDebugging/**

```

This removes a lot of the content download, but keeps the things that are still required for the engine to run.

---

<div class="post-metadata">

**Author:** ![Cobryis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cobryis](https://forums.unrealengine.com/u/Cobryis)\
**Post date:** [October 17, 2017, 5:43pm UTC](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640/21 "2017-10-17T17:43:03Z")

</div>

Hey guys, just wanted to chime in. gitdepsignore and exclude= is super useful. I didn’t find it specified exactly anywhere, but .gitdepsignore has to be in the \<workspace\>/UE4/ folder. I’m only having my programmers use Setup.bat. For artists, I’ve written a python script for having TeamCity automatically update and submit Editor/Game binaries on every commit, and include all Content folders as well in the case of an engine upgrade.

Here’s my .gitdepsignore:

```auto

/Engine/Documentation/**
/Engine/Extras/**!/Engine/Extras/Redist/**!/Engine/Extras/VisualStudioDebugging/**!/Engine/Extras/VisualStudioSnippets/**
/FeaturePacks/**
/Samples/**
/Templates/**
/Engine/ **/Android*/**!/Engine/Plugins/Runtime/AndroidPermission/**
/Engine/ **/IOS*/**
/Engine/ **/TVOS*/**
/Engine/ **/Google*/**
/Engine/ **/LeapMotion/**
/Engine/Plugins/Online/OnlineSubsystemFacebook/**
/Engine/Plugins/Online/OnlineSubsystemAmazon/**
/Engine/Plugins/Online/OnlineSubsystemGoogle/**
#i'm excluding engine and plugin content because we're including it in Perforce
#including a / after Engine breaks this because it evaluates to Engine/.*/Content which will not find Engine/Content
/Engine **/Content/**

```

Here’s part of my Setup.bat:

```auto

set EXCLUDES= -exclude=Linux -exclude=Mac -exclude=Android -exclude=TVOS -exclude=IOS -exclude=GoogleVR -exclude=GoogleTest -exclude=LeapMotion -exclude=Dingo -exclude=Switch

rem Sync the dependencies...
.\Engine\Binaries\DotNET\GitDependencies.exe %PROMPT_ARGUMENT% %* %EXCLUDES%

```

Thanks for this thread!

EDIT: I should note that **some of the things** I excluded do **require engine modifications**. I’ve basically removed all Android, IOS, TVOS references in the engine, and deleted related projects.

[Next page](https://forums.unrealengine.com/t/tutorial-how-to-use-setup-bat-and-how-to-reduce-download-size/17640.md?page=2)
