Please add /cygdrive/c/Windows/Sysnative to the default PATH
Brian Inglis
Brian.Inglis@SystematicSw.ab.ca
Tue Nov 24 21:06:02 GMT 2020
On 2020-11-24 00:24, Thomas Wolff wrote:
> Am 19.11.2020 um 16:57 schrieb Brian Inglis:
>> On 2020-11-17 16:41, tealhill via Cygwin wrote:
>>> On 2020-11-17 4:23 PM, Thomas Wolff wrote:
>>>> Am 17.11.2020 um 20:54 schrieb tealhill via Cygwin:
>>> >>
>>>>> Cygwin's /etc/profile sets the PATH.
>>>>>
>>>>> Could /etc/profile please also add /cygdrive/c/Windows/Sysnative to the end
>>>>> of the PATH?
>>> >
>>>> It doesn't add any other Windows folders so why this one.
>>>
>>> ### Summary
>>>
>>> Why should Cygwin add Sysnative to $PATH? As a workaround for Microsoft's
>>> failure to add Sysnative to %PATH%.
>>
>> You have the option to add SysNative to your system or user PATH under
>> Windows, although that would best be done in your login script.
>>
>>> ### Full explanation
>>>
>>> Cygwin imports the Windows %PATH% variable at startup.
>>>
>>> It would be ideal if Microsoft would add Sysnative to the default Windows
>>> %PATH%. Such a change would help Cygwin users and others. But I doubt that
>>> Microsoft will make this change.
>>>
>>> Therefore, I am suggesting that Cygwin work around Microsoft's omission. My
>>> suggested workaround is for Cygwin to add Sysnative to its own $PATH,
>>> automatically.
>>
>> Cygwin starts with Cygwin paths /usr/bin:/bin and everything else is up to you.
>> You may add to your Cygwin PATH in your shell profile with code that switches
>> depending on the existence of SysWOW64 and SysNative: cygpath -F 37 gives your
>> application sysdir path, and cygpath -F 41 gives your x86 sysdir if there is one:
>>
>> https://docs.microsoft.com/en-ca/dotnet/api/system.environment.specialfolder?view=net-5.0
>>
>> https://docs.microsoft.com/en-ca/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderidlist
>>
>> https://docs.microsoft.com/en-ca/windows/win32/shell/knownfolderid
>>
>> and please note that SysNative appears nowhere!
>
> That's because Sysnative is not a known folder. It is rather unknown just
> because it is virtual :)
> And that is the problem I tried to address. In cygwin32, you can `cd
> $WINDIR/Sysnative` but you wouldn't see the folder. For tools like ls or find it
> simply does not exist, while obviously it exists somehow and can be used in PATH.
It is visible to find and ls when explicitly specified as
/proc/cygdrive/c/Windows/SysNative/
so the contents can be listed and searched, but you have to know to do so, as it
does not appear to be derivable from Windows information like other folders.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
More information about the Cygwin
mailing list