CN writes data all over the place, how can I make it behave ?

Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

CN writes data all over the place, how can I make it behave ?

Postby Clairvaux » Tue May 16, 2017 12:04 am

Hi,

I have upgraded recently from a Pro license (GOTD promotional offer) to a Pro Lifetime license, and have trouble making CN keep all its eggs in the same basket. It seems it's writing new databases, new settings files and new folders all over the place. How do you order it to stay put and keep all its toys THERE ? ;)

I tried to register with the new license key. Registration was deemed successful, but the old key remained in the box. I decided to deep-uninstall with Revo Uninstaller. I made a backup of the AppData folder just to be sure. Then I reinstalled from scratch and the following happened :

- CN created a data folder where it shouldn't be, in the AppData folder of my administrator account. That's not the Windows user account I'm using. I live under a non-administrative account, as security mandates. I do all my installs from this non-admin account, obviously elevating rights. CN "thought" the admin account was "me".

- My "true" CN data folder is in the AppData folder of my non-admin account. That's where I restored my notes (or anyway, they are there, I don't recall everything I did). This folder has (on the face of it) all it should have, including a settings file.

- In my admin account App Data, I only have another, lone cintanotes.settings file, plus a backup folder with an hourly backup (0 KB).

- Now I have just discovered that CN has created a second folder in my non-admin account AppData, next to the "real" one. It just has one license.key file.

> Is CN annoyed because I have changed the name of my "true" data folder ? Does it need to retain its original CintaNotes name for ever ?

> Might old registry keys from previous CN installs be wreaking havoc ?

> Can I drag the licence file to the "real" data folder, delete the empty folder, delete the admin AppData folder and be done with it ?

> Can I delete the *hourly.db.temp* files lurking in my "real" folder ?

> Some links in my filelinks folder don't work anymore. The targets haven't been moved, to the best of my recollection, and isn't CN supposed to keep track of them even if they move ? Any way to make them work again ?

Generally speaking, how to restore order and ensure it stays that way, including through future udpates and backups/restores of data file ?

Thank you !
date
Posts: 243
Joined: Sat Aug 01, 2015 5:15 am
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby date » Tue May 16, 2017 6:52 am

I'd recommend you use the portable version of CN. You extract it to a folder and it keeps its settings in that folder. Isolated from other portable versions and the 'installed' version. And if you make your .db files in that folder as well, it is the only folder you have to backup. Very practical! You just don't get the shortcuts in the start menu and on the desktop, but you can make them there yourself by dragging the 'Cintanotes.exe' from that folder there with the right mouse button.

Clairvaux wrote:Some links in my filelinks folder don't work anymore. The targets haven't been moved, to the best of my recollection, and isn't CN supposed to keep track of them even if they move ? Any way to make them work again ?
You mean a link to a file within a note? If you move the file it'll still work but that is a Windows feature (TrkWks) that you can either enable or disable and has nothing to do with CN... but I could be wrong here.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby CintaNotes Developer » Tue May 16, 2017 2:13 pm

I suspect that when you re-installed, you checked the 'Run CintaNotes now' checkbox, didn't you? Installer runs under admin (to be able to write into Program Files), and when it started cintanotes.exe, the latter inherited installer's current user and credentials, and also ran as admin.
This is why it placed all data into admin's appdata folder and not your user's.

Obviously this is not great, probably the installer should present a selection for which user you want to install the program. I'll have to investigate how to do that.
Alex
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby CintaNotes Developer » Tue May 16, 2017 2:22 pm

> Is CN annoyed because I have changed the name of my "true" data folder ? Does it need to retain its original CintaNotes name for ever ?

No, CN is simply fixed to use "CintaNotes" as the name of its %APPDATA%-based working folder. When you force it to use another folder, you in fact switch from using CN's "special" path to using absolute path, but this works only for notebooks and (if you edited settings file by hand) backup. The settings file, license key, filelink cache will remain in the %APPDATA%\CintaNotes working folder.

> Might old registry keys from previous CN installs be wreaking havoc ?
No. CN doesn't use registry, otherwise it couldn't work portably.

> Can I drag the licence file to the "real" data folder, delete the empty folder, delete the admin AppData folder and be done with it ?
The license file needs to be either near cintanotes.exe, or in %APPDATA%/CintaNotes. Otherwise CN won't see it.
Note however that which %APPDATA% is used can depend on under which account Windows is running!
Also if you place the license file into Program Files, CintaNotes will be only able to install a new key when running as admin.

