apm icon indicating copy to clipboard operation
apm copied to clipboard

How to install shell commands for "Atom for Windows"?

Open hypogaea opened this issue 10 years ago • 18 comments

I have installed Atom for Windows, but there is no shell commands in my local PC

hypogaea avatar Apr 23 '16 15:04 hypogaea

@hypogaea How did you install Atom?

winstliu avatar Apr 23 '16 15:04 winstliu

I just run the installer downloaded from the red botton with "Download Windows Install" in Official Website.

hypogaea avatar Apr 23 '16 16:04 hypogaea

/cc @damieng

winstliu avatar Apr 23 '16 17:04 winstliu

On Windows, if installed correct, Atom's CLI atom should be located in C:\Users\<user>\AppData\Local\atom\bin.

You should see it somewhere in echo %PATH output.

ghost avatar May 09 '16 08:05 ghost

@fibric Thx a lot

hypogaea avatar May 09 '16 09:05 hypogaea

@hypogaea Did it not add that folder to your PATH? If it did not could you provide some more information - such as are you on a corporate network that might have applied security policies?

damieng avatar May 29 '16 23:05 damieng

@damieng No, I use it on my own computer at home. And my User Agent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.10 Safari/537.36

hypogaea avatar May 30 '16 10:05 hypogaea

Stumbled across this issue looking for something else. Installed Atom 1.8 from the official installer on Windows 7 (32bit). PATH does contain C:\Users<user>\AppData\Local\atom\bin, however that directory does not exist. Here is the contents of AppData\Local\atom:

Directory of C:\Users\<user>\AppData\Local\atom

06/08/2016  10:48 AM    <DIR>          .
06/08/2016  10:48 AM    <DIR>          ..
06/08/2016  10:45 AM    <DIR>          app-1.8.0
06/08/2016  10:48 AM           186,361 app.ico
06/08/2016  10:45 AM    <DIR>          packages
06/08/2016  11:05 AM             8,754 SquirrelSetup.log
06/06/2016  02:52 PM         1,526,024 Update.exe
               3 File(s)      1,721,139 bytes
               4 Dir(s)  215,244,148,736 bytes free

I'm going to try to uninstall all trace of Atom and reinstall, but I wanted to update this issue with what I'm seeing currently.

bloodstrike avatar Jun 08 '16 15:06 bloodstrike

We've seen reports of this a few times but haven't yet determined why it happens. I think we need to put more logging in. It's being tracked over at https://github.com/atom/atom/issues/11450

damieng avatar Jun 08 '16 16:06 damieng

I'm having the same problem in windows, but the file is not in any of the directories you have listed.

alimary avatar Jun 08 '16 23:06 alimary

@alimary i just had this same issue. The link given by @damieng has a solution you may want to try.

C:\Users_username_\AppData\Local\atom\app-1.8.0\resources\cli

sayhelloelijah avatar Jun 11 '16 20:06 sayhelloelijah

I have installed atom 1.10 on 5 or so computers over the last couple weeks and ran into this problem on a couple of them. On Windows 7 and above, add the %LOCALAPPDATA%\Atom\bin to your user PATH variable. You test it out from the command line by running the following command: SET PATH=%PATH%;%LOCALAPPDATA%\Atom\bin Then you should be able to run Atom directly from the command line.

If you want to make it permanent, you will need to change the PATH variable in the system settings.

stretchtiberius avatar Sep 07 '16 14:09 stretchtiberius

@stretchtiberius are you using the atomsetup.exe installer or the windows zip package?

If using the installer can you try removing the path you added on one then doing this;

cd %localappdata%
cd atom
cd app-1.10.0 (or whatever version)
atom.exe --squirrel-install

and let me know if it reports any kind of error. It seems for some people it is unable to add to the PATH but we're not sure why.

damieng avatar Sep 07 '16 16:09 damieng

Yes, I was using AtomSetup.exe. Unfortunately, I was setting up Atom on some friends' PCs. Next time I have access to a computer where the AtomSetup.exe failed to modify the path, I'll report back to you. Atom was automatically added to the path on my machine.

stretchtiberius avatar Sep 08 '16 18:09 stretchtiberius

@damieng, I ran the commands you requested on a Windows 7 machine that did not get atom added to the path during the initial install of AtomSetup.exe. There was no output when I ran atom.exe --squirrel-install and atom was then properly added to the PATH.

stretchtiberius avatar Sep 13 '16 15:09 stretchtiberius

Thanks for that @stretchtiberius I think then it confirms that part is working. I suspect there is a sequence/scenario where atom.exe isn't run with --squirrel-install

damieng avatar Sep 13 '16 16:09 damieng

It isn't working for me. Windows 10. In the Squirrel log file I see the following:

2016-12-21 16:17:55> Program: Fetching update information, downloading from https://atom.io/api/updates?version=1.12.7 2016-12-21 16:17:55> SingleGlobalInstance: Failed to grab lockfile, will retry: C:\Users\joe\AppData\Local\Temp.squirrel-lock-1D277DA284EB3AACB10CCF052286D2DCC6EC9B7D: System.IO.IOException: The process cannot access the file 'C:\Users\joe\AppData\Local\Temp.squirrel-lock-1D277DA284EB3AACB10CCF052286D2DCC6EC9B7D' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Squirrel.SingleGlobalInstance..ctor(String key, TimeSpan timeOut) 2016-12-21 16:17:55> CheckForUpdateImpl: Generated new staging user ID: 0a4ed32b-5285-51e1-ab7c-69f818906d02 2

A slightly different error happened when I installed 0.11 first and then upgraded to 0.12 - it was running 12, but the 11 folders were still there and the command line stuff still didn't get set.

I'm wondering if a windows 10 security thing? should i uninstall and install as administrator?

acroyear avatar Dec 21 '16 21:12 acroyear

Hi @acroyear can you create a new issue for your problem over at atom/atom - it's not really related to this issue (which I'm going to lock as there is never a need to "Install Shell Commands" for Atom on Windows and it's pinging 9+ people from this thread).

As a quick heads-up I'd suggest taking a look at any 3rd-party (non-Microsoft) security/AV solutions as they can interfere with moving our binary files during installation. Failing that you can just grab the atom-windows.zip from releases, unpack it where you want and just add the resources\cli folder to your PATH.

damieng avatar Dec 21 '16 21:12 damieng