當你的軟體運行在 wine 上時,如何處理 google chrome 外部協定?

當你的軟體運行在 wine 上時,如何處理 google chrome 外部協定?

我的問題是這樣的:我有一個與 Wine 一起安裝的軟體(Brain Explorer 2,免費);軟體的某些功能需要使用瀏覽器(在本例中為 google chrome;firefox 不是選項,因為這需要 flash 播放器...)。然後,Explorer 開啟瀏覽器。當你瀏覽網站時,有一個選項將資料從瀏覽器載入到軟體,然後瀏覽器請求外部協議艾貝:連結(我想 aib 是 Allen Institute Brain Explorer 的意思),最終以啟動 xdg-open 結束,據我所知,它處理預設應用程式。

基本上這就是發生的事情

所以我想必須嘗試配置 aibe 連結的預設應用程序,但老實說我迷路了。我想到的最多的是類似磁力連結與種子。當然在windows上就不存在這樣的問題,因為是專門為它設計的。但是我如何在 Ubuntu 上實現這一點呢?

答案1

使其發揮作用:

  1. 跑步gedit ~/.local/share/applications/allen-brainexplorer.desktop
  2. 將會開啟一個文字編輯器。將以下內容貼到其上:

    [Desktop Entry]
    Name=Brain Explorer 2
    Exec=wine "%ProgramFiles%\Allen Institute\Brain Explorer 2\BrainExplorer2.exe" "/url" "%u"
    Type=Application
    Terminal=false
    MimeType=x-scheme-handler/aibe;
    
  3. 儲存檔案並關閉文字編輯器。
  4. 執行以下命令將新建立的檔案「安裝」到系統中:

    xdg-desktop-menu install ~/.local/share/applications/allen-brainexplorer.desktop
    
  5. 當瀏覽器提示您如何處理此類連結時,選擇運行應用程式

我是如何得到它的:

我已經在 Windows XP 虛擬機器上安裝了 Brain Explorer 2,這樣我就可以打開 regedit 並找到該金鑰:

HKEY_CLASSES_ROOT\aibe\shell\open\command

該鍵包含以下內容:

"C:\Program files\Allen Institute\Brain Explorer 2\BrainExplorer2.exe" /url "%1"

這意味著該/url選項允許將 URL 傳遞給 BrainExplorer。例子:

wine "/home/$USER/.wine/dosdevices/drive_c/Program files/Allen Institute/Brain Explorer 2/BrainExplorer2.exe" /url "aibe://human.brain-map.org/mri_viewer/data/heatmap/probe_values?atlas=351&resolu‌​tion=samples&probes=1036443&selectedDonor=9861&well=2569&colormap=redgreen&exprRa‌​nge=-6,6"

相關內容