File permissions & install dir mess with Examples (what else?)

Are you ready for crazy?

I have struggled to get xojo working on Linux Mint 20 because of a dependency issue (heaps of stuff on that elsewhere and I’ll probably post something about that later, but that is a whole other issue).

You may or may not believe this, so I made a video!

It comes down to WHERE ARE THE EXAMPLE FILES BEING LOADED FROM???

How can I possibly tell? Because what I’m seeing is just UNBELIEVABLE.

SOMEHOW I have TWO sets of example files (I actually have a lot more than that, but they’re all duplicates)… Except the example files that are started from the desktop, and where the hell they are coming from is anyone’s guess. I am going to make a new video right now (since the last one was too long, and unfortunately I don’t have a microphone on this computer, so you’re going to just have to follow along with what’s detailed below.

When I originally installed 2019R3.2 onto Mint, a lot of the projects just didn’t work, they had the wrong event types associated with them. I worked out I could fix it and they would work. But I don’t think that changes the actual Example files, it only changes them in memory until you save it and then it saves it in whatever location you save them to. All good so far?

I’ve installed pre-release (and this seems to have included newer and updated example files, because all of a sudden they work in pre-release. Well, that’s to be expected.

But then I open 2019r3.2 AND THEY WORK! ???

So now, 2019r3.2 EXAMPLES WORK, they didn’t before.

So now I want to hash the files and the copy of the files in the /opt/xojo2019r3.2 directory hash identical to the ones I have saved off elsewhere.

SAME HASH, but one set works and one doesn’t??

In the video there are two sets of Example Files, those in /opt/xojo2019r3.2 and those in BACKUP/xojo2019r3.2-good

THEY HASH IDENTICAL:

dave@redmint:~/$ md5deep /opt/xojo/xojo2019r3.2/Example\\ Projects/Games/2K/2K-Desktop.xojo_binary_project
654ecdcf1d78982a8f97eee927426c4b  /opt/xojo/xojo2019r3.2/Example Projects/Games/2K/2K-Desktop.xojo_binary_project
dave@redmint:~/$ md5deep /home/dave/BACKUP/xojo2019r3.2-good/Example\\ Projects/Games/2K/2K-Desktop.xojo_binary_project
654ecdcf1d78982a8f97eee927426c4b  /home/dave/BACKUP/xojo2019r3.2-good/Example Projects/Games/2K/2K-Desktop.xojo_binary_project

They’re the same example file, yeah?

Well, they’re not (I believe they are, I think the issue is where /opt/xojo loads it’s examples from, but I can’t work out how to tell, anyway, let’s continue).

The executables are the same in the two directories:

dave@redmint:~/$ md5deep /opt/xojo/xojo2019r3.2/Xojo
9dff7c3478a632acf1e099f4eccdaf83  /opt/xojo/xojo2019r3.2/Xojo
dave@redmint:~/$ md5deep ~/BACKUP/xojo2019r3.2-good/Xojo
9dff7c3478a632acf1e099f4eccdaf83  /home/dave/BACKUP/xojo2019r3.2-good/Xojo

These are the commands I will be running in the video:

    # This one will work
    ~/BACKUP/xojo2019r3.2-good/Xojo ~/BACKUP/xojo2019r3.2-good/Example\\ Projects/Games/2K/2K-Desktop.xojo_binary_project

    #This one will not work
    /opt/xojo/xojo2019r3.2/Xojo /opt/xojo/xojo2019r3.2/Example\\ Projects/Games/2K/2K-Desktop.xojo_binary_project

When I load the project up, check the file path of the example file in the middle right of the dialog. Also check the version number of the IDE in the bottom right corner (it is the same version of the IDE)

If you can see where the example projects are different, please let me know :slight_smile:

I BELIEVE I know where the error is coming from, but Xojo is not making it easy. It is REPORTING one thing to the user, but using something else from somewhere else*. How can I debug that?

I do apologise, I have a 4K monitor and dual screen, I’ve only recorded one screen, but xojo repeatedly opens up on the other one (that’s another bug, the IDE opens on one screen, but the open project dialog appears on the other screen. I’ll file feedback for that)

The video is uploading, hopefully by the time I hit send on this post, the video will be uploaded.

Hopefully someone can tell me what’s going on.

Buckle up and grab some popcorn:

  • When the video starts, I begin by showing all the hash values, they appear above anyway, so if you want, jump forward to 1m30 and watch me open the IDEs
  • 1m25 I open /opt/xojo example project, and drag it to the screen
  • 1m34 I open the BACKUP IDE and drag it to the screen
  • 1m55 I am opening the Event handlers for the first IDE, they are the wrong API version
  • 2m01 I open the other event handlers for the second IDE
  • I then open the event handlers for the button and you see “Pressed” vs “Action”
  • 2m40 I open the “Choose a project Dialog” and you can see it’s location
  • 3m05 I do the same for the second IDE
  • 3m30 I am trying to point out the version of the IDE (bottom right corner)

I’m guessing this is only a problem on linux.

And I just realised I didn’t actually run the applications in each IDE, but you can take it that with the incorrect event handlers, the one on the left doesn’t work. But according to the hashing, the one on the left and right are both equal!

  • I have a strong suspicion they are coming from the pre-release folder, because it was after installing that in it’s own folder, but in /opt/xojo/ as well, But Xojo IDE is reporting they are two different files, but I confirm they are the same hashes, ie they are the same file.

How this came about, I was trying to prove/disprove something to myself. I had the folder of good examples that worked and when I copied them to the /opt/xojo/xojo2019r3.2 folder, they didn’t work. I copied them out of there and put them into my home dir and they worked. So I hashed them and …

Am I going insane?

I am happy to submit a feedback issue, but I don’t know what I am actually reporting as the bug (oh and my feedback has stopped working too) :frowning:

OK, not solved, but I’m sure someone will understand why, it’s just not me.

  • This is 100% reproducible.
  • This is weird! I know there must be a reason for it, hopefully there’s enough info here for Xojo to solve it.

The problem:

I have had a mix and match of Example Projects where the API calls are all wrong. I would apparently open the same file but it would result in Xojo IDE loading in the wrong Event Handlers.

Steps to reproduce:

  • start up a VM, I used Linux Mint 20 in Virtual Box 6.1.12
  • (now that I think about it, I did no even do a sudo apt update && sudo apt upgrade I just got straight into it)
  • Get the latest xojo2019r32.tgz (as at this writing) onto the system. You could download it, however, I just shared the folder and installed it directly.
  • INITIALLY I stuffed up and installed the tgz file in home
    tar -zxvf Downloads/xojo2019r32.tgz
  • Once I realised this, I just left it there and thought I would test the install:
    xojo2019r3.2/Xojo to my surprise the project had the correct Event Handlers (I use the 2048 Desktop Game as my test, however there are other, eg the button event handlers on the SQLiteBackup demo, also fail)
    rm -rf [Xx]o* (do it, you know you want to) :slight_smile:
  • now install to /opt:
sudo mkdir /opt/xojo
cd /opt/xojo
tar -zxvf ~/Downloads/xojo2019r32.tgz
  • Now when you run Xojo (I was doing it from the command line, but I also used the .desktop launcher as well, create:
    sudo nano /usr/share/applications/xojo2019r3.2.desktop
  • and paste in the following:
[Desktop Entry]
Encoding=UTF-8
Name=Xojo 2019r3.2
Name[en_GB]=Xojo 2019r3.2
Comment=Xojo 2019 Release 3.2
Comment[en_GB]=Xojo 2019 Release 3.2
Exec=/opt/xojo/xojo2019r3.2/Xojo %F
Icon=/opt/xojo/xojo2019r3.2/xojo.xpm
Terminal=false
Type=Application
MimeType=application/vnd.xojo.project.binary;application/vnd.xojo.project.normal;application/vnd.xojo.project.xml
Categories=Development;Programming;Building;IDE

When you launch it from there, you will find the event handlers are of the wrong type.

Recap:

Depending on how you load the example project file and from what location, Xojo determines what the event handlers should be and processes the project file differently.

Solution:

I don’t have any real idea, it’s going to come down to how or why Xojo handles the project file and why it would want to process it differently. If I had to guess, it is going to be permissions related as Xojo installed in /opt has a different set of user/group permissions. Works and is fully functional, just functions differently!

In the meantime, I had followed the instructions (that are a little tricky to find IMO) here: https://documentation.xojo.com/resources/system_requirements_for_current_version.html_2019r2#Installing_tar_on_Fedora.2FCentOS.2FSuSE

I would suggest people don’t follow that and in fact install it somewhere else and then create a custom desktop file accordingly

I can now put this to bed

edit: but I didn’t just put it to bed, I just thought, what the hell, let’s just try…

if you change the permissions on the xojo install, the project loads with the correct Event Handlers!

Same Project Files, same location, just change the permissions.

Xojo changes the event handlers on them!!

1 Like

I thought I would put a shoutout to the following people because you either gave me some info along the way, or felt you might want or need to know.

@TimStreater @MarkusR @Tim_Jones @Norman_Palardy @Jason_Parsley @Greg_O𖽑Lone for note.

why don’t you move this to the Linux subform? For anyone looking for help, that’d be the place to look. Also, change the title to somethingt that helps identifying this when browsing the forum, like “Installing the Linux IDE so that Events are not messed up”.

1 Like

Good point. Keep in mind this has been a protracted and difficult problem to resolve (at least it was for me) and the form of problem kept changing, meaning, when I started down this rabbit hole, I had no idea why the example files were being mishandled by Xojo (and we still don’t, until Xojo get to the bottom of it).

But good point and I have done both!