2 Questions about Targeting Windows 7

  1. While this isn’t specifically a XoJo question, when I copy my XoJo App to a Windows 7 VM, double click to run, it launches twice. A bit strange but can cause issues if the app wants to work with files right away.

  2. Are there some known issues revolving around reading and writing files in XoJo running in Windows 7?

Yes I know, Windows 7 is not supported my MS anymore, but writing for the various versions makes sense when possible. I’ve tried compiling for 32 Bit and 64 Bit, but still seeing issues with Windows 7.

Does it happen with notepad if you copy a shortcut next to your xojo app? I’ve not seen this happen with the W7 vm’s I have here. What version of xojo are you building your app with?

Do you mean to create a short cut to notepad in the the XoJo App’s folder? I did try that with a small test app just now and it did not launch twice. However, even my XoJo app stops launching twice after it happens on the first run.

While that’s irritating, the even bigger issue is my second question about XoJo issues and Windows 7 working with files.

I have the latest version of XoJo 2021 3.1 and using API 2. Unless I find a reasonable solution for these problems, I’ll likely choose to not support Windows 7 going forward.

Yes

Interesting, I don’t have a build option for latest so I can’t test and help you there sorry, maybe someone else can?

What issues are you seeing?

Most file read or write operations using FolderItem are getting NilObjectException and the program crashes. The same exact code works great on Mac and Linux and Windows 11

Are you building this in the W7 vm or elsewhere? If you are building it in the vm, does the Ide exhibit a similar behaviour, because that will use the same underlying calls as your program.

I’m building all my apps on my Mac. I only VMs for testing.

Hopefully someone else with a similar setup can help you Steve, sorry I can’t as it could be issues with the way the mac is building the exe’s which I can’t test as I don’t have a valid licence.

Have you tried copying it all across to the vm and running a build in native windows and seeing if there’s any difference?

I have not tried that. I’m keeping my license on the Mac since most everything else I do works. I may try running the code within the IDE there and see what happens.

Until last week, all my Windows work was done on a Windows 7 box.
Windows 7 has no issues with folderitem work.

What CAN cause trouble:
Virus Checkers stop you writing at all if they dont like your app.
You are not allowed to write a file in the program files folder.
If you are using a VM, and share your documents or downloads folder, you may be trying to write on a different machine than the one you believe you are doing.

The same exact code works great on Mac and Linux and Windows 11

How are you ‘getting’ the folderitem?

I turned off my Virus checking and it still had problems. I’m not putting the data in the program files area, I’m storing it in the documents folders. I’ve already verified that I’m not writing to a shared folder, it’s on the VM’s local drive space.

As far as how I’m getting the folderitem, I’m using the standard methods documented for XoJo. I’m not sure that’s really relevant in this situation since the build works on other Windows versions as well as Linux and MacOS. There’s obviously something wrong with my Windows 7 setup, I just haven’t found it yet. It’s not a high priority right now, I’ll either figure it out or not target Windows 7 unless I find the solution.

Thanks for your suggestions Jeff!

Well it turns out that I also had Avast running and not fully disabled. After turning off Windows Firewall and uninstalling Avast, my problems have vanished! This is good to know because didn’t want to exclude Windows 7 from my builds. Thanks Jeff and Julian for all of the suggestions! I would have never expected Avast from keeping me from writing to the documents folders.

1 Like

Avast is a nuisance.

Yep, it used to be pretty decent, but now it’s always in sales mode. And not being able to write to the My Documents folder is absolutely absurd in my opinion. I even tried marking that as an exception and it still didn’t like it. Problem resolved after it was uninstalled.

Having got a FolderItem, are you checking it for Nil before using it? If it’s Nil, issue a polite message to the user and return.

Thanks Tim, past all that. It was Avast Antivirus.

Mmmmmyes, but checking for Nil is still important.

2 Likes

I agree, I was using it, but I just went through my code and added it in some areas where I’d neglected to use it.

Well both of my issues have been resolved by removing Avast Antivirus. No more double starting of the apps. All file issues are gone too!

2 Likes

Anti-virus, the best virus a computer can have :wink:

2 Likes