M2Team / NanaRun

Application runtime environment customization utility
Other
422 stars 28 forks source link

CreateProcessW failed #2

Closed rainman74 closed 2 years ago

rainman74 commented 2 years ago

Doesn't work! MinSudo in a definied %PATH% Folder (e.g. D:\Apps\Commands\bin)

MinSudo 1.0 Preview 2 (Build 18)
(c) M2-Team and Contributors. All rights reserved.

[Error] CreateProcessW failed.

But: Works: MinSudo 1.0 Preview 2 (Build 18) not in any definied %PATH% Folder (D:) Works: MinSudo 1.0 Preview 1 (Build 5) also in a definied %PATH% Folder (D:\Apps\Commands\bin)

MouriNaruto commented 2 years ago

Which command line you used in MinSudo?

Kenji Mouri

rainman74 commented 2 years ago

WORKS (CMD will be elevated):

C:\>minsudo
MinSudo 1.0 Preview 1 (Build 5)
(c) M2-Team and Contributors. All rights reserved.

Microsoft Windows [Version 10.0.19044.1739]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

C:\>

ERROR:

C:\>minsudo
MinSudo 1.0 Preview 2 (Build 18)
(c) M2-Team and Contributors. All rights reserved.

[Error] CreateProcessW failed.

C:\>
MouriNaruto commented 2 years ago

What the path you put the MinSudo.exe?

I see, it looks like you put MinSudo.exe to D:\Apps\Commands\bin.

Kenji Mouri

rainman74 commented 2 years ago

WORKS (NET will be elevated):

C:\>minsudo net stop USBDLM
MinSudo 1.0 Preview 1 (Build 5)
(c) M2-Team and Contributors. All rights reserved.

USBDLM wird beendet.
USBDLM wurde erfolgreich beendet.

C:\>

ERROR:

C:\>minsudo net stop USBDLM
MinSudo 1.0 Preview 2 (Build 18)
(c) M2-Team and Contributors. All rights reserved.

[Error] CreateProcessW failed.

C:\>
rainman74 commented 2 years ago

What the path you put the MinSudo.exe?

Kenji Mouri

D:\Apps\Commands\bin\minsudo.exe

rainman74 commented 2 years ago

WORKS, if MinSudo 1.0 Preview 2 EXE is not in PATH:

D:\Downloads\NanaRun_1.0_Preview2_1.0.18.0\x64>MinSudo.exe net stop USBDLM
MinSudo 1.0 Preview 2 (Build 18)
(c) M2-Team and Contributors. All rights reserved.

USBDLM wird beendet.
USBDLM wurde erfolgreich beendet.

D:\Downloads\NanaRun_1.0_Preview2_1.0.18.0\x64>
MouriNaruto commented 2 years ago

I have reproduced this issue.

I found this issue will be happened when the current directory is the root of the drive.

image image image

Kenji Mouri

MouriNaruto commented 2 years ago

I have fixed this issue.

It was caused by command line parser behavior. (NanaRun's command line parser follows the rule from https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments?view=msvc-170.)

Kenji Mouri

rainman74 commented 2 years ago

I have fixed this issue.

It was caused by command line parser behavior. (NanaRun's command line parser follows the rule from https://docs.microsoft.com/en-us/cpp/c-language/parsing-c-command-line-arguments?view=msvc-170.)

Kenji Mouri

If you build a test version, I'll be happy to test it and confirm functionality.

MouriNaruto commented 2 years ago

If you build a test version, I'll be happy to test it and confirm functionality.

MinSudo_20220608.zip

Here is the binary for the test.

Kenji Mouri

rainman74 commented 2 years ago

If you build a test version, I'll be happy to test it and confirm functionality.

MinSudo_20220608.zip

Here is the binary for the test.

Kenji Mouri

runs perfectly without errors now!