Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

macos - I am unable to install my extension to safari from commandline (OS X 10.5.8 Safari 5+)

Hi I am unable to install my extension to safari from commandline (OS X 10.5.8 Safari 5+)

In my postinstall script for PackageMaker.app, first i am coping my extension to "/tmp/my-product/" and then i am running this $ sudo /Applications/Safari.app/Contents/MacOS/safari /tmp/my-product/my-extension.safariextz

This temporarily puts the extension in safari, but on closing safari the extension vanishes.

Console.app shows this in system.log

*12/07/10 12:45:22.158: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.163: 9387 [WARNING] ***** SQL error opening database: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.219: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.219: 9387 [WARNING] SQLite::Exception "SQLITE_CANTOPEN[14.0]: Database file not found" caught in static void PubSub::ClientCore::openClientSession()
12/07/10 12:45:22.219: 9387 [WARNING] std::exception "St9exception" caught in PSClient* +[PSClient clientForBundleIdentifier:](objc_object*, objc_selector*, NSString*)
12/07/10 12:45:22.220: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.220: 9387 [WARNING] ***** SQL error opening database: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.276: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.276: 9387 [WARNING] SQLite::Exception "SQLITE_CANTOPEN[14.0]: Database file not found" caught in static void PubSub::ClientCore::openClientSession()
12/07/10 12:45:22.276: 9387 [WARNING] std::exception "St9exception" caught in PSClient* +[PSClient clientForBundleIdentifier:](objc_object*, objc_selector*, NSString*)
2010-12-07 12:45:22.276 Safari[9387:a0b] WARNING: BookmarkedFeedsManager couldn't get PSClient!
12/07/10 12:45:22.278: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.278: 9387 [WARNING] ***** SQL error opening database: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.334: 9387 [WARNING] SQL Error: SQLITE_CANTOPEN[14.0]: Database file not found
12/07/10 12:45:22.334: 9387 [WARNING] SQLite::Exception "SQLITE_CANTOPEN[14.0]: Database file not found" caught in static void PubSub::ClientCore::openClientSession()
12/07/10 12:45:22.334: 9387 [WARNING] std::exception "St9exception" caught in PSClient* +[PSClient clientForBundleIdentifier:](objc_object*, objc_selector*, NSString*)*

Is it a permission issue?

I am stuck here :(

Please suggest.

Thanks in advance

Regards

Parimal Das

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I imagine part of the problem is that you're running Safari as root. There's no reason to do this and in fact it's rather unsafe.

Ideally you just open the extension (with open or AppleScript, for example), which prompts the user to install the extension. If you're trying to do an unattended installation, this isn't terribly helpful though.

If you're just doing this for in-house deployment and don't mind if it breaks on a Safari upgrade, then you can quit Safari, install the extension into ~/Library/Safari/Extensions and update ~/Library/Safari/Extensions/Extensions.plist (the format is rather obvious; /usr/libexec/PlistBuddy is useful for such things).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...