Recent Posts

Pages: 1 ... 6 7 8 [9] 10
81
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by LukeZ on January 02, 2025, 03:13:22 PM »
Hi Chris, I made a very slight change to the serial connection process which seems on my end at least to improve the reliability of connections to the board. I've committed them to your repo, if you want to test it out.
82
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by LukeZ on January 02, 2025, 08:16:55 AM »
Thanks for confirming, and also for fixing the Hex downloader. Since we're putting them now in the user's Downloads folder, it seems that we should put them in a folder with a better name than just "firmware," so I've changed that to OpenPanzer.

That was a good idea about InnoSetup removing those other files, and indeed that wasn't hard to do. I've gone ahead and had it remove both the Assistant cache as well as the hex downloads. I guess one could go either way on the second one, but if it were me I'd rather not have junk files laying around. Every hex can easily be downloaded from the website so it's not like the user can't recover them, even without OP Config.

I've committed these changes to your fork and a few other minor things.

If you make any other changes go ahead and also commit them to your fork rather than the source OP Config repo, and when it's stable I'll pull in the entire request.

Right now my setup is really crazy as I've kept the old version of Qt and everything else alongside the new, for dev purposes. But I'll clean it all up when we do the final over-write. 

Are there other issues that we should address? I know there is the flakiness of the serial connection, that has always been an issue and I can revisit it but I don't think it is affected one way or the other by the upgrade to Qt6.

I should also say that I don't actually have a high-resolution monitor, so I can't really see what the program looks like in regards to the problem we were originally trying to fix. I assume it does look better?
83
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by FuzzyJack on January 02, 2025, 06:22:14 AM »
Good find Luke,

Yes I can confirm that it works fine for me and creates the cache files in the AppData folder structure for my user as it should.

The firmware download still tries to use Program files of course but we should be able to use the QStandardPaths to find something like the downloads folder to do that as well and problem solved!

e.g.

QStandardPaths::DownloadLocation   14   Returns a directory for user's downloaded files. This is a generic value. If no directory specific for downloads exists, a sensible fallback for storing user documents is returned.

I've tweaked the SaveWebHexToLocal function to use the "writableLocation" of the Downloads folder and it works fine :-)

It still creates the firmware directory if it doesn't exist and deletes an existing copy of the file before saving it.   Obviously once it is in the downloads and used it is the responsbility of the user to delete it afterwards if they want to.

Which does beg the question of whether an uninstall should leave the AppData/Local/OpenPanzer folder hanging around or not so  I might see if the InnoSetup uninistaller would be able to remove that as part of the uninstall.  Probably leave the downloads alone though.
84
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by LukeZ on January 02, 2025, 06:04:41 AM »
The problem with %QDesktopServices::AppDataLocation% is that it appears to be deprecated so it's hard to test what exactly it thinks that should be. No doubt it's using the new QStandardPaths collection but the documentation hasn't been updated so that adds to the confusion.

But I had some ideas after sleeping on it. I tried a few things and got it working, and only after I got it working, did I find in the documentation where it would have told me how to get it working. 