> Can I delete the *hourly.db.temp* files lurking in my "real" folder ?
What are those files? Did CintaNotes make them or did you?

> Some links in my filelinks folder don't work anymore. The targets haven't been moved, to the best of my recollection, and isn't CN supposed to keep track of them even if they move ? Any way to make them work again ?
Is the "Distributed link tracking" service running?

>Generally speaking, how to restore order and ensure it stays that way, including through future udpates and backups/restores of data file?
1) Don't run CN from installer
2) Run CN ONLY from user you're working under (in your case, not admin)
OR - use portable version
Alex
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby CintaNotes Developer » Wed May 17, 2017 9:16 am

CintaNotes Developer wrote:I suspect that when you re-installed, you checked the 'Run CintaNotes now' checkbox, didn't you? Installer runs under admin (to be able to write into Program Files), and when it started cintanotes.exe, the latter inherited installer's current user and credentials, and also ran as admin.
This is why it placed all data into admin's appdata folder and not your user's.

Obviously this is not great, probably the installer should present a selection for which user you want to install the program. I'll have to investigate how to do that.


I re-checked and this theory proved false: we have the "runasoriginaluser" option set, which would exclude running CN as admin from the installer, unless you started the installer itself with the "run as" command. Did you maybe do that?
Alex
Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby Clairvaux » Thu May 18, 2017 1:35 am

Alex and Date, thank you for your detailed answers.

1. On selecting Windows user account at install
CintaNotes Developer wrote:I re-checked and this theory proved false: we have the "runasoriginaluser" option set, which would exclude running CN as admin from the installer, unless you started the installer itself with the "run as" command. Did you maybe do that?

I install under monitoring of Revo Uninstaller, which asks for admin rights, so I suppose this is equivalent to running the installer as admin. I always install from within my non-admin account. Don't you always need to run as admin if you want to install ? I just checked that double-clicking on the installer (without Revo monitoring) triggers the UAC warning box : so, running as admin, right ?
I suspect that when you re-installed, you checked the 'Run CintaNotes now' checkbox, didn't you ?

Yes. I always launch programs just after install, then adjust settings if needed, because the Revo Uninstall process asks for it.

2. On where to run CN from

1) Don't run CN from installer.

I don't get it. How can you run CN from the installer ? The only thing which can happen if you run the installer is... it installs CN, or am I missing something ?
2) Run CN ONLY from user you're working under (in your case, not admin).

That's what I always do. Ideally, I would like to also be able to use CN when working under my admin account (obviously with the same user data set). But that's of secondary importance.

3. On portable / installed CN

Now I'm lost.
CN doesn't use registry, otherwise it couldn't work portably.

There are two different downloads, right ? One installable, the other portable ? I used the installable one. Revo Uninstall says it wrote 156 items in the registry.

Are there any drawbacks to the portable version (speed, reliability, features...) ? I don't mind making shortcuts myself.

4. On data user folder name

CN is simply fixed to use "CintaNotes" as the name of its %APPDATA%-based working folder. When you force it to use another folder, you in fact switch from using CN's "special" path to using absolute path, but this works only for notebooks and (if you edited settings file by hand) backup. The settings file, license key, filelink cache will remain in the %APPDATA%\CintaNotes working folder.

Then I think I'll revert to the original CintaNotes name. It seems simpler and safer. Btw, all my settings files are in renamed folders, and somewhat this seems to work. (Oh, and that's still CintaNotes for data, even if you've changed the install folder name into Cinta Yada Yada, right ?).

5. On the cintanotes.settings files

Both point to the location with the "real" data (notebook.file = ), including the one in the admin AppData.

6. On various files in various locations
> Can I delete the *hourly.db.temp* files lurking in my "real" folder ?
What are those files? Did CintaNotes make them or did you?

CN made them. They are several days old, too, and I have the regular non-temp backups, so I suppose they are obsolete.
The license file needs to be either near cintanotes.exe, or in %APPDATA%/CintaNotes. Otherwise CN won't see it. Note however that which %APPDATA% is used can depend on under which account Windows is running !

Well I made a little experiment : I moved the license.key file from the [non-admin user account]\AppData\Roaming\CintaNotes folder, which therefore is now empty ; and I copied it into the AppData\Roaming\[Cinta Notes modified name] folder, which has all my "real" user data, and it... works. The license shows with its actual content through the Help/License menu. Anything wrong with that ?
> Some links in my filelinks folder don't work anymore. The targets haven't been moved, to the best of my recollection, and isn't CN supposed to keep track of them even if they move ? Any way to make them work again ?
Is the "Distributed link tracking" service running?

