Skip to content

Commit

Permalink
Updated packaging guide
Browse files Browse the repository at this point in the history
  • Loading branch information
OlssonDev committed Sep 15, 2024
1 parent 410974d commit e144393
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,31 @@ layout: default

Begin by packaging your game as you would normally in Unreal Engine. Ensure you select the correct platform (Windows) and configurations for your game. This initial step does not differ from the standard game packaging procedure in Unreal Engine.

## Run the UnrealSharp Packaging Script
## Packaging via Unreal Editor

After packaging your game, you will need to execute a script to include the C# code and the .NET runtime into your packaged game.
You can easily package your C# project and runtime directly through the Unreal Editor. Follow these steps:

### Open the Packaging Tool

In the editor, navigate to the **UnrealSharp** toolbar located at the top of the viewport, and click on **Package Project**.

![PackageProject](https://raw.githubusercontent.com/UnrealSharp/unrealsharp.github.io/main/media/get-started/PackageProject.PNG)

A file explorer dialog will appear, prompting you to choose the directory where your project will be packaged. Select the **root folder** of your packaged project. This is the folder containing your **.exe** file.

After selecting the correct folder, you should see the packaging process start.

![PackagingProcess](https://raw.githubusercontent.com/UnrealSharp/unrealsharp.github.io/main/media/get-started/PackagingProjectPrompt.PNG)

Once the prompt disappears, the packaging is complete, and your game is ready to be launched.

## Packaging via Command Prompt

Open **Command Prompt** or **PowerShell** window and navigate to ```UnrealSharp\Binaries\Managed```

## Publish Script
```dotnet UnrealSharpBuildTool.dll --Action Publish --ProjectDirectory "<YourProjectDirectory>" --ProjectName "<YourProjectName>" --PluginDirectory "<YourPluginDirectory>" --ArchiveDirectory "<YourArchiveDirectory>"```
## Package Project Script

```dotnet UnrealSharpBuildTool.dll --Action PackageProject --ProjectDirectory "<YourProjectDirectory>" --ProjectName "<YourProjectName>" --PluginDirectory "<YourPluginDirectory>" --ArchiveDirectory "<YourArchiveDirectory>" --AdditionalArgs BuildConfig=Release```

**--Action:** The action you want UnrealSharpBuildTool to run.

Expand All @@ -32,7 +49,7 @@ Open **Command Prompt** or **PowerShell** window and navigate to ```UnrealSharp\
### Example Usage:
If your project is named "MyGame" and is located at ```C:/Users/CoolName/Documents/Unreal Projects/MyGame```, with the UnrealSharp plugin in the project's "Plugins" folder and you want to archive the packaged game to the desktop, your command would look like this:

```dotnet UnrealSharpBuildTool.dll --Action Publish --ProjectDirectory "C:/Users/CoolName/Documents/Unreal Projects/MyGame/" --ProjectName "MyGame" --PluginDirectory "C:/Users/CoolName/Documents/Unreal Projects/MyGame/Plugins/UnrealSharp" --ArchiveDirectory "C:/Users/CoolName/Desktop/Windows"```
```dotnet UnrealSharpBuildTool.dll --Action PackageProject --ProjectDirectory "C:/Users/CoolName/Documents/Unreal Projects/MyGame/" --ProjectName "MyGame" --PluginDirectory "C:/Users/CoolName/Documents/Unreal Projects/MyGame/Plugins/UnrealSharp" --ArchiveDirectory "C:/Users/CoolName/Desktop/Windows" --AdditionalArgs BuildConfig=Release```

## Done and dusted!

Expand Down

0 comments on commit e144393

Please sign in to comment.