navicat-patcher.sh 893 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. cd `dirname "$0"`
  3. navicat_root=`pwd`
  4. # Wine environment variables
  5. WINEDIR="wine"
  6. export LANG="en_US.UTF-8"
  7. export PATH="$navicat_root/$WINEDIR/bin":"$navicat_root":"$navicat_root/$WINEDIR/drive_c/windows":"$PATH"
  8. export LD_LIBRARY_PATH="$navicat_root/$WINEDIR/lib":"$navicat_root/lib":"$LD_LIBRARY_PATH"
  9. export WINEDLLPATH="$navicat_root/$WINEDIR/lib/wine"
  10. export WINELOADER="$navicat_root/$WINEDIR/bin/wine64"
  11. export WINESERVER="$navicat_root/$WINEDIR/bin/wineserver"
  12. export WINEPREFIX="$HOME/.navicat64"
  13. export WINEDEBUG=-all # suppress all wine debug info
  14. # 将斜线替换为反斜线
  15. navicat_root_back_slash=${navicat_root//\//\\}
  16. # 前缀
  17. prefix='Z:\'
  18. # 后缀
  19. suffix='\Navicat'
  20. # wine环境中的navicat路径
  21. navicat_path="$prefix$navicat_root_back_slash$suffix"
  22. # wine执行navicat-patcher.exe
  23. exec "${WINELOADER:-wine}" "navicat-patcher.exe" "$navicat_path"