Zim

Portable version (Windows) writes stuff in $appdata

Bug #1563632 reported by Brendan Kidwell
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zim
Confirmed
Undecided
Brendan Kidwell

Bug Description

Quick and dirty description. I will clean this up later.

A user reported in the chat room that the portable Zim Desktop Wiki for Windows (0.65) writes and reads settings in $APPDATA, including:

C:\Users\NAME\AppData\Roaming\zim\data\applications\defaults.list
C:\Users\NAME\AppData\Roaming\zim\data\applications\MYTEXTEDITOR.desktop
C:\Users\NAME\AppData\Roaming\zim\data\applications\mimeinfo.cache

Also end-user-installed plugins are searched for somewhere under $APPDATA which is not proper for a portable app.

To reproduce, delete $APPDATA/zim and run the portable Zim app. Edit settings, change the default text editor, etc. The folder will have reappeared.

To fix: we need to redefine at the shell level (in ZimDesktopWikiPortable.exe the launcher) environment variables that lead to this situation. If we have to actually redefine $APPDATA we probably can, but it's probably more correct to look at all the XDG_* variables first.

Changed in zim:
assignee: nobody → Brendan Kidwell (bkidwell)
status: New → Incomplete
description: updated
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Relevant code is in zim/config/basedirs.py line 48 - 76

There are 3 XDG parameters that are using the APPDATA folder as a default: XDG_DATA_HOME, XDG_CONFIG_HOME and XDG_CACHE_HOME.

The files mentioned in the description above would be looked up relative to XDG_DATA_HOME.

To complete the list, the remaining paramaters XDG_DATA_DIRS and XDG_CONFIG_DIRS are only used for reading. They fall back to other known default locations.

-- Jaap

Revision history for this message
Ambrose (mambrose-e) wrote :

PLEASE ESCALATE: I would like to add a little something about the "Importance" of this issue. I just started using the portable version of Zim (v0.62 packaged by PortableApps.com) for tracking my college class work and notes. I work with it on my desktop and then clone it to my USB key for use at the college. Because of this bug, changes that I make to settings do not copy over to the USB key making this not a truly portable application. I work with the USB copy of the wiki on the school computers and everything works okay UNLESS I try to change any settings. Changing settings in Zim at school causes an error because campus IT security blocks "unauthorized applications" from writing data to the %APPDATA% folder. I am not sure yet but I think this also affects installing/using some plugins which also would want to read/write files in the %APPDATA% folder.

Revision history for this message
Ambrose (mambrose-e) wrote :

Correction: I am using v0.62 but it is not packaged by PortableApps, it is the package file from glump.net (http://www.glump.net/files/release/zim-windows//ZimDesktopWikiPortable_0.62.paf.exe). I have it "launched" by my PortableApps launcher which is what caused the confusion. It looks like there is a newer version (0.65) which I am going to download and see if that changes anything regarding this issue but since this bug is still open I am guessing it wont.

Revision history for this message
Ambrose (mambrose-e) wrote :

A nice helpful person over at PortableApps provided a solution that should be trivial (see Step 2 below) to implement into the codebase. It definitely solves the problem for ZimWiki application and it might solve the problem for any reasonably well-behaved (i.e. *NOT* hard-coded) plugins.

NOTE: If I knew how to read Python code better (total Py novice) I might be willing to try and figure out where this particular INI file is built.

The solution is as follows:

0. Close and EXIT ZimWiki.

1. Find the ZimDesktopWikiPortable.INI file. Mine was located at
 - F:\PortableApps\ZimDesktopWikiPortable\App\AppInfo\Launcher\ZimDesktopWikiPortable.INI

2. Make sure the [Environment] section has at least the following 4 lines at the top:
<code>
[Environment]
HOME=%PAL:DataDir%
XDG_DATA_HOME=%PAL:DataDir%\Data
XDG_CACHE_HOME=%PAL:DataDir%\Cache
XDG_CONFIG_HOME=%PAL:DataDir%\Config
</code>

3. If you have any setting or plugins in the old %APPDATA% pathway you will need to bring them over manually to the new path or just reinstall/adjust them from scratch.

4. Start up ZimWiki and you should be good to go.

----

SOURCE: http://portableapps.com/comment/229303#comment-229303

Revision history for this message
Ambrose (mambrose-e) wrote :

Please ignore the <code></code> tags above, I thought this forum used markdown with limited HTML.

Revision history for this message
Brendan Kidwell (bkidwell) wrote :

AMBROSE, thank you for posting the workaround.

I will be sure to include the requested modification in the next portable package of Zim for Windows, soon after the next upstream release occurs.

Changed in zim:
status: Incomplete → Confirmed
Revision history for this message
Ambrose (mambrose-e) wrote :

BRENDAN, Cool! Please give credit to mwayne (http://portableapps.com/user/193818) since it was his idea.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.