# How to package and branch for different distributors and demos?

**URL:** <https://forums.unrealengine.com/t/how-to-package-and-branch-for-different-distributors-and-demos/1900272>\
**Category:** Platform & Builds\
**Tags:** Builds, distribution, demo, build, unreal-engine, question, best-practice\
**Created:** [June 12, 2024, 12:14pm UTC](https://forums.unrealengine.com/t/how-to-package-and-branch-for-different-distributors-and-demos/1900272 "2024-06-12T12:14:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PixelBennet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PixelBennet](https://forums.unrealengine.com/u/PixelBennet)\
**Post date:** [June 12, 2024, 12:14pm UTC](https://forums.unrealengine.com/t/how-to-package-and-branch-for-different-distributors-and-demos/1900272/1 "2024-06-12T12:14:50Z")

</div>

Hi there,

are there any proven and scalable ways to manage different builds (e.g. for distributors STEAM, GOG, EGS)?

In Unity we had a small editor script which added and removed Scripting Defines which we could use in code e.g.

`if STEAM`

`Steam Specific code`

`elif GOG`

`GOG specific code`

`endif`

and then we triggered a build for the selected configuration with one line of code.

Same question for demos. We had #if DEMO checks here and there, maybe excluded some maps. I haven’t found something like scripting define project settings in Unreal?

My goal is to be able to click Platforms → Windows → Package Steam, Package GOG etc… Is this easily possible? Is there a better known workflow for these kind of things?

Thanks!

---

<div class="post-metadata">

**Author:** ![PixelBennet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PixelBennet](https://forums.unrealengine.com/u/PixelBennet)\
**Post date:** [July 12, 2024, 8:01am UTC](https://forums.unrealengine.com/t/how-to-package-and-branch-for-different-distributors-and-demos/1900272/2 "2024-07-12T08:01:36Z")

</div>

I finally found a good and clean solution:

1. Create YourGameDemo.Target.cs (besides YourGame.Target.cs). It should inherit from YourGame.Target.cs

2. Add to the constructor of YourGameDemo.Target.cs  
` bOverrideBuildEnvironment = true; GlobalDefinitions.Add("DEMO_BUILD=1");`

3. Write a IsDemo Function in a blueprint library, so you can check for demo everywhere.

```auto
	static bool IsDemo()
	{
#ifdef DEMO_BUILD
		return true;
#else
		return false;
#endif
	}

```

1. Use IsDemo checks where you need (show demo banner, lock specific full game functions etc.)

Can be used for other builds to (e.g. EGS build, GOG build and whatnot)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [August 11, 2024, 8:02am UTC](https://forums.unrealengine.com/t/how-to-package-and-branch-for-different-distributors-and-demos/1900272/3 "2024-08-11T08:02:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
