Stickies
« custom location for data and configuration files »

Welcome Guest. Please Login or Register.
May 29th, 2017, 10:33pm


Click to go to the
Zhorn Software Web Site
Click to go to the
Knowledgebase

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: custom location for data and configuration files  (Read 1722 times)
leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx custom location for data and configuration files
« Thread started on: Feb 25th, 2016, 03:26am »

Hi to all,

I try to get running more then one instance of Stickies simultaneously. Installing multiple instances of the app in any arbitrary folders is not itself a problem, but it is senseless, because every instance uses for storing the notes (the data) and configuration the same folder in the user profile (what is not good for security reasons too).

So is there any workaround to set a custom location for notes data and configuration files, eg in the work folder where the executable stickies.exe file and skins are located?

Many thanks in advance!
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #1 on: Feb 25th, 2016, 1:21pm »

Yes, sure, check out the Backup page in the help file for a flowchart about how Stickies finds its data directory.

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #2 on: Mar 15th, 2016, 06:02am »

on Feb 25th, 2016, 1:21pm, Tom Revell wrote:
Yes, sure, check out the Backup page in the help file for a flowchart about how Stickies finds its data directory.

Quote:
Registry data path setting
All the above can be overridden by setting a registry value, at which point Stickies will ignore the above, and use only that specified location for saving data files. The string value to set is:
HKEY_CURRENT_USER\Software\Zhorn\stickies\Path
This key doesn't exist by default, so you'll need to create the Zhorn and stickies keys, and then the Path string value.

I have tried to follow instructions from Help file, but it seems, that whether I do something wrong or this trick with system registry patch does not work (please look at the attached screenshot). Could you advise anything?

User Image
« Last Edit: Mar 15th, 2016, 06:14am by leopoldus » User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #3 on: Mar 15th, 2016, 3:56pm »

That screenshot looks OK to me - does that path exist on the file system? Do you see the same problem for all substitute paths you try in that location?

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #4 on: Mar 15th, 2016, 6:46pm »

on Mar 15th, 2016, 3:56pm, Tom Revell wrote:
That screenshot looks OK to me - does that path exist on the file system?

Yes, I've checked many time when saw, that the solution does not work.

Quote:
Do you see the same problem for all substitute paths you try in that location?

Yes, it was my first thought, that the trick does not work for long folder name with a space. So I've tried a shorter path D:\MyData\Stickies, but the result is the same.

Does this patch works for you with the last release 8.0c?
Is it possible any conflict depending to stickies.ini ile location in the Stickies work folder?
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #5 on: Mar 16th, 2016, 4:04pm »

Perhaps you could export that registry key to a .reg file, then open it in Notepad, and paste it here.

The feature does work, so perhaps there's a typo or something.

One other thing to check - you are restarting Stickies after changing the path, yes?

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #6 on: Mar 16th, 2016, 7:43pm »

on Mar 16th, 2016, 4:04pm, Tom Revell wrote:
Perhaps you could export that registry key to a .reg file, then open it in Notepad, and paste it here.

I'm afraid, that I do not see your idea. Why do you think, that editing the system registry key in an external text editor could give other result than direct editing in the native regeditor?

Quote:
perhaps there's a typo or something.

Surely not, I've checked the path dozens of times.

Quote:
One other thing to check - you are restarting Stickies after changing the path, yes?

Yes, I restarted Stikies app many times for the last week.
User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #7 on: Mar 17th, 2016, 3:58pm »

Regedit has a menu item File/Export which allows you to save part of the structure to a text file which has a .reg file extension. That file can then be opened in Notepad, and pasted into a forum post. I'm not suggesting a third party registry editor (do those even exist?), but instead that I get a closer look at the value in your registry, by way of a text file.

The code which perform the registry check runs every time Stickies is launched, and looks like this:


HKEY key;
if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Zhorn\\stickies"), 0, KEY_QUERY_VALUE, &key) != ERROR_SUCCESS)
{
// Failed
RegCloseKey(key);
return false;
}
else
{
TCHAR str[MAX_PATH];
DWORD dwBufLen = sizeof(str);
if (RegQueryValueEx(key, _T("Path"), NULL, NULL, (LPBYTE)str, &dwBufLen) != ERROR_SUCCESS)
{
RegCloseKey(key);
return false;
}
m_cwd = str;
}
// Close it
RegCloseKey(key);


Then once Stickies is running, you can check the data directory being used in the About dialog. Perhaps posting this code with its paths will help you work out what's going wrong.

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #8 on: Mar 17th, 2016, 4:36pm »

on Mar 17th, 2016, 3:58pm, Tom Revell wrote:
Regedit has a menu item File/Export which allows you to save part of the structure to a text file which has a .reg file extension. That file can then be opened in Notepad, and pasted into a forum post. I'm not suggesting a third party registry editor (do those even exist?), but instead that I get a closer look at the value in your registry, by way of a text file.

