When installing Python from the Windows Store, a copy of `python.exe` is
installed inder the Microsoft directory in the user's local AppData
directory. Currently, `x.ps1` checks for this file, because by default
running `python.exe` opens a link to the Microsoft Store rather than
running Python.
Once the user installs Python, however, this contains a valid
interpreter. Unfortuantely, `x.ps1` can't tell the difference between a
legitimate Python install and the stub.
Remove the check, as it makes it impossible to use the official version
from Microsoft once it has been installed.
Signed-off-by: Sean Cross <sean@xobs.io>
Before:
```
PS C:\Users\vboxuser\rust> ./x
x.ps1
PS C:\Users\vboxuser\rust>
```
After:
```
PS C:\Users\vboxuser\rust> ./x
x.ps1
C:\Users\vboxuser\rust\x.ps1 : C:\Users\vboxuser\rust\x.ps1: error: did not find python installed
help: consider installing it from https://www.python.org/downloads/windows/
At line:1 char:1
+ ./x
+ ~~~
+ CategoryInfo : NotInstalled: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,x.ps1
```
The existing message from the shell script is already decent and I decided not to change it:
```
$ ./x
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P
```
This is a more ambitious version of https://github.com/rust-lang/rust/pull/98716.
It still changes the shebang back to python3, for compatibility with non-Unix systems,
but also adds alternative entrypoints for systems without `python3` installed.
These scripts will be necessary for the rust entrypoint (#94829), so I see
little downside in adding them early.