ansicon
ansicon copied to clipboard
ANSICON potentially interferes with Composer installation
The developers of Composer think that ANSICON interferes with its installation by returning an exit code of 1.
https://github.com/composer/windows-setup/issues/74
I have no idea if this is the case or not, but if it is, it would be good to fix it.
I was not able to replicate it (ANSICON 1.66, Composer-Setup 4.7.0).
@adoxa Me neither, for the few times it has come up.
However if ANSICON is located in a system directory, as per https://github.com/composer/windows-setup/issues/80#issuecomment-339877955, then bingo!
I'll handle it better in the next release, as per this beta:
https://s3-eu-west-1.amazonaws.com/johnstevenson/composer/Composer-Setup.4.7.1.exe
Ah, I was supposed to make a note not to install in the system directory, because things like this happen (you would need to install to SysWOW64 as well to avoid it). Still, I renamed the path where I had it installed so it wouldn't be found and it still worked.
This only seems to be a problem (at least on Windows 64-bit) if it is installed in C:\Windows\System32 and it is a per-user installation ansicon -i (because HKCU Software keys are shared, not redirected).
For an ansicon -I installation, writing to HKLM, then ansicon is not invoked (because Composer-Setup.exe is a 32-bit application, calling the 32-bit cmd.exe which reads from HKLM\Software\WOW6432Node).
How come ansicon works fine (ie doesn't return exit code 1) from SysWOW64 but not from System32?
Because a 32-bit process redirects System32 to SysWOW64, where ANSICON doesn't exist (at least, that's what I expect is happening).
But if you specifically put it in SysWOW64 then it gets invoked:
C:\Windows\SysWOW64\cmd.exe loads C:\Windows\SysWOW64\ansicon\x64\ANSI32.dll and the correct exit code is returned.
Well, yeah, why wouldn't it? The real question is why it seems to partially fail when it's only in System32 - perhaps there's some weird interaction, so it does load System32\ansicon.exe, but that's looking for SysWOW64\ANSI32.dll, not finding it and that's where the exit code of 1 comes from. Anyway, the next release will tell people not to install in System32, so that's that (yeah, right :smirk:).
Cool. If it is a known bug/limitation, then fair enough. I've updated the error info for the next release:
A setting in your registry could be causing the problem. Check this value and remove it if necessary:
HKCU\Software\Microsoft\Command Processor\AutoRun = (if %ANSICON_VER%==^%ANSICON_VER^% "C:\Windows\System32\ANSICON\x64\ansicon" -p)
Note: ANSICON should not be installed in the system directory.
Thanks for you help.