Oh, I see now what do you mean. I had understood your previous post totally wrong way. :-[
Here is the full Zhorn branch copied from OS system registry (there is no too many entries there):

Code:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Zhorn]

[HKEY_CURRENT_USER\Software\Zhorn\stickies]
"Path "="D:\\MyData\\Stickies" 


And here is a screenshot to avoid your doubts, whether the path specified in the registry does exist:
User Image


Oh, sorry!! I've just found this stupid human error: there was a space the end of the key name [Path ]. Only one invisible character has changes the meaning of the key.
I've removed this space and restarted Stickies - and now the app created all new data files in this folder I've specified in the registry. Many thanks again and sorry for this mistake, which has wasted so much your time to detect it.

:off:
Quote:
I'm not suggesting a third party registry editor (do those even exist?)

Third party registry editors?? Dozens of dozens! See here: https://www.google.ee/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=windows+registry+advanced+editor
« Last Edit: Mar 17th, 2016, 4:47pm by leopoldus » User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #9 on: Mar 17th, 2016, 4:56pm »

Well, now I got another stupid question. Is there any way to install several Stickies instances and set its own specific configuration and data folder for every instance? I mean, that there is the only one system registry key [HKEY_CURRENT_USER\Software\Zhorn\stickies] common for all instances undecided

Thanks!

BTW i always wanted to ask you, why do you use such a bit odd approach to store the data (stickies text) inside the configuration file stickies.ini? Usually the programmers and users both prefer to hold the settings and the data in different files unless there is a very strong reason to glue them together.

One obvious downside (and there are some other too) of your concept that a user loses a freedom to manipulate with multiple configuration. Say I'd like to create several different configurations and use them one at time with the same data/notes set. But I can not do due to the fact, that configuration and data are rigidly connected each to other.
« Last Edit: Mar 17th, 2016, 5:18pm by leopoldus » User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #10 on: Mar 18th, 2016, 1:24pm »

Ok, glad you got it sorted out.

If you wanted a couple of completely separate instances, you could create batch files which set the registry key, and then closed and ran Stickies. That would let you move between different directories easily.

Alternatively, if you leave the registry path empty, and put the exe file in multiple directories along with a blank stickies.ini, then when you run each exe, it will use the local directory, the one it's in, for all data.

You might also be able to use the working directory on shortcuts to one exe to do the same thing, but I've not tried that.

Why is everything in one directory? It makes understanding the app much simpler. If you back up one folder, then you have absolutely everything stored in Stickies.

I think that the settings and the application data do belong together. The one thing which you'll see isn't stored in the options file is the location of the directory - Stickies works that out at run time, which means maximum flexibility in moving data around if you need to, as described above.

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #11 on: Mar 18th, 2016, 2:41pm »

on Mar 18th, 2016, 1:24pm, Tom Revell wrote:
You might also be able to use the working directory on shortcuts to one exe to do the same thing, but I've not tried that.

Sorry, I'm afraid that can not see your idea. Which shortcut and which way do you suggest to use for this purpose?

Quote:
Why is everything in one directory? It makes understanding the app much simpler. If you back up one folder, then you have absolutely everything stored in Stickies.I think that the settings and the application data do belong together.

Yes, I see. Could you explain in a couple of words, what is the content of stickies.ini?

One more question. Is there any option to export some specific notes (or may be all at once) from one Stickies instance and then import them to another stickies instance database?
« Last Edit: Mar 18th, 2016, 5:48pm by leopoldus » User IP Logged

Tom Revell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 3540
xx Re: custom location for data and configuration fil
« Reply #12 on: Mar 20th, 2016, 5:04pm »

Create a shortcut to stickies.exe, then open the Properties. By setting the Start In field, you might be able to change where Stickies uses for data. You'll need to drop an empty "stickies.ini" file there for Stickies to pick it up and use it.

Like I said, not tried it though.

This might help to explain the files:

http://www.zhornsoftware.co.uk/support/kb.pl?q=00040

However, the ini is text, so you can open it and read it. See also the help file category with that name.

You can backup/restore all data at once from one machine to another. If you just want some notes, perform a backup from the source machine, and then use SSIT on the destination machine to get just some of them onto it.

Tom
User IP Logged

leopoldus
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 95
xx Re: custom location for data and configuration fil
« Reply #13 on: Mar 20th, 2016, 7:23pm »

on Mar 20th, 2016, 5:04pm, Tom Revell wrote:
If you just want some notes, perform a backup from the source machine, and then use SSIT on the destination machine to get just some of them onto it.

Excuse me, what is "SSIT"?
User IP Logged

Cynthia
Cardinal Member
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 535
xx Re: custom location for data and configuration fil
« Reply #14 on: Mar 20th, 2016, 8:41pm »

SSIT is a Stickies tool found here
http://www.zhornsoftware.co.uk/stickies/tools.html#ssit

Cynthia
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls