ddr: enclose file path in quotes & use wchar when registering codecs (#354)

## Link to GitHub Issue, if one exists
#345 

## Description of change
Account for the path to codec DLL having spaces in it and use wide
chars.

## Testing
Testing 32 and 64 bits.
This commit is contained in:
bicarus-dev
2025-08-16 19:18:15 -07:00
committed by GitHub
parent d262e02f8c
commit 926f2ef2a0
+4 -3
View File
@@ -84,11 +84,12 @@ namespace games::ddr {
log_info("ddr", "found DLL: {}", filename.string()); log_info("ddr", "found DLL: {}", filename.string());
if (filename == "k-clvsd.dll" || filename.string().find("xactengine") == 0) { if (filename == "k-clvsd.dll" || filename.string().find("xactengine") == 0) {
const std::string cmd = "regsvr32.exe /s " + file.path().string(); const std::wstring wcmd = L"regsvr32.exe /s \"" + file.path().wstring() + L"\"";
const std::string cmd = "regsvr32.exe /s \"" + file.path().string() + "\"";
int result = 0; int result = 0;
std::thread t([cmd, &result]() { std::thread t([wcmd, &result]() {
result = system(cmd.c_str()); result = _wsystem(wcmd.c_str());
}); });
t.join(); t.join();
log_info("ddr", "`{}` returned {}", cmd, result); log_info("ddr", "`{}` returned {}", cmd, result);