Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Atom will not launch from a USB flash drive when setting ATOM_HOME #6452

Closed
James-Parsons opened this issue Apr 21, 2015 · 11 comments
Closed
Labels
bug windows Issues that occur on Windows but not on other platforms.

Comments

@James-Parsons
Copy link

Most of the details can be found at this post:
https://discuss.atom.io/t/starting-atom-via-command-line-does-not-launch-it-correctly/16279/2

I recently tried to run atom portable. I would like to keep all my themes and packages on the drive as well, so I created a .atom folder on my flash drive using md .atom. After that, I extracted the latest zip distribution of Atom into an Atom folder on my flash drive. To set ATOM_HOME and launch atom, I used the following script:

@echo off
set ATOM_HOME= "E:/.atom"
start E:/Atom/atom.exe --safe
echo ATOM_HOME currently at %ATOM_HOME%
echo.
pause

When trying to run this script, I got

[4924:0421/080402:INFO:CONSOLE(67)] "RangeError: Maximum call stack size exceeded

The rest of the stack trace can be found at the above link. Oddly, after I REMed out the set ATOM_HOME= "E:/.atom", atom launched fine from the flash drive. Is there anyway this can be fixed?

@lee-dohm
Copy link
Contributor

What was your current working directory when you ran this script and you got the error?

@lee-dohm lee-dohm added the bug label Apr 21, 2015
@James-Parsons
Copy link
Author

Should be E:/Atom

@ghost
Copy link

ghost commented Apr 23, 2015

You are setting the environment variable wrong. When you surround the path name with " windows will interpret that as being part of the name. So essentially you set the path to:

" "E:/.atom""

Try using this instead:

@echo off
set ATOM_HOME=E:/.atom
start "Dummy Title" "E:/Atom/atom.exe" --safe

I have to say that the error message from mkdirp is really bad though.

Btw you can use %~dp0 to get the current working directory, might be useful if you are running from a usb drive where the drive letter might change. Example:

set ATOM_HOME=%~dp0atom-home
start "" "%~dp0atom\atom.exe"

@darkmorpher
Copy link

CC @damieng to close 🍡

@damieng
Copy link
Contributor

damieng commented May 5, 2016

Additionally it should be e:\.atom - paths are backslashes on Windows not forward-slashes. Some things work with them as forward-slashes but a whole bunch of other things get confused.

Please re-open if this is still a problem with Atom 1.7 or later.

@damieng damieng closed this as completed May 5, 2016
@damieng damieng added the windows Issues that occur on Windows but not on other platforms. label May 5, 2016
@namelus
Copy link

namelus commented Jun 23, 2016

@damieng - I don't think you can set environment variables in Windows 7 if you aren't the admin. Can we look for a portable solution that is self-contained on the USB that would work for both admin and non-admin Windows 7 users?

@damieng
Copy link
Contributor

damieng commented Jun 23, 2016

The SET command does not require admin privileges as it is not permanent - it just applies to the current command Window. It therefore works for both admin and non-admin.

@namelus
Copy link

namelus commented Jun 23, 2016

Thanks for the quick response.

According to my research you get prompted for the Admin credentials. See
here:
http://superuser.com/questions/165909/how-can-i-set-user-environmental-variables-such-as-path-from-a-non-administrat

I could be wrong / misunderstanding...

On Jun 23, 2016 2:11 PM, "Damien Guard" notifications@github.com wrote:

The SET command does not require admin privileges as it is not permanent -
it just applies to the current command Window. It therefore works for both
admin and non-admin.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#6452 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AKsc2OgkR7bpeEkrzsg-sbQ1zEYaXgf6ks5qOsxXgaJpZM4EFOOD
.

@damieng
Copy link
Contributor

damieng commented Jun 23, 2016

That is talking about using the UI to set a permanent environment variable. That would require admin permissions if setting machine-wide or may require admin permissions for user-wide if your group policy has been set for that. It would also not make sense in the context of a portable solution.

This solution is talking about the SET command which is a temporary non-administrator for-this-command-windows-life-only duration as part of a batch file to launch Atom with the nested configuration.

@namelus
Copy link

namelus commented Jun 23, 2016

Ok, great news! I'll give it a go once I am in at a PC where I am a non-admin.

I'm also curious about getting a package such as Atom-Runner working in a portable setting. Any tips on that?

@lock
Copy link

lock bot commented Apr 6, 2018

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked and limited conversation to collaborators Apr 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug windows Issues that occur on Windows but not on other platforms.
Projects
None yet
Development

No branches or pull requests

5 participants