I have made a simple plugin that I’m using to test Steamworks functionality (I can’t use the Unreal Online Subsystem Steam plugin for what I want to do). For Steamworks to work, it needs the steam_api64.dll file to be visible to the application, so I’ve set up my plugin’s Build.cs file to copy the DLL where it needs to be:
string coreLibName = "steam_api64.dll";
RuntimeDependencies.Add(Path.Combine("$(BinaryOutputDir)", coreLibName), Path.Combine(redistDeps, "win64", coreLibName));
This seems to work fine, and I can run my test project and use the Steamworks SDK.
However, when I try to package the project, the packaging process is sometimes unable to clean the contents of the Binaries directory, because the steam_api64.dll file is in use by the editor. This doesn’t seem to happen all the time, but happens enough to be annoying.
UATHelper: Packaging (Windows (64-bit)): Running UnrealHeaderTool "C:\path\to\my\project\ShooterGame\ShooterGame.uproject" "C:\path\to\my\project\ShooterGame\Intermediate\Build\Win64\ShooterClient\Development\ShooterClient.uhtmani
fest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors
UATHelper: Packaging (Windows (64-bit)): Reflection code generated for ShooterClient in 88.1578486 seconds
UATHelper: Packaging (Windows (64-bit)): Writing manifest to C:\UnrealEngine\Engine\Intermediate\Build\Manifest.xml
UATHelper: Packaging (Windows (64-bit)): Failed to delete file 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll'
UATHelper: Packaging (Windows (64-bit)): Exception: Access to the path 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll' is denied.
UATHelper: Packaging (Windows (64-bit)): Attempting to retry...
UATHelper: Packaging (Windows (64-bit)): Failed to delete file 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll'
UATHelper: Packaging (Windows (64-bit)): Exception: Access to the path 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll' is denied.
UATHelper: Packaging (Windows (64-bit)): Attempting to retry...
UATHelper: Packaging (Windows (64-bit)): Failed to delete file 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll'
UATHelper: Packaging (Windows (64-bit)): Exception: Access to the path 'C:\path\to\my\project\ShooterGame\Binaries\Win64\steam_api64.dll' is denied.
UATHelper: Packaging (Windows (64-bit)): ERROR: Exhausted all retries!
PackagingResults: Error: Exhausted all retries!
Is this the correct way to deal with this type of dependency? Do I need to change some of my plugin configuration to avoid the Unreal Editor grabbing hold of the Steam DLL when it’s not supposed to?