From 23189c87269d524e6d7bab3f8e5a0117fe35c0cf Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 4 Mar 2023 17:00:48 +0800 Subject: [PATCH] fix wrong dll path (cherry picked from commit 7aa20a47843a3e747c484afb27d37ad57f08c1fb) --- src/slic3r/GUI/wxMediaCtrl2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/wxMediaCtrl2.cpp b/src/slic3r/GUI/wxMediaCtrl2.cpp index 446e819df4..496406ef13 100644 --- a/src/slic3r/GUI/wxMediaCtrl2.cpp +++ b/src/slic3r/GUI/wxMediaCtrl2.cpp @@ -74,7 +74,8 @@ void wxMediaCtrl2::Load(wxURI url) [dll_path] { int res = wxMessageBox(_L("BambuSource has not correctly been registered for media playing! Press Yes to re-register it."), _L("Error"), wxYES_NO); if (res == wxYES) { - SHELLEXECUTEINFO info{sizeof(info), 0, NULL, L"runas", L"regsvr32", dll_path.wstring().c_str(), SW_HIDE }; + wstring quoted_dll_path = L"\"" + dll_path.wstring() + "\""; + SHELLEXECUTEINFO info{sizeof(info), 0, NULL, L"runas", L"regsvr32", quoted_dll_path.c_str(), SW_HIDE }; ::ShellExecuteEx(&info); } });