Skip to main content

Unreal Engine Porting to UWP

Introduction

This solution is applicable to Unreal Engine. By utilizing MSIX packaging technology while keeping the existing code architecture largely unchanged, traditional Win32 applications can be converted into the UWP format for distribution via the Microsoft Store.

Overall Process Overview

SDK Integration and EXE Build

This stage is fundamental to ensure the game itself is fully functional.

SDK Integration

In your Unreal Engine project, follow the standard SDK integration guide to complete tasks such as importing dependent libraries, API calls, and configuration settings. Make sure to complete all SDK-related functionality development and testing at this stage.

Windows Platform Build:

  • Open ProjectFilePackage Project

  • Select Target Platform:

    • Windows (64-bit)

    • Windows (32-bit) - if required

  • Select Output Directory:

    • It is recommended to create an empty folder, such as Builds/Windows

    • Ensure sufficient disk space (usually 5-20GB)

After successful packaging, the output directory structure is as follows:

Builds/Windows/
├── YourGame.exe # Main executable file
├── YourGame/Binaries/ # Dependent DLL files
├── YourGame/Content/ # Game resource files
├── YourGame/Intermediate/ # Intermediate files
└── Engine/ # Engine runtime files

Handling Sandbox Compatibility

The MSIX sandbox environment restricts some operations that are available by default in Win32, such as accessing the registry or system file directories.

  • File System Access: Applications may attempt to write data to protected paths like C:\Program Files or the installation directory, which will fail. Data should be written to Windows.Storage.ApplicationData.Current.LocalFolder (corresponding to %USERPROFILE%\AppData\Local\Packages\[Package Name]\LocalState).

  • Registry Access: Applications may read from or write to HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER\Software\[Some Global Settings]. These write operations will be redirected to a virtualized area. Applications should be guided to store settings in HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\[Application Name].

  • Inter-process Communication (IPC): Complex IPC may be blocked. Ensure the communication method works within the sandbox.

  • Testing and Debugging: Thorough testing is essential to verify that all SDK functionalities behave consistently in the MSIX-installed version compared to the traditional EXE version.

Building, Testing, and Distribution

  • Generate MSIX Package: Use MSIX packaging technology to generate the final MSIX package for the Microsoft Store.

  • Local Testing: Install the MSIX package and perform comprehensive functionality tests.

  • Run WACK: Use the Windows App Certification Kit (WACK) to run certification tests on the package and resolve any compatibility issues.

  • Store Submission: Submit the certified MSIX package to Microsoft Partner Center to complete the store listing process.

Note: Set your local computer to Developer Mode, otherwise the UWP application cannot be installed normally.