Yes. There are only a few broken links, though. I could re-create them manually. It's just that I like to understand what went wrong. Those are links with names like hashes, created (I think) by the command Insert Link / File.

And a few other, newly discovered files which... may be deleted... right ?

Users\[non-admin user account]\AppData\Local\IconCache.db

5 MB, and when you click on it asks for a password (which I never registered).

Another one here (2 MB):

\Users\[admin user account]\AppData\Local\IconCache.db

Also : log.1.txt

Help / Debug / Debug Logging is unchecked now, so I suppose no harm in deleting that.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby CintaNotes Developer » Thu May 18, 2017 3:00 pm

I install under monitoring of Revo Uninstaller, which asks for admin rights, so I suppose this is equivalent to running the installer as admin. I always install from within my non-admin account. Don't you always need to run as admin if you want to install ? I just checked that double-clicking on the installer (without Revo monitoring) triggers the UAC warning box : so, running as admin, right ?

There's difference between temporary elevation with UAC and with the 'Run as' command. With UAC the installer remembers your original account and can start CN under it. But if you choose "Run as", there's no original account anymore - for the installer, you ARE admin and it starts CN later for admin.

Yes. I always launch programs just after install, then adjust settings if needed, because the Revo Uninstall process asks for it.

This Revo Uninstall thing adds a level of uncertainty to the whole thing. It may well be that it somehow hijacked the installation process, to be able to monitor it.

1) Don't run CN from installer.

I don't get it. How can you run CN from the installer ? The only thing which can happen if you run the installer is... it installs CN, or am I missing something ?

I mean the first time after install, when you leave the "run CN now" checkbox checked.

CN doesn't use registry, otherwise it couldn't work portably.

There are two different downloads, right ? One installable, the other portable ? I used the installable one. Revo Uninstall says it wrote 156 items in the registry.

It must be the Enigma protector saving the trial days info. Sorry for misleading you, I forgot about this. CintaNotes itself doesn't use the registry, but the protector it's wrapped in may write to it to store the left trial days information. However this shouldn't affect license keys, they are stored as "license.key" files.

Are there any drawbacks to the portable version (speed, reliability, features...) ? I don't mind making shortcuts myself.

Basically only the shortcuts. Otherwise they are identical.

Then I think I'll revert to the original CintaNotes name. It seems simpler and safer. Btw, all my settings files are in renamed folders, and somewhat this seems to work. (Oh, and that's still CintaNotes for data, even if you've changed the install folder name into Cinta Yada Yada, right ?).

Yes. I have no idea how it's working for you, it really shouldn't. It can be creating new default setting files in the expected places. Also if your cinatnotes.exe is not in Program Files, it will create settings file near itself and not in AppData.

Both point to the location with the "real" data (notebook.file = ), including the one in the admin AppData.

Do they use absolute or relative paths?

CN made them. They are several days old, too, and I have the regular non-temp backups, so I suppose they are obsolete.

Yes delete them.

Well I made a little experiment : I moved the license.key file from the [non-admin user account]\AppData\Roaming\CintaNotes folder, which therefore is now empty ; and I copied it into the AppData\Roaming\[Cinta Notes modified name] folder, which has all my "real" user data, and it... works. The license shows with its actual content through the Help/License menu. Anything wrong with that ?

Are you sure there are no other license.key files in the filesystem?

Yes. There are only a few broken links, though. I could re-create them manually. It's just that I like to understand what went wrong. Those are links with names like hashes, created (I think) by the command Insert Link / File.


No idea what happened here. If only you could reproduce the issue with a newly created link..

Users\[non-admin user account]\AppData\Local\IconCache.db

This is not a CintaNotes file.

\Users\[admin user account]\AppData\Local\IconCache.db

Also not a CintaNotes file.

Also : log.1.txt

If debug logging is turned off, this file must have been created to record information about some error that happened.
Would be great if you sent it to me.
Alex
Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby Clairvaux » Sat May 20, 2017 2:59 am

First answers, then a little experimenting leading to success, and finally a tentative conclusion open to comments.

ANSWERS

Are you sure there are no other license.key files in the filesystem?

Actually there is : in the Program Files(x86) install folder. And they are identical (same hash). So, this problem solved.
> AppData\Local\IconCache.db
> This is not a CintaNotes file.

Ha ! It does have the CN icon, though. So, wrong association, I suppose. Probably shouldn't have checked Options / System / Associate CintaNotes with .db Files.
If only you could reproduce the issue with a newly created link...

