mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
hail marry from aon3
This commit is contained in:
parent
a0251d0d0f
commit
49a86a2d38
1 changed files with 9 additions and 3 deletions
|
@ -41,9 +41,15 @@ int runBinary(
|
|||
const std::filesystem::path& binaryPath, const std::filesystem::path& iniPath, const std::filesystem::path& cfgPath)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
std::wstringstream cmd;
|
||||
cmd << L"& '" << binaryPath.native() << L"' -i '" << iniPath.native() << L"' -c '" << cfgPath.native() << "'";
|
||||
return _wsystem(cmd.str().c_str());
|
||||
std::filesystem::path psScriptPath = std::filesystem::temp_directory_path() /
|
||||
("openmw_iniimporter_tests_" + std::to_string(std::time(nullptr))+ ".ps1");
|
||||
std::wofstream psScriptFile(psScriptPath);
|
||||
psScriptFile << L"& '" << binaryPath.native() << L"' -i '" << iniPath.native() << L"' -c '" << cfgPath.native() << "'";
|
||||
psScriptFile.close();
|
||||
|
||||
std::wstringstream psCmd;
|
||||
psCmd << L"powershell -NoProfile -ExecutionPolicy Bypass -File \"" << psScriptPath.wstring() << L"\"";
|
||||
return _wsystem(psCmd.str().c_str());
|
||||
#else
|
||||
std::stringstream cmd;
|
||||
cmd << binaryPath << " -i "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue