composer / windows-setup

The Windows installer for the Composer PHP Dependency Manager
MIT License
144 stars 69 forks source link

The command interpreter did not run correctly #123

Closed JustSimonCZ closed 4 years ago

JustSimonCZ commented 4 years ago

Hello there!

I was trying to install the composer but the installation ended up with a error saying: The command interpreter did not run correctly: C:\WINDOWS\system32\cmd.exe

It changed the directory to...

Here is my log file: Setup Log 2020-09-02 #004.txt Also tried the sfc /scannow command in the cmd which ended with no issues found.

Thanks for the suggestions!

johnstevenson commented 4 years ago

Could you open up cmd.exe in your User directory then run the following 2 snippets and show me the output:

cd
cmd /c cd

Thanks.

JustSimonCZ commented 4 years ago

Well, if I´m doing it correctly, it does nothing.

johnstevenson commented 4 years ago

Sure, but I would like to see your output on screen. Your User folder is at C:\Users\Šimon but cmd.exe reports it at C:\Users\ćimon

JustSimonCZ commented 4 years ago

cmd_bGoVVON2Tx Ohh, ok, here you go :)

johnstevenson commented 4 years ago

Thanks. The installer gets this output by writing it to a text file, then reading from that (which is the only way to do it in Inno Setup). So could you now try:

cmd /c cd >out.txt

and show me what is in out.txt

JustSimonCZ commented 4 years ago

out.txt Well that is interresting. Now it shows the profile name badly.

johnstevenson commented 4 years ago

Thanks. It shows a different profile name C:\Users\æimon from the one reported in your log file C:\Users\ćimon, which as you pointed out is not the same as C:\Users\Šimon

Perhaps this is a codepage thing. Could you tell me what chcp outputs (although I believe this will be the input codepage used by cmd rather than the output codepage).

Or it could be an Inno thing, or me just buggering things up!

JustSimonCZ commented 4 years ago

There you go. cmd_xem8rwLRbj

johnstevenson commented 4 years ago

Thanks. I can replicate this now.

If I create a directory named Šimon then it outputs Šimon on screen but writes æimon to file (using codepage 852) which Inno Setup then translates to ćimon. However switching to codepage 850 it writes Simon to file. However I am none the wiser.

I've changed the installer to just use the 8-character ascii temp directory name that Inno Setup creates for the comparison. Could you please give this a go:

Composer-Setup.6.0.1.exe.zip

JustSimonCZ commented 4 years ago

Ok so the installation was succesful but now, when I try to open composer in cmd it shows this: cmd_dPvpvZyqiT Could it be again the issue with the 'Š' letter?

johnstevenson commented 4 years ago

Hmm. Where did you install it. Run this in cmd:

where composer

or attach the latest log file.

JustSimonCZ commented 4 years ago

Ohh yes, I installed it in the wrong directory, sorry about that. I changed the directory and now it´s working perfectly. Thanks for the help!

johnstevenson commented 4 years ago

Could you explain where you installed it in order to get that error please.

JustSimonCZ commented 4 years ago

It was in C:\Users\Šimon\Appdata\Local\ComposerSetup\bin

johnstevenson commented 4 years ago

I can't replicate this (by installing into a directory at a path containing a Šimon folder).

Also, I don't understand your screen shot. It looks like you got no output when running composer (which can be called from any directory because it is on your path) and the error message 'Could' is not recognized as ... looks like it is the result of calling Could not open input file: @php

Did you send the wrong image because it doesn't make any sense to me?

JustSimonCZ commented 4 years ago

No, the screenshot is correct. I can´t call the composer from any directory but only in the C:\Users\Šimon\Appdata\Local\ComposerSetup\bin directory. Here is the example: cmd_9x4MRXKwws

johnstevenson commented 4 years ago

I'm baffled. What does where composer report? Perhaps you could send me your last installation log. Thanks.

JustSimonCZ commented 4 years ago

cmd_mm6LxkoEDY Setup Log 2020-09-02 #008.txt Here it goes. Now I am baffled too xd.

johnstevenson commented 4 years ago

C:\Windows\System32\composer.bat shouldn't be there. Can you show me its contents please.

JustSimonCZ commented 4 years ago

notepad_KdZw7qOBrv This is it.

johnstevenson commented 4 years ago

Good grief! At least that explains the error message that I could not understand. I suggest you delete that file, and try running composer from any directory again.

JustSimonCZ commented 4 years ago

Yes it now works from any directory finally. Thanks m8! I have no idea where that bat file came from. Have a nice day.