Fix game deployment if output name contains invalid path characters

#3004
This commit is contained in:
Wojtek Figat
2024-10-21 12:37:55 +02:00
parent 8ff334ae63
commit f62c77c35c
4 changed files with 37 additions and 9 deletions

View File

@@ -511,11 +511,12 @@ bool WindowsPlatformTools::OnDeployBinaries(CookingData& data)
// Rename app
const String newName = EditorUtilities::GetOutputName();
if (newName != StringUtils::GetFileNameWithoutExtension(files[0]))
const StringView oldName = StringUtils::GetFileNameWithoutExtension(files[0]);
if (newName != oldName)
{
if (FileSystem::MoveFile(data.NativeCodeOutputPath / newName + TEXT(".exe"), files[0], true))
{
data.Error(TEXT("Failed to change output executable name."));
data.Error(String::Format(TEXT("Failed to change output executable name from '{}' to '{}'."), oldName, newName));
return true;
}
}