为 wine/heidisql 创建 Mac 启动器脚本时出现问题

problem creating Mac launcher script for wine/heidisql

好的,mac 脚本对我来说是全新的,我不知道如何调试它。

我已经从 pkg(不是从 brew 等)安装了 wine,并用 wine 安装了 heidisql。

按照说明,我在 mac 脚本编辑器中创建了它,将其另存为 "application" 并将其复制到 Applications 文件夹。

注意:我可以通过 运行ning "wine stable" 在启动器中 运行 heidisql,然后输入

wine "$HOME/.wine/drive_c/Program Files/HeidiSQL/heidisql.exe"

不起作用的脚本:

on run

    --edit this to be the correct location and file to run (typically only edit after the "drive_c")
    set toRun to "$HOME/.wine/drive_c/Program Files/HeidiSQL/heidisql.exe"

    --edit winePrefix if you are not using the default prefix
    set winePrefix to "$HOME/.wine"

    --edit wineLocation if your wine install is not the default location
    set wineLocation to "/usr/local/bin"

    --edit dyldFallbackLibraryPath to your X11 lib folder, this one is set for XQuartz on 10.6+
    set dyldFallbackLibraryPath to "/opt/X11/lib"
    -------------------------------------------------------
    --DO NOT EDIT ANYTHING BELOW THIS LINE
    -------------------------------------------------------
    set toRunPath to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
    set toRunFile to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; TEMPVAR2=\"" & toRunPath & "\"; echo \"${TEMPVAR#$TEMPVAR2/}\""
    do shell script "PATH=\"" & wineLocation & ":$PATH\"; export WINEPREFIX=\"" & winePrefix & "\"; export DYLD_FALLBACK_LIBRARY_PATH=\"" & dyldFallbackLibraryPath & "\"; cd \"" & toRunPath & "\"; wine \"" & toRunFile & "\" > /dev/null 2>&1 &"

end run

但是,当我 运行 在应用程序文件夹中双击应用程序脚本时,它会在任务栏中闪烁脚本图标,然后什么都不做。知道出了什么问题,或者如何调试吗?

最终解决方案。 "which wine" 找出安装程序放置它的位置,并在脚本中替换了 /usr/bin/local。

on run

    --edit this to be the correct location and file to run (typically only edit after the "drive_c")
    set toRun to "$HOME/.wine/drive_c/Program Files/HeidiSQL/heidisql.exe"

    --edit winePrefix if you are not using the default prefix
    set winePrefix to "$HOME/.wine"

    --edit wineLocation if your wine install is not the default location
    --  set wineLocation to "/usr/local/bin"
    set wineLocation to "/Applications/Wine Stable.app/Contents/Resources/wine/bin/"

    --edit dyldFallbackLibraryPath to your X11 lib folder, this one is set for XQuartz on 10.6+
    set dyldFallbackLibraryPath to "/opt/X11/lib"
    -------------------------------------------------------
    --DO NOT EDIT ANYTHING BELOW THIS LINE
    -------------------------------------------------------
    set toRunPath to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; echo \"${TEMPVAR%/*}\""
    set toRunFile to do shell script "WINEPREFIX=\"" & winePrefix & "\"; TEMPVAR=\"" & toRun & "\"; TEMPVAR2=\"" & toRunPath & "\"; echo \"${TEMPVAR#$TEMPVAR2/}\""


    do shell script "PATH=\"" & wineLocation & ":$PATH\"; export WINEPREFIX=\"" & winePrefix & "\"; export DYLD_FALLBACK_LIBRARY_PATH=\"" & dyldFallbackLibraryPath & "\"; cd \"" & toRunPath & "\"; wine \"" & toRunFile & "\" > /dev/null 2>&1 &"

end run