Serious Launch Services Issue: Warning and solution

I’ve just had the embarrassment of realizing that my latest update approved by Apple is actually breaking Launch Services on customers machines.

In the past I have added PDF and Photoshop documents as supported documents within my application, setting their roles as “Viewer” only. This has allowed users to drop these files onto my app’s icon in the dock and open them.

However with 2015r2.x, Xojo is adding the UTI types as exportable to my application, which is causing corruption of the launch services database on users machines. The main issue is that PDF files are no longer viewable from within Apple’s preview. On our machines, preview refuses to open PDF files and when double clicked open in Photoshop. I’ve been blaming Adobe and complained about this. I didn’t realize that it was my application causing this issue.

I’ve filed a bug report feedback://showreport?report_id=40907

If your application supports PDF in anyway, please make sure that you do not select the checkbox in the OS X File Types dialog. The user will still be able to open the files from within the application, but no longer drag and drop onto the dock icon.

Just so that you understand, I’m very embarrassed and frustrated about this bug, although I’m not blaming Xojo. I’ve posted here because I want everyone to take note and make sure that they don’t cause problems for their users like I have.

How can you corrupt the Launch Services database with an UTI? Sounds more like an Apple problem.

Something like that would never happen to me.

Cough, cough…

I believe it is an Apple problem, it shouldn’t be allowed to happen, but it does and I’ve filed a bug report with Apple also. The trouble is, this problem is very frustrating (especially as Photoshop is the worst tool to open PDFs with, and the open with menu never shows Preview after the corruption).

That’s exactly what I thought, I thought it was adobe and filed a bug report with them also. I didn’t realize until a customer wrote to me this morning and upon investigation I found that he was right. It wasn’t Adobe, it was my app that was causing the corruption!

That was a joke.

Found out in the last days that my application writes some files with a BOM where no BOM should be. I don’t know what my users do, but they seem never to have checked the written files in the last half year or so. At least removing the BOM is relatively easy. Will need to confess to my users in the next days.

i have been having problem with opening pdf in preview (keep opening in adobe reader). Usually all i need to do is this statement on Terminal but for some reason does not work today after trying twice.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed

[quote=214988:@Richard Duke]i have been having problem with opening pdf in preview (keep opening in adobe reader). Usually all i need to do is this statement on Terminal but for some reason does not work today after trying twice.

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed [/quote]
Have you tried to “Show info” in Finder and select the app to open it with? Don’t forget to click on the button to use for all files with that extension. :slight_smile:

The problem I faced this morning is that “Preview” no longer shows up in the list and if you drag and drop a PDF on the dock icon, preview won’t open it, nor will it open it from the Open dialog.

try that… does not work either

Here’s the first beta of “Preview Reset”, which should help track down any other applications on your machine that are messing with Apple’s Preview. When the reset button is clicked, it moves them to the trash, resets Apple’s Preview and then rebuilds the Launch Services database.

In our tests, once the apps have been moved to the trash, there isn’t even the need to restart the machine.

http://www.ohanaware.com/previewreset/previewReset.zip

I have now created a support document on this topic, and modified App Wrapper so that it will catch public UTIs in the Exported List and move them to the imported list (or delete them if they already exist in the imported list).

http://ohanaware.com/support/index.php?article=how-not-to-break-preview.html

It`s a common issue that apple keeps spitting on every update or so, it happened to me one year ago, half year ago again and so on, filed reports and after a while they fixed the issue until recently i guess around one week ago when preview starts crashing again,

It seems that it is related to pdf as my safari keeps crashing the whole machine can causing restarts some times due to that.

So far disappointed on apple, i guess they got more focused on the new apple watch or whatever stupid things they are releasing than on the latest issues. Result, preview crash, IOS crashes and so on, either the people are leaving from them or they became lazy and they don`t know what to do with the money anymore or just , not interested anymore.

They become more and more like microsoft.

As the problem seems to be a bug in Xojo your comment is rather silly …

Well silly not silly it’s the truth, if you come withe the same bug again 2 times let’s say it’s understandable , a glitch but when you brake the same issue again and again that is already incomptetence, only me i counted 5 times in a year, and only when i faced the issue but who knlows how many times the issue repeted, once you have bugreports and a lot of them are closed because are duplicate i guess the issue is big and you have to fix it, well it happens again and again, so, you give a better answer to my silly answer please, i was in your position 3 times, i know the feeljng, luckilly i had kind customers that understood the issue and i had to give them snapshot of the bug reports and case numbers from apple.

Take care and hopefully it will be fixed soon… again.

I would consider this a bug with Xojo as it’s placing the UTIs in the wrong location in the plist file; but I would also consider this a bug in the OS as even with the UTIs in the wrong location it shouldn’t break Apple’s Preview. It suggests to me that Apple are doing something special (non-standard) for Preview, that just happens to be a fragile solution.

They’ve taken my bug reports very seriously and I’ve provided them with as much information on the situation as possible.