gotcha

Author Topic: Custom Inkscape user directories?  (Read 4293 times)

October 02, 2017, 05:40:12 PM
Read 4293 times

Ironword

  • Sr. Newbie

  • Offline
  • **

  • 5
Is it possible to change the location of Inkscape user directories, via Windows registry hack if nothing else?

I like to run a very tight system with complete control, and this is made easier if all the resources of a given app are located in its installation directory in subfolders, or if that's a problem because of uninstall routines, in separate folders on the same level as the install dir. Furthermore, I do not want Inkscape's cache on my main installation disk--it's an SSD, and that means a finite number of writes. I've hacked all my Windows temp/cache directories to a separate platter drive, and thankfully Inkscape conformed with that, pointing its Temporary files to my custom directory, but still there's that danged User cache folder which Inkscape insists on placing on my SSD. Furthermore, for ease of management I'd certainly like the user-extensions directory right with Inkscape, not buried in those Windows user directories.

To achieve this, the very first thing I did after installing Inkscape was to open Edit | Preferences | System. I was most gratified to see that the user directories were contained in text fields...until I tried to paste a new path into one of them, of course, and was unable to do so.

Looked through both FAQs and found nothing about customizing user directories.  I'm assuming that this is not possible through the Inkscape UI, but I'm hoping it's possible via registry hack. Can a developer chime in on this?

BTW, please don't rap my knuckles with the standard injunctions to stay away from the registry. I know what I'm doing. I've been hacking windows assiduously since 98, have bonkered my system plenty of times, and have a smoothly oiled set of backup and recovery methods in place, so if it all goes south, no sweat. You are always free to indulge in the usual hand-waving if you so desire, of course, but in this case it's a waste of your time. I just need a straight answer to the question.

  • 0.92
  • Win7 pro

October 03, 2017, 03:02:47 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Yeah, you're definitely going to need to contact a developer.  Mailing lists -- development or user  https://inkscape.org/en/community/mailing-lists/
IRC -- development or user https://inkscape.org/en/community/discussion/

I'd say for the mailing lists, you'll get the answer with either list.  For the IRC, I'd guess that the development channel would be better (although I don't use IRC much, so I'm not sure how many devs participate on the user channel).

If you don't mind explaining something to a non-tech-oriented user, I'm curious what you mean by this:

Furthermore, I do not want Inkscape's cache on my main installation disk--it's an SSD, and that means a finite number of writes.

By "main installation disk" you mean your hard drive?  What do you mean by "finite number of writes"?

It sort of sounds like you don't want anything installed on your hard drive, except for the operating system.  But why? 

And besides that, what are you going to do when MS moves Windows into the cloud?  I've heard that Windows 10 is the last Windows system that will be fully contained on the user's computer.  Future systems will be cloud-based, which means you lose your precious control.  (Don't get me wrong -- that's why I'm leaving Windows -- if I'm paying for a product, I want complete control.....haha, whether I know how to use it or not.)

As I said before, I'm not very technologically aware, but Inkscape has a portable version.  I've always thought that means it works from a USB drive.  Wouldn't that be your best solution?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 03, 2017, 08:48:35 AM
Reply #2

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
> Is it possible to change the location of Inkscape user directories, via Windows registry hack if nothing else?

- Yes, it is. You will need to start Inkscape with the parameter INKSCAPE_PROFILE_DIR="\your\directory" (directory should exist) to achieve this. You might need to write a startup script that you will run then, instead of starting Inkscape via its usual menu entry/desktop icon.

Or another option could be by just using symbolic links - they introduced them with Windows Vista... Much easier than the above option.

October 03, 2017, 07:25:34 PM
Reply #3

Ironword

  • Sr. Newbie

  • Offline
  • **

  • 5
brynn:

Thanks for the links to the lists. Am I to assume from their existence that developers basically don't hang out in these forums? Anyhoo...
Quote (selected)
By "main installation disk" you mean your hard drive?  What do you mean by "finite number of writes"?
For the technical skinny on SSD's see their Wikipedia entry, https://en.wikipedia.org/wiki/Solid-state_drive , but here are the basics you ask about:

