Repository navigation
Enable Portable Mode - #8442
Enable Portable Mode#8442
Conversation
|
Looks promising 🎱 |
There was a problem hiding this comment.
Should this comparison include a trailing slash on USERPROFILE?
Currently this check will pass for the following process.execPath/USERPROFILE right?
process.execPath = C:\Users\KevinSawicki\atom\atom.exe
USERPROFILE = C:\Users\Kevin
There was a problem hiding this comment.
This is a typo that I fixed but didn't push apparently, this should be LOCALAPPDATA, which makes way more sense :)
|
So the idea here is that is they install to |
Nevermind, it is the other way around right? Not in |
Peep the line comment above, things will make way more sense then |
|
Something I thought of because someone was asking about installing to the |
|
@lee-dohm Correct, but because this person probably (maybe?) already has an existing |
|
I don't think this will satisfy those people who keep waiting for a portable version. This conditional checking of already installed versions and preferring the "remote" .atom folder over its own... it just brings us back to the same situation that exists currently. What people keep asking for is a separate version of Atom. One that, as described, doesn't need to be installed (it's supposed to be already runnable from the folder people unzipped), and which doesn't care about where it runs from or whether there are other versions installed elsewhere on the system. I don't need a portable version myself, but just wanted to point that out. |
|
@batjko This might be true, but then that gets us into creating separate builds for Portable Windows which sucks. I can add a check for an .alwaysPortable dot-file that makes us always ignore ~/.atom |
True, unless the portable version is cross-platform, but it would still need to be maintained separately.
That sounds like a pretty nifty way to do it. Generally, if an |
This PR sets the default ATOM_HOME to be relative to atom.exe, if the following cases are true: 1. We're not in DevMode 1. We're on Windows 1. The EXE path is not in the normal installed location This allows users to take the entire Atom folder and use it as a "Portable" application (i.e. portableapps.com)
d16f820 to
4a53619
Compare
Let's punt on this for now and see if people ask for it |
|
@kevinsawicki Plz to review! |
There was a problem hiding this comment.
I don't think you need the process and check here, since the line before already calls process.platform without checking process.
There was a problem hiding this comment.
This is copy-pasta from the apm version, will fix
There was a problem hiding this comment.
What is the use of checking process.type here?
I am newbie :P
There was a problem hiding this comment.
@PikachuEXE No use in this case, copy pasta from apm
|
Will this work if they have installed Atom directly to Program Files via downloading |
There was a problem hiding this comment.
Could you add a comment above this line that just adds some example paths and says which ones are considered portable and which ones are not?
No, because we'll try to write to |
Conflicts: src/browser/main.coffee
According to these specifications: Portable mode only applies to Windows (for now) Portable mode only applies if ATOM_HOME is not set If there is a .atom directory as sibling to directory with running process use that as ATOM_HOME
always set at the process level, so always set here
There was a problem hiding this comment.
Is this line needed? The return value doesn't appear to be used
|
WTF is this still using coffeescript ?? |
|
You do not need to specify atom_home at all. Details on portable mode are in the flight manual. The stuff stored in app data are caches and temp files. It's quite common for portable apps to continue to use temp files in this way. Let us know if you find it storing something else there you think should really be on the portable drive. |
|
@damieng Thank you for clarifying, but a "portable" software should not leave traces on a computer, see the portable application guidelines followed by Portable Apps. Ensuring that no files are stored in a folder like the APPDATA, enables someone to run multiple versions of Atom, with different packages and different styling set ups. Thus, if they want to use Atom for Go, they can set it up with the best syntax theme for go, and the best linters, packages, and config, but still be able to use another installation of Atom for lightweight text editing. |
|
Nothing Atom's mode does today precludes you from running any of your scenarios. The files in AppData today are temp/cache files. You can do everything you just said. All the important configurations, packaging and styling are stored on the portable drive. PortableApp's definition doesn't say you can't use AppData for cache/temp (storing those files on a USB stick would be awful for performance) just that it shouldn't leave a trace. The solution here might be to just aggressively clean up the cache/temp files when running in portable mode. |
That's not what Portable means. Portable means it would store If you try to move your Atom folder, you have to move That's like having to hold a suitcase but you also have to hold another one because they love each other and can't do without the other. So wearing a backpack instead (Portable mode) is much better (Atom configuration folder inside Atom program folder) and less burden on Portable people. What happens if I put all Atom files in root Using a file |
|
Because of the way the auto-updater works it can't store .atom inside Atom as the Atom folder gets replaced with the new version.
Portable means just that, portable between machines. There isn't a specific definition that states config has to be stored directly in the folder or that the app can't use temporary storage on the machine. |
|
I'm getting errors when uninstalling packages as they get removed from the filesystem but doesn't get removed from Atom itself.
Console log: |
|
I appreciate all the hard work going into this, but wouldn't it be easier not to re-invent the (portable) wheel? Why not just implement according to the de facto portable standard set by PortableApps.com? |
|
This is not a case of reinventing a definition to be different but rather working with some hard limitations. If the config file is inside the app folder it will get blown away during update. If you wanted to not use the auto update you could easily create a cmd file to launch atom with the config file inside the folder. This would live inside the Atom folder perhaps named atomp.cmd and the contents would be: (The way SET works would not SET anything on this machine it is for the duration of this process only) |
|
And there is a On Fri, 15 Apr 2016, 9:14 AM Damien Guard [email protected] wrote:
|
|
This works for me: No need to change the folder structure. I put my custom startup here: Also, I tested multiple installs - ssd portable install copied to an IMDisk ramdrive. Both open about the same with a minimum install (3300 files) and work fine individually. But when one is open already, the second uses the first ones profile. This may be expected behavior, I don't need to run more than one at at time, just want to point this out in case it's unexpected. After exiting both and running one at a time, they have their own profiles intact. |
|
Someone asked about documentation on this matter a while ago. May I mention PortableApps? They have been doing this for years. |
|
If you want you can also do this. Install Google Drive if you dont have it please note the usernames and also make sure your google drive has the folders already made Programs mklink /D "C:\Users\USERNAME HERE.atom" "C:\Users\USERNAME HERE\Google Drive\Programs\Atom" Once these links have been created you can now install atom. If you wish to use atom on another pc just make a batch file with the above symlinks or copy paste them into the new pc and your done as long as you have drive installed (This can be on usb but why bother) |
|
Really curious where this is at. I would also like portable capability. I really don't care if I have to put the Atom files folder inside a AtomPortable folder and have the .atom folder next to it. That is how PortableApps are usually setup. But it would be good to have the ability to set each kind of folder (profile/cache/temp) from the command line, so that people running off a thumb drive can use the standard temp folder, and people running off a more durable storage drive would be able put the other stuff on as well.
Why can't we implement ALL of the options that have been proposed? I'm sure some of them have problems related to specific implementations. I also like the idea of checking for a file or checking in the parent directory. The point is that there are several different use cases here, and I think we can satisfy all of them. We don't need to make this simple and easy, rather we should make it granular and versatile. And well documented, of course. |
|
Actually, just comprehended that this got merged. Thanks for making a way. My suggestion still stands, but one way is better than no way :) |
|
I dug into the PortableApps spec a little bit and found out that they have a really nice template for people wishing to make their own. Unzip the attached file, and then unzip the contents of the latest Atom zip release for windows into the new "AtomPortable/App/Atom" directory. The launcher in the root of the zip will launch "AtomPortable/App/Atom/atom.exe". Also, here is a pre-packaged version of the 1.15 release. Haven't tested this method heavily, but so far it seems to provide satisfactory results. Edited to remove unofficial Atom distribution |
|
@TeejMonster I applaud the effort and work you put into this. However, we aren't going to allow a link to an unofficial distribution of Atom here. If you want to create a repository that helps people replicate your process and link to that here, I think that would be great. Let me know if you need any help getting that going and I'd be happy to assist. |
|
I understand removing the paf file as that contained a full distribution of Atom, however, the zip file that I attached included no Atom files whatsoever and was merely a wrapper. Is that an important distinction? |
|
@TeejMonster Ah, I didn't look inside it ... I thought they were different forms of the same thing. In any case, setting up a repo still seems the right thing to do so that people can examine the files before downloading them. |
|
@sergeevabc You can download atom-windows.zip from our releases page and follow the instructions at http://flight-manual.atom.io/getting-started/sections/installing-atom/#portable-mode There is no need to download a 3rd party version of Atom such as those from PortableApps. We do not control what versions they publish nor do we test or support them. Locking this thread to stop 36 people getting notified every time somebody has a question about the portable release. Please raise a new issue rather than comment on a 2 year old PR, thanks! |


This PR sets the default ATOM_HOME to be relative to
atom.exe, if the following cases are true:This allows users to take the entire Atom folder and use it as a "Portable" application (i.e. portableapps.com)
Fixes #2939
TODO:
Add(Gonna see if people want this or not).alwaysportabledirective