Respect ATOM_HOME env var for portability #5385
Conversation
1fbc9ef
to
298aed9
Compare
This could also perhaps be not a "fix" for #2199, but at least allow people who prefer the |
Yeah, I was planning on closing that PR after merging this since it will now be properly configurable |
298aed9
to
4e10ea0
Compare
Respect ATOM_HOME env var for portability
@steelbrain Just tried that, it came up with an error in the console |
I am curious what that error was. |
@steelbrain It went as follows: |
@danwatco Oo Lala, You might want to report it as a bug along with the repro steps. |
@steelbrain I'll open it as a bug! |
Please forgive my pedantry about this, but to me the requirement for an environment variable makes the application non-portable? As was suggested in #2939, if Atom would look in the application directory for an If I make a patch that implements the above approach, what's the chance of it being considered for merging into the repository? Cheers! |
The application directory is completely replaced when Atom auto updates so if Perhaps there is another approach, or maybe this would only be supported for versions of Atom that don't auto update. A PR that improves the portability of Atom would definitely be considered and appreciated though 👍 |
Thanks for the reply, Kevin! OK, so if the application directory is wiped clean before updating Atom, then I guess a command-line option for setting the configuration directory is probably the next best thing. When I have some time I'll investigate how this can be achieved and prepare a PR. |
Sounds great, thanks for taking a look at this. |
I just tried the "portable" Atom on my Windows 8.1 x64 by setting the Files/dirs created in
Files/dirs created in
Is there no way to make it write everything in the |
@iliyang I've just re tried again by setting the atom home, and it works for me! Off a usb stick too! Does the information stored in app data affect your settings in any way? |
@danwatco What do you mean it works? That the settings are properly stored in Can you please check your |
@iliyang Sorry, I was referencing that it worked as I tried before with no luck. Still some errors though with a package I'm trying to install. Yeah it makes the same files that you stated. It's not a problem for me, but I understand what you mean |
Bump. Any hope of Atom only working in |
@yuki-takei Add portable version of Atom · Issue #2939 · atom/atom Windows 8.1 Works neatly. @echo off
pushd %~dp0
if not exist .atom mkdir .atom
if not exist .atom\AppData mkdir .atom\AppData
if not exist .atom\AppData\Roaming mkdir .atom\AppData\Roaming
:: Trick emmet or other plugin to think profile directory is in our data directory
set "USERPROFILE=%~dp0\.atom"
:: Set Atom base directory
set "ATOM_HOME=%~dp0\.atom"
:: Boot
start atom |
@iliyang You're absolutely right, this partial implementation does not count as portable. All temporary files must be written to Atom's folder to be portable. And by definition there can be no modification of the environment, not even via a batch-file unless it's shipped with Atom. In fact, the information that an Atom folder is portable must be entirely contained within that folder. If the updater clobbers the entire Atom folder and doesn't re-save that information, then this is a bug in the updater, by definition. The closure of #2939 is erroneous. |
Quick question, how exactly do you make your install of atom portable? Are there instructions somewhere? |
Sorry to ask this question but... So basically what I am looking for (sorry to be a pain) is a easier to follow step by step guide to making Atom portable (especially how to set the ATOM_HOME var). |
Thank you konfuzius! That seems to work wonderfully. |
Using "atom-windows.zip" extracted in my Downloads folder to "atom-windows" I created the following batch file which may be of use to others.
|
@CraigCarboni Your batch file works perfectly! Thanks! |
This PR unifies all references to use the
ATOM_HOME
environment variable as the location to store packages, compile caches, node headers, etc.The location still defaults to
~/.atom
when unset.This should make Atom portable meaning it will write no files outside this location.
Closes #2939