I have multiple drives on my system (which I built myself), not just one. Most are the old-style ATA platter hard disks, but my Windows boot drive is a new type called "solid state disk" (SSD), which is not a set of genuine disks that spin around, but rather a solid-state circuit. This new type of drive is much faster than the old disk type, but it does have a few drawbacks. One of the most significant is that it can perform only a limited number of writes before it fails. The old-style ATA disks are not subject to this limitation: as long as the mechanical parts of the drive continue to perform, i.e. the read-write arms and heads and the spinning mechanism don't wear out, your writes are unlimited. But with SSDs, as the Wikipedia page notes, "Each block of a flash-based SSD can only be erased (and therefore written) a limited number of times before it fails." The drive's firmware attempts to ensure that writes are distributed evenly over the disk so that no single sector is written to more times than any other, and therefore the drive will last longer. But ultimately the limit will be reached, and the drive will no longer work.

What this works out to is that ATA hard-disk failure is usually mechanical, whereas SSD failure is electronic, and one of the ways this occurs is when the write limit is reached to even a single block of the drive--I'm pretty sure that even just a single block will screw the drive. Therefore it behooves one to reduce the number of read-writes to an SSD, and the best way to do that on a Windoze system is to offload temp directories of all kinds, including cache folders, to an older-style platter disk. At some point in the future SSDs will have a sufficient number of read-writes that this will doubtless no longer be much of a concern, but we haven't reached that point yet.

And let me say that I looooooove my SSD. It makes things a lot faster even than the old Western Digital Raptor series of speed-demon ATA drives, and more stable into the bargain.
Quote (selected)
what are you going to do when MS moves Windows into the cloud?
Same thing as you. Actually from everything I've heard or read about Win10, M$ has already made the registry and the OS in general a lot more difficult to deal with and customize, so I've already decided that once Win7 is no longer a tenable OS--and hopefully we won't get there for another five or six years yet--my next home system will be exclusively a Linux box. I probably won't try to dual-boot because with UEFI instead of BIOS, dual-booting has become more complicated. I'm not an IT pro, just a "power user", so I don't want to take the time to learn about the new issues raised by UEFI if I don't have to. This will probably mean I have to limit gaming solely to games that will run on Linux, but that's the way it goes. I've wanted to go Linux for quite a while now but a bit of experimentation revealed that the learning curve is just too steep. Can't justify the time until I'm forced to it. But that time will eventually come.
Quote (selected)
it works from a USB drive.  Wouldn't that be your best solution?
Unfortunately not. I put the portable version on a flash drive and it ran, but it still hard-coded all working directories to C:\.

Moini:

Thanks for the info. Symbolic links may well be the way to go, but I'd like to try the scripting first, as it will work directly with Inkscape instead of employing Windows as an intermediary. So, can I ask for two clarifications?

1. You're talking about a standard DOS-style startup batch file, not some special Inkscape macro language, right? (Hopefully not Windows Scripting Host, as I have no idea how to work with that.)

2.  I took a look at the manual's section on command-line options and the command you adduce is nowhere to be found. Therefore I have no doubt that I'll need more help. To get further details on how to set this up, am I really going to have to subscribe to the lists to which brynn kindly links, or is there a developer's forum somewhere else I can ask on? Or might the launchpad site which opens from the Inkscape Help menu be a good place to ask? I'm not sure IRC is a good way to get scripting help--too complicated an issue; and I haven't used a listserv in so many ages that I've forgotten how, and also I have to say that I don't look forward to yet more stuff cluttering my inbox. Don't get me wrong, I'll do it if necessary. Just asking.
  • 0.92
  • Win7 pro

October 03, 2017, 09:01:59 PM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Thanks for the links to the lists. Am I to assume from their existence that developers basically don't hang out in these forums?

Yep, that's about the size of it, sadly.  And since no one owns up to it, we can only guess about the reasons.....which personally leads me to unfortunate conclusions.

