Skip to content

Commit

Permalink
fix python 3.x script execution windows support (#8)
Browse files Browse the repository at this point in the history
* fix python 3.x script execution windows support

python 3.x has %L (unprocessable) in command string format windows registry key instead of %1(processable) in 2.x python. So we can just check and replace.

* fix for Debug configuration
  • Loading branch information
ureyNZB authored Sep 15, 2023
1 parent 0df73e7 commit f25a87c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions daemon/util/Script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,11 @@ void ScriptController::PrepareArgs()
nullptr, command, &bufLen))
{
command[bufLen] = '\0';
debug("Command: %s", command);

CString scommand(command);
scommand.Replace("%L", "%1");// Python 3.x has %L in command instead of %1
debug("Command: %s", scommand.Str());
DWORD_PTR args[] = {(DWORD_PTR)*m_args[0], (DWORD_PTR)0};
if (FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, command, 0, 0,
if (FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, scommand, 0, 0,
m_cmdLine, sizeof(m_cmdLine), (va_list*)args))
{
Util::TrimRight(Util::ReduceStr(m_cmdLine, "*", ""));
Expand Down

0 comments on commit f25a87c

Please sign in to comment.