If we empty the value in the XML cache directory element like this:  <cacheDirectory base="collection"></cacheDirectory>, or if we just remove it entirely (the documentation implies it's optional), then regenerate our .qch and .qhc files using the createqhcp.bat script of course, amazingly now Assistant works. But there is no subdirectory created in Program Files, I had to search high and low for where it had put the cache file, which turns out to be:
C:\Users\*username*\AppData\Local\QtProject\Assistant\

That's definitely a better place to put it, though not very intuitive.

Then I got to wondering why I had that strange attribute base="collection" in the XML tag. So I removed that attribute but left the rest, like this:
<cacheDirectory>OpenPanzer/OPConfig</cacheDirectory>
...and then regenerated and tried again. Guess what, now it sticks the cache file here:
C:\Users\*username*\AppData\Local\OpenPanzer\OPConfig\

Exactly what we want. I still didn't understand why that fixed it, but knowing what the problem was, I was able to find the answer. If we go to the same link I provided before, and scroll down even further, there is actually information about this base attribute. If it is specified as "collection", that tells it to create the cache file in a directory relative to where the original collection resides, which in our case is program files. If set to "default" or nothing, it goes to AppDataLocation. Not sure why I had used the first option, but that was ten years ago, what did I know then!

So that is cleared up. I committed a change to your repo, I would be grateful if you could test to verify that it really works!
85
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by FuzzyJack on January 02, 2025, 05:13:15 AM »
According to the docs you can specify the cache folder location in the configuration for the collection and QtAssistant is supposed to create the cache in the location supplied by %QDesktopServices::AppDataLocation%.

https://doc.qt.io/qt-6/assistant-custom-help-viewer.html

At the moment the cache is set to:

        <title>OP Config Help</title>
        <applicationIcon>images/helpicon_32.png</applicationIcon>
        <cacheDirectory base="collection">OpenPanzer/OPConfig</cacheDirectory>

But it is definitely not trying to create it in the appdatalocation unless something is overriding it?

Obviously another workaround for this issue (and the hex download) is to run op-config as Administrator it can then do what it needs to to create the cache files and the firmware folder without needing to manually grant permissions.

There must be a way to get the Qt App to work in a more security friendly way though.
86
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by FuzzyJack on January 02, 2025, 04:58:42 AM »
Damn...  Maybe I didn't try the help file from the proper install or something as I just reinstalled and tried it again and I get a failure too.  I could have sworn I checked the help after running the install but maybe I did it without running an uninstall first or something and already had permissions or an old copy of the folder?   Not sure.

Attached the error I got and if I grant write permissions to All Users on the help_files folder and restart then it can create the required files and works ok.

I must have missed it first time.
88
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by FuzzyJack on January 02, 2025, 04:45:47 AM »
Hmm yes it is strange I don't seem to have the problem but then I also have the Qt full installation on that machine.

If I get a minute I might launch a VM and see what happens with a clean build without Qt or Op-config already installed.  I did use the uninstall a couple of times during testing to remove the old one but a clean build might help.

Maybe I have done something different in the way I built the installation package using my little script that avoids that particular problem?   My install includes an extra "help" folder that your original install didn't have when I create it using windeployqt.

The only file in that directory is a helpplugin.dll file so I can't see how that would make a difference.

I have uploaded my setup.exe to a OneDrive folder and will provide a link so you could possibly try with that and see if it makes any difference?  Maybe I built it differnently somehow?  Maybe it's just windows security being a pain.

As you say, downloading the hex file to a more accessible folder (perhaps even the users download folder or provide them with a field to supply a location ought to be easy enough to work around that one.
89
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by LukeZ on January 01, 2025, 02:09:41 PM »
Hi Chris, I've wept and gnashed my teeth today and made some progress, all the ins-and-outs of which I won't bore anyone with. But I can compile the program, create a installation package, install it, and it seems to work.

I only have an Arduino Mega for testing, I don't have a TCB or even an RC radio. So for testing I am only able to confirm that I can connect to the processor (as you say, rather flaky this), load firmware, and read/write settings.

The problem I have yet to overcome and which I've given up on for today, is related to what you described as Blooming Windows Security, though in a different place.

The new version of Assistant (I am taking the assistant.exe from Qt\6.8.1\mingw_64\bin\, I assume this is what you did?) doesn't access the .qhc file directly that we so conveniently provide in the "help_files" folder, but rather as described on this page creates a copy of it in a "cache directory" which is a subfolder in "help_files," created when the Assistant is first called at runtime. Of course, "help_files" is a subdirectory of our program installation folder, and Windows does not permit the creation or modification of files within the Program Files directory, so this fails.

That link I provided tells us that we can modify the cache directory if we want, in the XML .qhcp file. However, that doesn't help us, it just changes the name of the cached subfolder, which will always be in the same folder as our .qhc file, it doesn't refer to an absolute path somewhere. Even if it did, there is no way I can see to point it to something like the Windows environment variable %LocalAppData% because this is an XML file and not a script, so that variable is not going to be parsed (I tried).

You'd think this would be a problem for the whole world but Google has not shown me other users who've struggled with this same issue. Maybe no one is using Assistant.

It seems strange you would not have experienced this same thing? Assistant works fine when I'm running from the debug/release folder created by QT Creator, because there we don't have file write permissions, but once installed in Program Files it doesn't.

The good news is it will not be a problem to divert our downloaded Hex files into the user appdata folder, though I haven't yet made that change.

I committed some changes to your fork (strangely I seem to have the permissions to do so), these are just fixing some fonts and formatting that seem to have been changed by the new Qt Creator.
90
TCB Dev / Re: OP-Config Qt 6 upgrade
« Last post by FuzzyJack on December 31, 2024, 04:35:46 PM »
For the upgrade I just used the Qt Maintenance tool to install the 6.8.1 version and specifically adding the QSerialPort extra.
Pages: 1 ... 6 7 8 [9] 10