But it seems like if they make the SSDs which only can be written a finite number of times, doesn't that  pretty much doom it?  I mean to me, why would I buy something that I know is going to fail at a certain point?  Do they tell you what point that will be?  That seems pretty crazy.  To me, regular hard drives are fast enough for my purposes, so faster speed does not look attractive enough to me, to shorten the life of the drive.

Unfortunately not. I put the portable version on a flash drive and it ran, but it still hard-coded all working directories to C:\.

So it's not entirely portable then?  It's only portable for taking Inkscape to different computers, but it doesn't take its products along with, when it leaves?  Hhm, I thought it was entirely self-contained, and saved all the files on the same drive with the program.  Do you have to use those directories though?  I mean even though it writes those directories onto the C drive, do you have to use them?  They'd only be written once.  But if you don't use them.....??

As far as I understand, you can subscribe to a mailing list without necessarily setting up to receive messages in your inbox.  You could use the archives to view replies.  Or you could receive messages as long as you need to get your questions answered, and then do something to stop receiving them, after your problem is solved.  Personally I would probably use the archive, and not even set up to receive the messages.  https://sourceforge.net/p/inkscape/mailman/
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 04, 2017, 09:57:54 AM
Reply #5

Ironword

  • Sr. Newbie

  • Offline
  • **

  • 5
Quote (selected)
So it's not entirely portable then?
Correction: Because I run Win7 x64, I originally downloaded the zip archive from https://inkscape.org/en/release/0.92.2/windows/64-bit/ and assumed that was the portable version. And it does run portably on a flash drive! But turns out that it's not the genuinely portable version, which unfortunately only comes in 32-bit and can be obtained at the 32-bit page.

But it doesn't make any difference. The directory I'm concerned with, the user cache, is still set for the default Windows user hierarchy on the system boot drive, even in the "real" portable version. Very disappointing.

Quote (selected)
without necessarily setting up to receive messages in your inbox
OK, that's a bit of an improvement on the process. Thx for the info.

Quote (selected)
if they make the SSDs which only can be written a finite number of times, doesn't that  pretty much doom it?
Nope. The performance and stability gains are so dramatic that once you've installed your OS to an SSD, you'll never look back--especially if you're running highly stressful apps like the latest games or editing movies (mpg, mp4, avi etc.) The difference it makes is so large that it's well worth a shorter drive life. You just have to not store any of your data on the SSD. Have a separate platter drive (or multiple drives) for that. You also employ apps like Crystal Disk Info (http://crystalmark.info/software/CrystalDiskInfo/index-e.html) and HDDguardian (https://hddguardian.codeplex.com/) to monitor the drive so that when it starts approaching failure, you have warning and can take preemptive action.


Further, the drive life isn't as short as you might think. My current box is now going on 5 years (built mid-2012), and the same SSD has been plugging along (well, zipping along, really) the whole time.
« Last Edit: October 04, 2017, 10:53:24 AM by Ironword »
  • 0.92
  • Win7 pro

October 05, 2017, 06:14:08 AM
Reply #6

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Quote (selected)
1. You're talking about a standard DOS-style startup batch file, not some special Inkscape macro language, right? (Hopefully not Windows Scripting Host, as I have no idea how to work with that.)

- Uhm... mh. What you need to do is set the environment variable for the profile directory. I hope you can find out how to set environment variables on Windows, because I have no idea.

Quote (selected)
2.  I took a look at the manual's section on command-line options and the command you adduce is nowhere to be found. Therefore I have no doubt that I'll need more help. To get further details on how to set this up, am I really going to have to subscribe to the lists to which brynn kindly links, or is there a developer's forum somewhere else I can ask on? Or might the launchpad site which opens from the Inkscape Help menu be a good place to ask? I'm not sure IRC is a good way to get scripting help--too complicated an issue; and I haven't used a listserv in so many ages that I've forgotten how, and also I have to say that I don't look forward to yet more stuff cluttering my inbox. Don't get me wrong, I'll do it if necessary. Just asking.

It's documented here (also comes with the program - does Windows have access to man pages?...):
https://inkscape.org/en/doc/inkscape-man.html#ENVIRONMENT

There is no developer forum. The mailing lists and IRC are the places where devs can be found. Or the bug report section, but this is not a bug ;-)

