Patch: environment variable override for prefs directory for PortableApps.com edition

Bug #382394 reported by Chris Morgan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Jon A. Cruz

Bug Description

I'm the developer of Inkscape Portable at PortableApps.com (see http://portableapps.com/node/17707 at the moment), and as Inkscape uses the wx StandardPaths thing, on Windows that's APPDATA, but it uses the complex technique, making redirecting difficult. Moreover, there are issues with redirecting USERPROFILE and APPDATA, which is what it currently does. From examining the source code, and knowing the DLL call's behaviour it seems like I should be able to invalidate APPDATA and then make it use HOME, but in my testing this doesn't work properly.

I'd like it if a command-line argument or something could get put in for Inkscape 0.47 so that we can override the settings location, and thus improve the Inkscape Portable experience. In the mean time, I think I'll be needing to switch to moving back and forth, which is suboptimal.

Thanks in advance for helping us to help both of us! ;-)

Tags: packaging
Revision history for this message
Chris Morgan (chris.morgan) wrote :

I've looked into it more thoroughly, and I'd like to offer a patch:

In inkscape.cpp:

1380 gchar *
1381 profile_path(const char *filename)
1382 {
1383 static const gchar *prefdir = NULL;
1384 if (!prefdir) {

In between lines 1383 and 1384, insert two more lines:

if (!prefdir)
 prefdir = g_strdup(g_getenv("INKSCAPE_PORTABLE_PROFILE_DIR"));

I believe that this should work fine. That way if the environment variable INKSCAPE_PORTABLE_PROFILE_DIR was set, it'd use that (note that it won't stick "Inkscape" onto the end of it - intentional)

Sorry I can't format it as a proper patch, I don't have the tools to do that at the moment.

tags: added: patch
summary: - Request: some way to change settings location for PortableApps.com
- edition
+ Patch: environment variable override for prefs directory for
+ PortableApps.com edition
Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

There is also a wishlist bug for a portable apps version.
https://bugs.launchpad.net/inkscape/+bug/220436

Changed in inkscape:
assignee: nobody → Jon A. Cruz (jon-joncruz)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

Revised patch applied as of SVN revision #21480

Changed in inkscape:
status: Confirmed → In Progress
status: In Progress → Fix Released
Revision history for this message
Chris Morgan (chris.morgan) wrote :

Thanks Jon! That'll make Inkscape Portable 0.47 work much more easily and much better :-)

I was aware of the wishlist one, I found it before creating my issue. However, that's what I'd already done, it was just suboptimal. Now that you've done that, it'll perfect :D

Thanks in especial for squeezing it in before 0.47 was release!

su_v (suv-lp)
tags: added: packaging
removed: patch portable request
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.