I'm afraid not, because this happened only after several acrobatic attemps at saving/selectively restoring user data, so can't reproduce really. Only a few broken links though, no big deal.
> Both settings files point to the location with the "real" data (notebook.file = ), including the one in the admin AppData.
> Do they use absolute or relative paths?

Absolute.
There's difference between temporary elevation with UAC and with the 'Run as' command. With UAC the installer remembers your original account and can start CN under it. But if you choose "Run as", there's no original account anymore - for the installer, you ARE admin and it starts CN later for admin. This Revo Uninstall thing adds a level of uncertainty to the whole thing. It may well be that it somehow hijacked the installation process, to be able to monitor it.

Interesting. This might explain annoyances I've experienced with other software installed the same way. Frequent problem is : I ask the installer for a shortcut on the desktop, and never get to see it, because it's on the admin's desktop, not "mine".

A LITTLE EXPERIMENTING

1. Restoring their native CintaNotes name to my AppData folders (fail !)

  • Quit CN.
  • Rename both AppData folders to native CintaNotes name.
  • Delete old CintaNotes empty folder.
  • Launch CN.
  • Fail ! CN refuses to stick to native CintaNotes name, and creates new folder in [non-admin user]\AppData\Roaming with same Cinta Yada Yada custom name I registered for the install folder inside Program Files (x86) when installing.
  • CN populates it with empty cintanotes.db, cintanotes.settings and backup subfolder. (By the way, picking up the install folder custom name for the user data folder is what I would call expected behaviour for any program.)
  • File / Open to restore the original database. Original database opens, but without former settings.
  • Close new empty cintanotes.db. Former settings still not restored.

2. Reinstall of installed version without immediate launch after install (success ?)

  • Deep uninstall of CN with Revo Uninstall + manual cleaning.
  • Reinstall from non-admin user account with Revo monitoring, triggering UAC. Install folder with custom name : Program Files (x86)\Cinta Yada Yada. Launch CN ? = No. Quit installer.
  • Launch CN. Pro trial has ended. Revert to Basic. Enter license. Registration OK.
  • CN has created :
    > [non-admin user]\AppData\Roaming\CintaNotes folder, only populated by license.key file.
    > ...\Cinta Yada Yada folder, with all the other user data : cintanotes.db, cintanotes.settings, backup folder. So, obviously picked up name from custom name of install folder.
  • Nothing has been created in the [admin user]\AppData.
  • There's no license.key file in the install folder.
  • Creation of 2 test notes in fresh cintanotes.db, with one attachment and all links : to URL, to file, to note, to attachment.
  • Quit CN, relaunch CN.
  • No other folders have been created by CN.
  • CintaNotes folder still only has license.key file.
  • In AppData\...\Cinta Yada Yada folder, cintanotes.db has grown accordingly with the new notes creation, and cache/filelinks folder has a new link, matching the file link created in the note. All seems to be going well.
Now let's try to restore former data.

  • Quit CN.
  • In AppData\...\Cinta Yada Yada, delete cintanotes.settings, replace with former saved cintanotes.settings.
  • Merge saved .db files, backup files and file links with newly created ones.
  • Launch CN.
  • CN opens directly on the former, main, restored database, with the restored settings.
  • The freshly created database is normally displayed through File / Open, following the restored settings and not those it had at creation (except for the hourly backup which apparently has to be set up separately).
  • Up to that point, things seem to work as expected (caution required).

3. "Installation" of a portable version of CN (success !)

  • Quit installed CN. Don't uninstall.
  • Unpack portable version in chosen folder. Register license.
  • Merge saved files with new ones. Just works.
  • Installed and portable version can run concurrently, however I did not manage to display both at the same time. It also seems only one of them can Register Link Protocol (Options / System), not both at the same time.

TENTATIVE CONCLUSION

  • If installing with Revo Uninstaller monitoring from non-admin account, don't run the program at the end of install, in order to install properly for non-admin. Instead, quit first and relaunch.
  • CN will pick up whatever custom name the user choses at install for the install folder, and apply it to the user data folder it creates automatically in AppData\Roaming.
  • If user has chosen a name different from the default CintaNotes, CN will add a second user data folder in AppData\Roaming, named CintaNotes and containing only the license.key file (provided there is one).

