You are here

[Fixed] CudaText Portable Loses Some Settings On Upgrades

16 posts / 0 new
Last post
sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
[Fixed] CudaText Portable Loses Some Settings On Upgrades

I am trying to set up this app for a friend and copy my settings from the standard portable version to the PA.c version.
Trouble is, no matter where I put the data folder from my install to the PA.c Data folder, nothing is recognised by the PA.c version of CudaText. I've tried several locations inside the PA.c Data folder.
Where do I put all the settings?

To be clear, the PA.c version data folder is here:
- F:\PortableApps\PortableApps\CudaTextPortable\App\CudaText\data
But obviously I cannot store these settings here as they will be overwritten on an update.
So where do they go for the PA.c version?

Thanks.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Part of the App

That data directory is part of the app, it's not your settings. The settings get stored in a settings folder within CudaTextPortable\App\CudaText\setings while running. That is moved to CudaTextPortable\Data]CudaTextSettings when closed.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Not quite.

Thanks for your reply John.
I have been using CudaText for years and been in touch with Alexey, the dev, and am aware of several things in that data folder that are specifically user based. These files will get deleted on update if I place them in that folder.

eg. changes to lexers or user created lexers are stored here, snippets, user themes, user toolbar icons for codetree, toolbars and sidebar, all stored in the data folder: - F:\PortableApps\PortableApps\CudaTextPortable\App\CudaText\data

It seems that this wasn't checked properly for user data before release. Sad
No problem, but would be best if this folder were added to the PortableApp/Data folder too.

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Removed

The files within that data directory are preserved on upgrade.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Thanks.

I'll give it a try, see how it goes.
What about updates to language files? Or even if the app updates it's lexers of anything else in there? How does that get dealt with? I thought PA.c apps always removed the whole 'App' directory on update, and that was why the Data folder contains every apps settings.

EDIT: Doesn't work correctly. It seems many settings regarding Toolbar setup are ignored. No Menu bar is shown as my original setup has it hidden and all shown in a burger menu, which is not shown on the Toolbar either.

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Replaced

Anything from the updated version within data will overwrite the existing ones, just as the publisher's zipped version does on upgrades. This is sometimes a setting to the PA.c Installer when apps don't separate out user settings vs internal app stuff. Unlike the publisher's release, all updated locales at time of publishing are included.

What specifically did you change that didn't get preserved?

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Several things

Toolbar settings have changed, ie, default buttons have been changed to my own preferred set. I've also changed icons for the buttons I am using. Due to the settings the Menu Bar is not shown meaning I can't access any functions to change the setup. I'm not sure these settings are in the CudaText/data folder. They may be in CudaTextPortable/Data/CudaTextSettings.

As I have used my own dark theme, that is not used.
22 lexers have been modified by me which, with PA.c updates will overwrite these.
Clips folder which contains user snippets files.

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Ah Ok, Made Adjustments

Ah ok, I see what you're saying now. I've posted the updated version. It should preserve your existing data within the App folder and move it to the new Data\CudaTextData where it will be stored between runs and be properly backed up from. The launcher has custom code to upgrade the languages from the DefaultData once per version release on startup.

I think this should address the issues you've mentioned experiencing above. Please let me know for sure. My apologies for not fully understanding it earlier.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Wow! Very speedy.

Thanks for implementing that.
Just to clarify:
Themes = All good
Lexers = Checked with xml and ini files, looking good.
Clips = Unable to check as the Toolbar still doesn't show my arrangement with the Burger Menu.
Toolbar = I checked after opening CTP that all required files were moved to the correct location and it seems correct, yet the Toolbar doesn't show my selection of buttons, only the default set. Would it be helpful to send my whole NON PA.c configuration to you? Or maybe just the settings files?

No apology necessary Smile

Here is my Toolbar code showing my selected icons, so you can see what I mean. I also have a Menu setup as the first Button in this list, which is the entire MenuToolbar configured as a drop down menu system.

Create file - CudaTextPortable/Data/CudaTextSettings/cuda_config_toolbar.json

