I’m using FolderItem to determine if Microsoft Word Is installed or not and I have the following :
[code]AppFile = SpecialFolder.Applications.Child(“Microsoft Word.app”)
If AppFile.Exists Then …[/code]
Now , while debugging comes the weird part
AppFile in Mojave comes in [quote]/Applications/Microsoft\ Word.app[/quote] while in Catalina the same code gives me that SpecialFolder.Applications is in [quote] AppFile ShellPath : /System/Applications/Microsoft\ Word.app[/quote]
now, did MacOS changed the paths or the paths were changed in the latest XOJO and Documentation was not updated ? As in the language reference we still have SpecialFolder.Applications in /Applications and not in /System/Applications
Testing systems : macOS 10.14.6 (18G2022) where it works and macOS 10.15.2 (19C57) where it does not work.
Gosh, I with we had again all proper and unified as it supposed to be and as it was, now we face another mess.
App.ExcutableFile.Parent should be in the right Applications folder
You’re assuming that the app (that is doing this “check”) is being placed there.
Not for DebugBuilds. Not what many users are doing (unfortunately - they might create a folder “Microsoft Office” inside the Applications Folder, whatever). Not in case of your application being in Translocation, or in the per-user application folder, …
So just: no.
Here are a couple of possibilities
I strongly recommend to find it by BundleIdentifier:
I’ve just had the most innovative idea of this decade!
We need a centralized and single Applications directory, where users can store all of their installed applications, and if they choose to do so, delete all the crappy ones that they’ll never use (looking at almost all the apps Apple now includes).
How amazing would that be?
So when y’all going to vote me in as CEO of a certain fruit company?
Thanks Jürg, while that was working I guess I can push and update now, for Sam, it’s nice to have some jokes and humor on the post but unfortunately I cannot say same thing about the angry customers that wake up that the app does not work anymore on the part where they depend the most of it specially in our sector so I cannot joke on this side.
Thanks all for that.
It’s all I’ve got left! I’m almost constantly where you are, one "bug’ in macOS 10.14 eluded me until last week, where it finally occurred on my own machine. I had wasted so much time trying to fix this bug, but until I could actually reproduce it. Time has become more precious in the last few years, because I have to invest so much of it trying to keep up with rabid Apple. It’s also why I am not going to bother with API 2.0 at the moment.
Lets be honest here; how on earth does having multiple “Applications” folders actually benefit anyone. It doesn’t. It doesn’t stop the apps that Apple include becoming vehicles for viruses. What it does is make it harder for the average Joe to delete the apps that he doesn’t want or need from his computer.
I’m glad that you found a solution, Aurelian, but you’re just now seeing the tip of the mess that Apple is creating with APFS and the Union Mounts.
Nope - it just makes it harder to delete them …
A bit off track, but we just had another major post production team who have been Apple-only since their company startup jump ship and head to Linux and Windows. The “new” Mac Pro was that final straw. Between having to put $10K into a new Mac Pro when a similarly configured PC to run Windows or Linux is only $5K, and macOS becoming so restrictive and more like iOS, they’d had enough. The cool thing is that they can convert their Mac Pro 5,1’s and Mac Minis into Linux servers and keep them in use for storage farm management.
@Aurelian Negrea, if this is the first of these that you’ve run into, you might want to open a running tab at your local pub!
the right way to find if Word is installed is to search for its bundle identifier not by a specific path
I have always used this function (adjusted from MacOSLib), and I thought that it’d return the specific app wherever it is; but I could be wrong. In such case, please correct me.
The bad news is that “absolutePathForAppBundleWithIdentifier” is flagged as Deprecated on the AppleDocs (SDK - macOS 10.010.15 - Deprecated).
Maybe someone could suggest what to use as replacement of the deprecated item…
dim f as folderitem = getFileFromBundle(com.apple.Maps)
[quote]Public Function getFileFromBundle(bundleID as String) as FolderItem
declare function NSClassFromString lib “Foundation” (clsName as cfstringref) as ptr
declare function sharedWorkspace lib “Foundation” selector “sharedWorkspace” (clsRef as ptr) as ptr
declare function absolutePathForAppBundleWithIdentifier lib “Cocoa” selector “absolutePathForAppBundleWithIdentifier:” _
(obj_id as Ptr, bundleIdentifier as CFStringRef) as CFStringRef
dim bundlePath as string = absolutePathForAppBundleWithIdentifier(sharedWorkspace(NSClassFromString(“NSWorkspace”)), bundleID)
dim bundleFile as FolderItem
if bundlePath <> “” then
bundleFile = getFolderItem(bundlePath, FolderItem.PathTypeShell)