October 05, 2017, 06:20:56 AM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
5 years seems pretty good!  How long do you think it would have lasted, if you had not been protecting it all along?  Do they tell you when you buy it that it will have a shorter life?  Because I just bought a new laptop several months ago.  There were tons of SSD drives, in fact being stubborn about wanting the traditional kind, seemed to be limiting my selection.  But I didn't see any warnings about SSD drives having shorter life.

Are you sure that the portable version of Inkscape actually installs something on the computer.  It seems "portable" by definition should mean that it doesn't affect the computer it's being used on.  It sounds like it ought to be entirely self-contained.  Because if you think you have a portable program, and you plug into a friend's computer.....or let's say it's even a public computer, like at a library.  You wouldn't want it to put a new directory on your friend's computer, and for a public computer, it probably would not allow the directory to be created.

I would have to say 'what's the point?'

Wait, when you say "user cache" do you mean this:  C:\Users\brynn\AppData\Local\Microsoft\Windows\Temporary Internet Files ?  Because that would not be creating any new directory.  That one is pretty much born with the computer, isn't it?

Or do you mean this:  C:\Users\brynn\AppData\Roaming\inkscape ?  And if this is what you mean, if you're using the portable version of Inkscape, what does it do, create a whole new user for you (I mean on someone else's computer)?  Or does it use the computer owner's directory?

If I can find some time later today, I think I'll try downloading the portable version, and try it.  "Portable" doesn't mean it can be used on non-Windows computers, does it?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 06, 2017, 05:38:14 PM
Reply #8

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
As Ironword wrote, the only available 'portable' (paf) version is 32 bit, which the user does not want to use for some reason and which is meant for Windows. I understand the 'user cache' to mean the user profile directory, i.e. your personal Inkscape config directory, with the preferences file in it.

October 06, 2017, 08:37:15 PM
Reply #9

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I understand the 'user cache' to mean the user profile directory, i.e. your personal Inkscape config directory, with the preferences file in it.

That's what I thought too, at first.  But when I looked at Inkscape Preferences > System, it shows the "User cache" is the user temp file folder - something which is already there, and not added by Inkscape.  And the one with prefs file is called "User Config".  So I just wanted to make sure.

Anyway, I understand the portable version didn't work for him.  I just thought I'd try it myself when I can find some time.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 09, 2017, 11:22:38 PM
Reply #10

Ironword

  • Sr. Newbie

  • Offline
  • **

  • 5
Quote (selected)
How long do you think it would have lasted
No way to tell, although your next question bears on this issue...
Quote (selected)
Do they tell you when you buy it that it will have a shorter life?
...yes, manufacturers do give you an estimated drive life. It's called Mean Time To Failure (MTTF). The interesting thing is that I made a search on this issue to see if there was more info available than when I built my system, as I don't work in the IT business so I don't keep up on the tech as a matter of course. I ran across a fairly recent PC World article which suggests that SSD makers are being deliberately conservative in these estimates, probably just to protect themselves (http://www.pcworld.com/article/2856052/grueling-endurance-test-blows-away-ssd-durability-fears.html). The drives actually last longer than the manufacturers say they will. In an age where the case is routinely the opposite with a (much more expensive) automobile, that's a refreshing change!

Quote (selected)
when you say "user cache" do you mean this
When I say "User Cache" I mean the directory which bears precisely that label under Edit | Preferences | System. This is the one that points to Temporary Internet Files. Therefore this by Moini...
Quote (selected)
I understand the 'user cache' to mean the user profile directory
...only gets me halfway to where I want to go, and much the less important half. I would certainly prefer to put the user profile with Inkscape. But I'm a good deal less concerned with that than with the User Cache.

