afrog icon indicating copy to clipboard operation
afrog copied to clipboard

Atom\logs doesn’t follow portable installation in Windows

Open lab2k1 opened this issue 5 years ago • 2 comments

Prerequisites

  • [x] Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem in Safe Mode
    • Followed all applicable steps in the debugging guide
    • Checked the FAQs on the message board for common solutions
    • Checked that your issue isn't already filed
    • Checked that there is not already an Atom package that provides the described functionality

Description

A fully portable installation of Atom still writes to %appdata%.

Steps to Reproduce

  1. Follow the directions here to set up Atom in Windows in fully portable mode, including the .atom\electronUserData directory.

  2. Run Atom, then just close it.

Expected behavior:

The portable installation is not expected to write outside its root directory.

Actual behavior:

The Atom\logs directory gets (re)created under %appdata% (usually %userprofile%\appdata\roaming), instead of going under .atom\electronUserData.

Reproduces how often:

Every time.

Versions

Atom : 1.41.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0 OS: Windows 7.sp1 x64

lab2k1 avatar Dec 14 '19 06:12 lab2k1

I can confirm this, and the same thing happens when using the ATOM_HOME environment variable.

I'd like to take the opportunity to ask if it can be made possible to move the ".atom" directory INTO the Atom-executable's directory instead of one level higher. It's so weird.

At least make the instructions clear on where to create the directory exactly (and that ATOM_HOME does not create an ".atom" subdirectory). That way, people can follow the flight manual instead of the thread the original poster referred to (which I also ended up on when it didn't work).

I'm on Win10 with version 1.45 if it matters.

PowerCoder avatar Apr 15 '20 11:04 PowerCoder

How to create a portable version of the Atom Editor in Windows:

It does not automatically update.

I tried using environment variables and .cmd a file to launch Atom, but the result is not a portable installation or some setting don't work, for example some menu actions don't work.


*a) This version, using a .cmd file, doesn't open config.cson from the File Menu: File > Config... , or Keymap, Init, Snippets, Stylesheets - keymap.cson, init.coffee, snippets.cson , styles.less. It opens an empty file instead.

Download and extract atom-x64-windows.zip. Put

Create AtomPortable.cmd and put it in the folder with atom.exe

@echo off set ATOM_HOME=Data.atom start atom.exe --user-data-dir="%~dp0Data\cache" %* exit

*b) or the next version that works better:


Steps:

Download the latest stable Atom Editor from https://github.com/atom/atom/releases - the zip version

https://github.com/atom/atom/releases/download/v1.60.0/atom-x64-windows.zip

Download AtomPortable_1.38.2 - and use its folder structure and some files as a template to make the latest Atom Editor portable https://www.softpedia.com/get/Office-tools/Text-editors/Atom-Portable.shtml

AtomPortable_1.38.2.zip

You can use Sandboxie to install The Atom software and prevent making changes to your default folder structure.

Create an "Atom Install" folder with the subfolders: "Portable" and "Latest", e.g. "E:\Atom Install"

Put AtomPortable_1.38.2.zip inside "E:\Atom Install\Portable" and extract it. You will have the folder "E:\Atom Install\Portable\AtomPortable_1.38.2".

Put atom-x64-windows.zip inside "E:\Atom Install\Latest" and extract it. You will have the folder "E:\Atom Install\Latest\atom-x64-windows"

Delete all the useless files and folders from "E:\Atom Install\Portable\AtomPortable_1.38.2"

  1. Delete the CONTENTS of "E:\Atom Install\Portable\AtomPortable_1.38.2\App\Atom"

  2. Delete the Folder E:\Atom Install\Portable\AtomPortable_1.38.2\App\app

  3. Copy the Contents of "E:\Atom Install\Latest\atom-x64-windows\Atom x64" to "E:\Atom Install\Portable\AtomPortable_1.38.2\App\Atom"

You can rename the folder "AtomPortable_1.38.2", inside "E:\Atom Install\Portable" and move somewhere else.

After running "E:\Atom Install\Portable\AtomPortable_1.38.2\AtomPortable.exe" the folders that are usually created inside the AppData folder will be created inside the folder "E:\ATOM TEST\Atom Portable\Data"

e.g.: "E:\ATOM TEST\Atom Portable\Data\atom" - will be the equivalent of the .atom folder from AppData.

  "E:\ATOM TEST\Atom Portable\Data\cache" - will contains cache files and folders and other Preferences

  "E:\ATOM TEST\Atom Portable\Data\settings" - will contain AtomPortableSettings.ini

After running the portable version of Atom, a blank folder named "Dictionaries" will be created inside the user's folder "...\AppData\Roaming\Atom". e.g.: "...\AppData\Roaming\Atom\Dictionaries"

Make sure the firewall allows atom to connect to the internet. You can install packages from the internet and the packages will install dependencies, too.


AtomPortable.ini has the settings to make Atom portable "E:\Atom Install\Portable\AtomPortable_1.38.2\App\AppInfo\Launcher\AtomPortable.ini" - contents:

[Launch] ProgramExecutable=Atom\atom.exe CommandLineArguments='--user-data-dir "%PAL:DataDir%\cache"' DirectoryMoveOK=yes DisableSplashScreen=true SplashTime=0 SupportsUNC=yes MinOS=7

[Environment] ATOM_HOME=%PAL:DataDir%\atom

[DirectoriesCleanupIfEmpty] 1=%USERPROFILE%.atom 2=%APPDATA%\Atom


Updating:

Updating the regular Setup.exe installation works. Updating the Portable Atom installation - does not work:

Cannot update the portable version: Tried on Atom 1.57.0 x64 Portable:

Atom menu - choose Help > About Atom - says: "Your system does not support automatic updates"

Clicking on "How to update" It opens a page to https://flight-manual.atom.io/getting-started/sections/installing-atom/ that mentions: "Portable mode installations will not automatically update"

"Atom can also store its Electron user data in your .atom directory - just create a subdirectory called electronUserData inside .atom"


Updating the Atom installation using the Setup .exe :

Atom 1.57 - AtomSetup-x64.exe - It installs without prompting you, to user's folder ...\AppData\Local\atom

Atom menu - choose Help > About Atom - and check for updates:

Sometimes I got No update available. Version 1.57.0 is the latest version.

,but very fast I was able to upgrade automatically Downloading update -- spinning wheel - it updates to 1.60 (the latest vers. right now) after a restart.

backforeground avatar Jun 21 '22 18:06 backforeground