Menu

#1982 Important data in "%LOCALAPPDATA%" not "%APPDATA%" (roaming) + Possible PORTABLE bug

KeePass_2.x
closed
nobody
Bug (2) data (2)
5
2020-08-10
2020-07-24
dbareis
No

Keepass v2 (maybe v1 also) stores important files in the incorrect location. The correct location is "Roaming" (%appdata%) but its placed in local "%LOCALAPPDATA%".

I am using the portable version and as far as I can see there is no "INI" or "XML" config I can update to change the directory location. I'd expect the directory to be within the portable directory. So maybe 2 bugs here?

Unless the user is very careful they could lose this data as you don't expect to need to back it up, and of coarse it won't work in a actual roaming (or in my case portable) environment.

I am using "KeepassSequencer - xkcd Password Generator" and it needs data at "C:\Users\xxxx\appData*Local*\KeePass-Word-Sequencer"

Discussion

  • dbareis

    dbareis - 2020-07-25

    It appears that it is possible for the plugin to be made portable but I can't work out how.
    https://github.com/fireout/keepasssequencer/issues/60

    I think the fact that a "DATA" directory is not defined in keepass settings (and available to plugins) is an oversight that should be corrected. All paths by plugins would then be portable by default. Plugins should also know (be able to tell) if they are running in a portable install.

     

    Last edit: dbareis 2020-07-25
  • wellread1

    wellread1 - 2020-07-25

    None of the issues you raise are KeePass bugs.

    KeePass already supports saving plugin data in the KeePass config file (keepass.config.xml). Plugin developers should be familiar with this capability. Plugin developers can also contact the KeePass developer if they need help.

    Keepass v2 (maybe v1 also) stores important files ...in local "%LOCALAPPDATA%".

    You are mistaken. %LOCALAPPDATA% is not a default location for any KeePass files such as program files, plugins, configuration files, and/or password databases.

    I am using the portable version and as far as I can see there is no "INI" or "XML" config I can update to change the directory location. I'd expect the directory to be within the portable directory. So maybe 2 bugs here?

    The default location for the KeePass config file (keepass.config.xml) in a portable KeePass installation is the KeePass application folder. The user must have write permissions for this folder so that KeePass can write the config file.

    If KeePass cannot write the keepass.config.xml file to the application folder the user must create it and set the item <PreferUserConfiguration> to TRUE. The following stub file, saved in the KeePass app folder, will cause KeePass to create and use a user config file in %APPDATA%\KeePass.

    keepass.config.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <Configuration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Meta>
            <PreferUserConfiguration>true</PreferUserConfiguration>
        </Meta>
    </Configuration>
    
     

    Last edit: wellread1 2020-07-25
  • wellread1

    wellread1 - 2020-07-25

    See https://keepass.info/help/base/configuration.html for details about KeePass configuration files.

     
  • Paul

    Paul - 2020-07-25

    Where did you get the portable KeePass package? The one from PortableApps is not recommended as KeePass is portable without packaging.

    cheers, Paul

     
  • dbareis

    dbareis - 2020-07-25

    OK, it sounds like you are saying that the plugin should be able to know it's portable and not save to "local" or any other directory outside of the tree that begins with the folder containing "keepass.exe". That makes it a plugin bug. I don't know why there wouldn't be an API to request the name of the "keypass" data directory, but whatever.

    I'm using the ".zip" from the official keepass page.

     

    Last edit: dbareis 2020-07-25
    • Paul

      Paul - 2020-07-25

      The plug-in should use the KeePass config file, then location is not an issue.

      cheers, Paul

       
  • dbareis

    dbareis - 2020-07-25

    P.S. The email I got point to the wrong issue, a request not bug with the same number, that is:
    https://sourceforge.net/p/keepass/feature-requests/1982/

     
    • Paul

      Paul - 2020-07-25

      SourceForge does that. Scroll down in the email for the correct link.

      cheers, Paul

       
      👍
      1

      Last edit: Paul 2020-07-25
      • dbareis

        dbareis - 2020-07-25
         
  • dbareis

    dbareis - 2020-07-25

    OK, I'll tell the plugin author, thanks

     
  • wellread1

    wellread1 - 2020-07-25

    I don't know why there wouldn't be an API to request the name of the "keypass" data directory, but whatever.

    A plugin developer can surely determine the KeePass application directory. Even users can specifiy the KeePass application directory using a relative path, or by using the KeePass {APPDIR} placeholder.

     
    😕
    1
    • dbareis

      dbareis - 2020-07-25

      They can if they know. I'll try that now...
      https://keepass.info/help/base/placeholders.html

      Nope doesn't work, created: C:\Users\Dennis\AppData\Local*{APPDIR}*[DATA]\plugin

       
  • wellread1

    wellread1 - 2020-07-26

    You are correct, the {APPDIR} placeholder returns the PATH to the KeePass application folder not the path to the ApplicationData folder. However it may still be possible for a plugin developer to obtain the path to the ApplicationData folder. See this post https://sourceforge.net/p/keepass/discussion/329221/thread/eaf8b22b96/#765f.

     

    Last edit: wellread1 2020-07-26
    • dbareis

      dbareis - 2020-07-26

      Actually if you look closer I used what was recommended above "{APPDIR}", it didn't work as a placeholder at all, its literal text was used.

      You are thinking of "%APPDATA%" (the linked post) which points to the roaming directory.

      In any case my point is that I (as a user) should not have to know any of this and the I should not need to know that "{APPDIR}" was an option (but mostly/only in a portable setup).

      The lack of a "{DATADIR}" is an deficiency similar to the others I mentioned above.
      In Windows (non-portable = installer) the correct place for this to point to is something like "%APPDATA%\Keepass" and the correct location for portable should be something like "{APPDIR}[DATA]".

       

      Last edit: dbareis 2020-07-26
  • wellread1

    wellread1 - 2020-07-26

    {APPDIR} is a KeePass placeholder that returns the PATH to the KeePass installation directory. It is not an environment variable. The {APPDIR} placeholder is documented at https://keepass.info/help/base/placeholders.html#envctx

    I don't know why the plugin developer of KeepassSequencer chose to store a configuration file in the %LOCALAPPDATA% directory structure. However, this is not a KeePass issue.

    The KeePassSequencer documentation describes a way to change the location of its config file using either an absolute path, or a path relative to the KeePass application directory. You should be able to use this capability to place the KeePassSequencer config file at the location you prefer.

    It might be nice if KeePass implemented a placeholder, e.g. {KP_APPDATA_DIR}, that returns the directory containing the active config file. In the meantime, the location of the KeePass "DATADIR", i.e. directory where the active keepass.config.xml is stored, is documented at https://keepass.info/help/base/configuration.html.

     

    Last edit: wellread1 2020-07-26
  • dbareis

    dbareis - 2020-07-26

    I suspect its you who are confused about envvars vs place holders or you supplied the wrong link earlier because it was for envvars. In any case it's not a config file but data that is stored in the local directory and although the config and instructions imply you can change it (other than what I've put into the plugin bug report) you can't (or if you can the mechanism is not typical or obvious).

    Also, I can't be the only one who doesn't like all sorts of garbage sprinked in together, and that goes for my C:\ root as well as app directories. Data should be clearly separated from code.

    Anyway I've said my bit. You can close this if you want.

     
  • Dominik Reichl

    Dominik Reichl - 2020-07-26
    • status: open --> closed
     
  • dbareis

    dbareis - 2020-08-10

    PLEASE IGNORE
    Test comment for :[site-support:#21051] Update emails contains both correct and incorrect links to the Bug Report

     

Log in to post a comment.