This seems partly at odds with :
CN is simply fixed to use "CintaNotes" as the name of its %APPDATA%-based working folder. When you force it to use another folder, you in fact switch from using CN's "special" path to using absolute path, but this works only for notebooks and (if you edited settings file by hand) backup. The settings file, license key, filelink cache will remain in the %APPDATA%\CintaNotes working folder.

"Installation" of portable version seems more straightforward.

Comments welcome.

All the best,

Clairvaux
date
Posts: 243
Joined: Sat Aug 01, 2015 5:15 am
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby date » Sat May 20, 2017 2:25 pm

The portable version is a folder from which you run the program and in which the program keeps all its saved state. So you can copy that folder to someplace else and it will run with all your set settings and other luggage as everything is contained in that folder. (At least, that is what 'portable' is supposed to mean.)

Whenever a portable version of some program is offered (like with CN) I'll use that, as it is more practical than installing a program. You can 'uninstall' simply by deleting the folder. You can transfer the complete program by copying the folder, and to re-install, back-up or run on another computer you do not need write down all your settings and associated data, or hunt for them in the darker depths of %appdata%.

Clairvaux wrote:Installed and portable version can run concurrently, however I did not manage to display both at the same time. It also seems only one of them can Register Link Protocol (Options / System), not both at the same time.

Yes, and only one program can be associated with .db files at the same time.


-- Sent from my portable Firefox.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby CintaNotes Developer » Mon May 22, 2017 10:10 am

Clairvaux,

Thanks for such a detailed and determined research!

[*]If installing with Revo Uninstaller monitoring from non-admin account, don't run the program at the end of install, in order to install properly for non-admin. Instead, quit first and relaunch.


Yes.

[*]CN will pick up whatever custom name the user choses at install for the install folder, and apply it to the user data folder it creates automatically in AppData\Roaming.


Yes. I was wrong about this part, sorry. What I said was once true, but I forgot that later we implemented a better option. Only the license key file is placed into a fixed AppData/CintaNotes location (so instances of CN share the license key). But for other files, the name of the folder in Program Files is taken, so that you can have multiple copies of CN installed and they will be able to work alongside each other.

[*]If user has chosen a name different from the default CintaNotes, CN will add a second user data folder in AppData\Roaming, named CintaNotes and containing only the license.key file (provided there is one).[/list]

Yes.
Alex
Clairvaux
Posts: 65
Joined: Sun Dec 25, 2016 12:43 pm
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby Clairvaux » Mon May 22, 2017 9:44 pm

@ Date

I, too, at some point, chose systematically portable versions over installable ones, for the reasons you state. Then it dawned on me that there were sometimes differences between them, and software publishers rarely described them.

There's also the tricky status of "semi-portable" applications. For instance, does not write into registry, but writes in AppData. Or is portable, but has an installer nonetheless.

Also, publishers often tell you the installed version is the recommended one (without saying why), leaving you with the unpleasant feeling that portable is for lesser individuals.

Also, if portable is so good, why is it a tweak relative to Windows standards ? Why do we have a registry to begin with ? Is the registry only there to annoy people and enrich publishers of registry cleaners ?

Installed versions may have advantages. When a program inserts itself in the context menu (provided it's a welcome addition), portable comes second because it can't do that. Portable programs, it seems to me, are a security risk relative to outside attacks, since their folder is not write-protected by Windows the way Program Files and Program Files (x86) are.

Generally speaking, I wish that publishers would systematically state the differences (or lack thereof) between portable and installed versions of their products, the way they now do as a matter of course for free / paid-for / top-of-the-range. Especially as far as non-visible qualities may be concerned (speed, reliability, security).
date
Posts: 243
Joined: Sat Aug 01, 2015 5:15 am
Contact:

Re: CN writes data all over the place, how can I make it behave ?

Postby date » Tue May 23, 2017 6:51 pm

Clairvaux wrote:Portable programs, it seems to me, are a security risk relative to outside attacks, since their folder is not write-protected by Windows the way Program Files and Program Files (x86) are.
I didn't know Program Files was write-protected... I guess I disabled all that stuff. The biggest security risk to me is losing things. I mitigate that risk by using portable programs as much as possible because I can back them up easily, takes 5 minutes every two weeks. And if the program has a newer version, I can try it out first without overwriting my Known Good State.

If however I installed the program and it adhered to 'Windows standards' I would have to scrape all the pieces together first to make a copy, and make a note of where to put all those pieces back, and pray I can make it work the same as before should anything go wrong. And I would never voluntarily update something because if something broke, it's more difficult to go back.

Well you know what the options are, you can see what works best for you. ;)

Return to “Bug Reports”