{
  "dir_icons": "",
  "icon_set": "",
  "sub": [
    {
      "cap": "",
      "hint": "Menu",
      "cmd": "2554",
      "icon": "{op}/tool_icons/common_20x20@menu.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Code Tree",
      "cmd": "2533",
      "icon": "{op}/tool_icons/common_20x20@tree.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Snippets",
      "cmd": "cuda_snippet_panel.open_dlg",
      "icon": "{op}/tool_icons/Tango_16x16@applications-accessories.png",
      "lexers": ""
    },
    {
      "cap": "-",
      "hint": "",
      "cmd": "",
      "icon": ""
    },
    {
      "cap": " ",
      "hint": "Open",
      "cmd": "menu",
      "icon": "{op}/tool_icons/Fugue_16x16@f_open.png",
      "lexers": "",
      "sub": [
        {
          "cap": "Open File",
          "hint": "",
          "cmd": "2501",
          "icon": "{op}/tool_icons/Fugue_16x16@f_open.png",
          "lexers": ""
        },
        {
          "cap": "Open File Location",
          "hint": "",
          "cmd": "2601",
          "icon": "",
          "lexers": ""
        },
        {
          "cap": "Reload File",
          "hint": "",
          "cmd": "2505",
          "icon": "{op}/tool_icons/Fugue_16x16@f_open.png",
          "lexers": ""
        },
        {
          "cap": "Recent",
          "hint": "",
          "cmd": "cuda_ext.open_recent",
          "icon": "",
          "lexers": ""
        },
        {
          "cap": "Clear Recent",
          "hint": "",
          "cmd": "2520",
          "icon": "",
          "lexers": ""
        }
      ]
    },
    {
      "cap": "",
      "hint": "Save",
      "cmd": "2502",
      "icon": "{op}/tool_icons/Fugue_16x16@f_save.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Save All",
      "cmd": "2504",
      "icon": "{op}/tool_icons/Fugue_16x16@f_save.png",
      "lexers": ""
    },
    {
      "cap": "-",
      "hint": "",
      "cmd": "",
      "icon": ""
    },
    {
      "cap": "",
      "hint": "Undo",
      "cmd": "131307",
      "icon": "{op}/tool_icons/Fugue_16x16@e_undo.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Redo",
      "cmd": "131308",
      "icon": "{op}/tool_icons/Fugue_16x16@e_redo.png",
      "lexers": ""
    },
    {
      "cap": "-",
      "hint": "",
      "cmd": "",
      "icon": ""
    },
    {
      "cap": "",
      "hint": "Replace",
      "cmd": "2564",
      "icon": "{op}/tool_icons/Fugue_16x16@c_find.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Comment",
      "cmd": "cuda_comments.cmt_toggle_line_1st",
      "icon": "{op}/tool_icons/Fugue_16x16@comment.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Minimap",
      "cmd": "310",
      "icon": "{op}/tool_icons/Fugue_16x16@map.png",
      "lexers": ""
    },
    {
      "cap": "-",
      "hint": "",
      "cmd": "",
      "icon": ""
    },
    {
      "cap": "",
      "hint": "Always on Top",
      "cmd": "2539",
      "icon": "{op}/tool_icons/Tango_16x16@preferences-desktop-locale.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Options",
      "cmd": "cuda_prefs.dlg_cuda_options",
      "icon": "{op}/tool_icons/Fugue_16x16@opt.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Update",
      "cmd": "cuda_addonman.check_cudatext_updates",
      "icon": "{op}/tool_icons/tool_icons@Fugue_16x16@globe-green.png",
      "lexers": ""
    },
    {
      "cap": "",
      "hint": "Lexer Properties",
      "cmd": "2530",
      "icon": "{op}/tool_icons/fugue_16x16@c_goto.png",
      "lexers": ""
    }
  ],
  "hide": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19"
}

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Please

Yes, that would be helpful. Please send a ZIP if your non-PAF version as well as a screenshot of what it's expected to look like vs what's missing. You can send it to the developers address on the contact page in about. I'd like to get to the bottom of it. Thanks.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Email sent...

I tried sending it as zip attachment, which failed, apparently it thinks it's a virus! Please double check just in case, shouldn't be though.
Resent as a RAR attachment. Seemed to go that time.

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Py Files, Think I got it, Try This

Got the RAR and tested it out. It looks like the py files also get updated with addons and such and need to be preserved. I've updated the launcher to handle that as well. Please try out Rev 2. You can install over your existing PAF version. After you install it, copy your existing CudaText\py file from your working non-PAF version to CudaTextPortable\Data\CudaTextPy. You don't need to replace any existing files there just add yours in. This allows all your existing stuff to work in my quick testing. I have it setup to update any py files once on each upgrade same as with the lang files so they don't go out of date.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
Success, though slow startup!

It worked, thanks for that. It's extremely slow to startup, around 1.5 - 2 mins for my old USB thumb drive! But CT has thousands of files being moved about, 2,549 to be precise!!
I'm no expert at this sort of thing, but is moving files like this ok? I mean, where these apps are run several times a day, is there no risk of degradation or file loss?
Great job, thank you! Smile

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Second Launch, First Install, Rename

Have you tried the second launch to check the speed? The first launch after an upgrade, it's essentially finishing the upgrade by copying over all the py and lang files. Second and later launches, it's just renaming 3 folders from Data to App and back again on exit. It doesn't rename them all individually or copy/replace any files.

Sometimes, the impossible can become possible, if you're awesome!

sl23
Offline
Last seen: 3 weeks 3 days ago
Joined: 2009-03-30 05:56
All good!

Just restarted my PC to check how quickly a fresh run of CTP would be and it's almost instant now!
Thank you for your help John!

Live for an ideal and leave no place in the mind for anything else.

John T. Haller
John T. Haller's picture
Online
Last seen: 42 min 34 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fixed in CudaText Portable 1.214.6.6

The above issues with data and py are fixed in today's CudaText Portable 1.214.6.6 release. I also incorporated the Data upgrades to py and lang into the installer so it will normally upgrade all of that as part of the installers upgrade process, eliminating first run after upgrade slowness. I left it in the launcher as well for if a user restores Data from a backup at some point.

And thanks again sl23 for sending me your files so I could get things fixed.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments