@@ -216,7 +216,14 @@ void OvEditor::Core::EditorActions::Build(bool p_autoRun, bool p_tempFolder)
216216
217217void OvEditor::Core::EditorActions::BuildAtLocation (const std::string & p_configuration, const std::filesystem::path& p_buildPath, bool p_autoRun)
218218{
219- std::string executableName = m_context.projectSettings .Get <std::string>(" executable_name" ) + " .exe" ;
219+ const std::string extension =
220+ #if defined(_WIN32)
221+ " .exe" ;
222+ #else
223+ " " ;
224+ #endif
225+
226+ const std::string executableName = m_context.projectSettings .Get <std::string>(" executable_name" ) + extension;
220227
221228 bool failed = false ;
222229
@@ -251,7 +258,8 @@ void OvEditor::Core::EditorActions::BuildAtLocation(const std::string & p_config
251258 err
252259 );
253260
254- const auto sceneFileName = m_context.projectSettings .Get <std::string>(" start_scene" );
261+ auto sceneFileName = m_context.projectSettings .Get <std::string>(" start_scene" );
262+ sceneFileName = OvTools::Utils::PathParser::MakeNonWindowsStyle (sceneFileName);
255263
256264 if (!std::filesystem::exists (p_buildPath / " Data" / " User" / " Assets" / sceneFileName))
257265 {
@@ -330,8 +338,10 @@ void OvEditor::Core::EditorActions::BuildAtLocation(const std::string & p_config
330338 if (!err)
331339 {
332340 OVLOG_INFO (" Builder data (Dlls and executable) copied" );
341+
342+ const std::string initialExecutableName = " OvGame" + extension;
333343
334- std::filesystem::rename (p_buildPath / " OvGame.exe " , p_buildPath / executableName, err);
344+ std::filesystem::rename (p_buildPath / initialExecutableName , p_buildPath / executableName, err);
335345
336346 if (!err)
337347 {
@@ -344,7 +354,7 @@ void OvEditor::Core::EditorActions::BuildAtLocation(const std::string & p_config
344354
345355 if (std::filesystem::exists (exePath))
346356 {
347- OvTools::Utils::SystemCalls::OpenFile (exePath.string (), p_buildPath.string ());
357+ OvTools::Utils::SystemCalls::RunProgram (exePath.string (), p_buildPath.string ());
348358 }
349359 else
350360 {
0 commit comments