Как создать простой установщик kext с AppleScript в Xcode? - PullRequest
0 голосов
/ 27 декабря 2018

Может кто-нибудь сказать мне, как я могу создать простой установщик Kexts, используя AppleScrit в Xcode?Я пробовал следующее:

on installKext:sender  
choose file
copy the result to thisFile
copy the (info for thisFile) to fileInfo
copy the name extension of the fileInfo to nameExtension
copy the file type of the fileInfo to filetype
tell application "Finder"
    if the filetype is "Kext" or ¬
        the nameExtension is "Kext" then
        move thisFile to folder "Extensions" of folder "Library" of folder "System" of startup disk
    end if
end tell
end installKext:

У меня есть эти ошибки:

installKext:]: не авторизован для отправки событий Apple в Finder.(ошибка -1743)

Ошибка домена = PlugInKit Code = 13 "запрос отменен" UserInfo = {NSLocalizedDescription = запрос отменен}

Ответы [ 2 ]

0 голосов
/ 02 января 2019

Вы должны добавить в info.plist следующее: enter image description here теперь все работает как шарм.

0 голосов
/ 27 декабря 2018

Вы не можете перемещать файлы с помощью Finder в папки, которые принадлежат системе.

Вам нужны права суперпользователя, например, с do shell script .... with administrator privileges

on installKext:sender  
    set theFile to choose file
    tell application "System Events"
        set {name extension:nameExtension, file type:fileType} to theFile
    end tell
    if fileType is "Kext" or nameExtension is "Kext" then
        do shell script "mv " & quoted form of POSIX path of theFile & space & "/System/Library/Extensions/" with administrator privileges
    end if
end installKext:
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...