Quote (selected)
That one is pretty much born with the computer, isn't it?
The point is not that the "Temporary Internet Files" folder itself comes with Windows; that's a trivial issue. The problem is that Inkscape will now be writing to that folder, presumably on a regular basis. On my system, I use Firefox exclusively; I've "uninstalled" Internet Explorer. You can't truly remove IE from a Windows system, but you can at least go through the motions and make it invisible by telling Windows not to include IE during the initial OS installation. Therefore I don't use IE, so my Temporary Internet Files directory, which is IE's cache folder, doesn't get any use. Firefox doesn't use it, and I've placed FF's cache folder on a different (platter) drive. On my system, I don't want any program using Temporary Internet Files--yet here comes Inkscape insisting on doing so. Not cool!

To put it another way: I'm less concerned about the user config because you set your preferences and then you mostly leave them alone; there won't be a whole lot of writes to that file. Maybe an adjustment here and there, but no big deal. A cache is a much different story--caches get written to a lot. That's the nature of a cache.

Quote (selected)
It's documented here
Mea culpa--I feel really dumb. I had just looked at the first item in the Help menu, the manual. It has a section on the command line, http://tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine.html . But for some reason the profile command isn't listed--and I figured if it wasn't there, it wouldn't be anywhere else, so I didn't even look further down the menu, else I'd have seem the special command-line page! Oops.
  • 0.92
  • Win7 pro

October 10, 2017, 02:14:31 AM
Reply #11

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Well, I really appreciate you taking the time to chat, and help me understand some things.  I'm sure it will pay off when I'm helping another user in the future.

I MUST be looking at something wrong.....  I wanted to look at the User Cache.  Not because I don't believe you, but because I wanted to see how much gets written there.  I even made a screenshot to make sure I'm looking in the right place (sorry for the ugly theme color, it's easy on my eyes).

I don't seem to have such a folder as C:\Users\brynn\AppData\Local\Microsoft\Windows\Temporary Internet Files.

inksca.png
*inksca.png
(71.76 kB . 991x705)
(viewed 1328 times)


Whoa!  They have that thing Totally hidden!  While the Temporary Internet Files folder isn't showing in that dir, I searched it and found most of what's written there is written in the WER folder.  (whatever that is!)

But still, see the highlighted search result.  It clearly is spelling out Temporary Internet Files folder, which clearly isn't there.

inkscac.png
*inkscac.png
(171.53 kB . 1365x675)
(viewed 1270 times)


And on top of all that, I suddenly wonder what Inkscape has to do with internet files!  (I'm also on Windows 7 Pro.)  I wonder if Linux systems have such oddities? 

With the WER folder expanded -- no temp files folder seen!

inkscach.png
*inkscach.png
(101.97 kB . 990x456)
(viewed 1268 times)


(Ah-HA!!  This must be one of those hidden temp files which can't be deleted without using one of those deeper cache-cleaning programs!  I can clear my cache using the browser controls - turn around and run a deeper cleaning temp file removal tool, and it often removes 300, once as high as 900-some MB of hidden temp files!!)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 10, 2017, 08:13:11 AM
Reply #12

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
I found how it works. So:

That cache directory is set using a function from the Glib library. This library asks your operating system for the directory where to store cached files.

On Linux, there is an environment variable that can be set (see https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir), on Windows, it seems like these variables can be changed, too:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494%28v=vs.85%29.aspx#csidl_internet_cache

It's not only Inkscape that uses that folder on Windows, but many other programs, too, so you may want to look into how to change that csidl_internet_cache variable to something that is not on your SSD.

OR you may want to use a symlink, for the whole folder.

October 10, 2017, 08:15:58 AM
Reply #13

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
OR you just set the variable XDG_CACHE_HOME to the folder you want. Please first check if there will be any negative consequences of this, by googling - I'm not a Windows user.

(@Brynn: On my Linux system, the folder is simply /home/username/.cache/ - makes a lot more sense, right? The internet files thing is a fallback, for when another folder is not defined...)

October 11, 2017, 09:24:30 PM
Reply #14

Ironword

  • Sr. Newbie

  • Offline
  • **

  • 5
Moini and Brynne, that's some good sleuthing. Kudos to you both-- I'm not sure which way I'm going to handle the issue yet, but that's valuable information.
  • 0.92
  • Win7 pro