Fix for OSX

This commit is contained in:
Vojtech Bubnik 2020-09-07 17:09:27 +02:00
parent 9473ae8fe2
commit 1221c67d7f

View file

@ -42,12 +42,12 @@ static void start_new_slicer_or_gcodeviewer(const NewSlicerInstanceType instance
wxExecute(const_cast<wchar_t**>(args.data()), wxEXEC_ASYNC | wxEXEC_HIDE_CONSOLE | wxEXEC_MAKE_GROUP_LEADER);
#else
// Own executable path.
boost::filesystem::path own_path = into_path(wxStandardPaths::Get().GetExecutablePath());
boost::filesystem::path bin_path = into_path(wxStandardPaths::Get().GetExecutablePath());
#if defined(__APPLE__)
{
own_path /= (instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer";
bin_path /= (instance_type == NewSlicerInstanceType::Slicer) ? "PrusaSlicer" : "PrusaGCodeViewer";
// On Apple the wxExecute fails, thus we use boost::process instead.
path_to_open ? boost::process::spawn(path.string(), into_u8(*path_to_open)) : boost::process::spawn(path.string());
path_to_open ? boost::process::spawn(bin_path.string(), into_u8(*path_to_open)) : boost::process::spawn(bin_path.string());
}
#else // Linux or Unix
{