2012-11-30 43 views
2

我想以編程方式安裝AdobeFlashPlayer,在此之前,我需要chk是否已安裝?如果是,那麼我需要獲取相同的版本。由於Flash播放器將作爲插件添加,因此我需要在Safari和Firefox瀏覽器中同步播放。請建議如何使用Applescripts實現相同(如果可能,不使用SWFObjects)。如何使用Applescript或Java檢查安裝在Mac上的Adobe Flash Player?

+0

你想在safari瀏覽器中安裝flashplayer插件嗎? –

+0

是的..我仍然困惑,我不知道是否Flash Player插件將被安裝在瀏覽器或系統? –

回答

2

在Mac上,瀏覽器插件安裝在名爲「Internet Plug-Ins」的文件夾中。您可以在用戶的​​Libray文件夾或主庫文件夾中包含此文件夾。因此,使用蘋果腳本,我們可以檢查這些文件夾...

set pluginName to "Flash Player.plugin" 
set pluginsMainFolder to (path to library folder from local domain as text) & "Internet Plug-Ins:" 
set pluginsUserFolder to (path to library folder from user domain as text) & "Internet Plug-Ins:" 

-- check the folders and get the version if found 
set theVersion to missing value 
tell application "System Events" 
    try 
     set f to first file of folder pluginsMainFolder whose name is pluginName 
     set theVersion to short version of f 
    end try 
    if theVersion is missing value then 
     try 
      set f to first file of folder pluginsUserFolder whose name is pluginName 
      set theVersion to short version of f 
     end try 
    end if 
end tell 

if theVersion is missing value then 
    display dialog pluginName & " is not installed!" 
else 
    display dialog pluginName & " is installed!" & return & "Version: " & theVersion 
end if 
+0

thanku這解決了我的問題 –

0

的Shockwave Flash插件將被安裝在瀏覽器中運行下面的一段代碼,找出安裝在瀏覽器插件列表

for(var i = 0; navigator.plugins[ i ]; ++i) { 
     if(navigator.plugins[ i ].name.toLowerCase().indexOf(name) > -1) 
     console.log(navigator.plugins[ i ].name); 
    } 

的Adobe Flash播放器將被安裝在系統中,以及你可以檢查你的系統安裝程序

+0

thanku這幫了我 –

相關問題