Advertisement
hyperfang8

PlayOnLinux Jade Dynasty

Nov 18th, 2012
1,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.75 KB | None | 0 0
  1. #!/bin/bash
  2. # Date : (26-04-2014)
  3. # Last revision : (14-06-2014)
  4. # Wine version used : 1.7.20
  5. # Distribution used to test : Arch Linux x64
  6. # Author : Hyperfang8
  7. # Script licence : Public Domain
  8. # Program licence : Freeware/Shareware
  9. # Depend : playonlinux,  7z
  10.  
  11.  
  12. #"System" variables
  13. [ "$PLAYONLINUX" = "" ] && exit
  14. source "$PLAYONLINUX/lib/sources"
  15. TITLE="Jade Dynasty"
  16. PREFIX="JadeDynasty"
  17. WORKING_WINE_VERSION="1.7.20"
  18. DEFAULT_SETUP_EXE="download"
  19. MD5SUM="none"
  20. LAUNCHERTITLE="Arc Games-Jade Dynasty"
  21. LAUNCHERNAME="ArcLauncher.exe"
  22. WEBSITE="http://jd.perfectworld.com"
  23. DOWNLOADXML="http://arc01.perfectworld.com/clientapi/newallgameinfo?&lang=en"
  24. AUTHOR="Hyperfang8"
  25. ZIPFILE="none"
  26. VERSIONNUMBER=""
  27. CHECKSUM=""
  28. ARCLINK="http://www.perfectworld.com/arc/download"
  29. ARCSETUP="download"
  30. INSTALLDIR="Program Files/Perfect World Entertainment/Jade Dynasty"
  31.  
  32.  
  33. #Setup wine
  34. POL_SetupWindow_Init
  35. POL_RequiredVersion "4.0.18" || POL_Debug_Fatal "$APPLICATION_TITLE >= 4.0.18 "
  36. POL_Debug_Init
  37. POL_SetupWindow_presentation "$TITLE" "$TITLE" "$WEBSITE" "$AUTHOR" "$PREFIX"
  38. POL_Wine_SelectPrefix "$PREFIX"
  39. POL_System_SetArch "auto"
  40.  
  41. #Download cache
  42. POL_SetupWindow_message  "$(eval_gettext 'Did you already download $TITLE cache file. You can download it here: ${DOWNLOADXML}')" "$TITLE"
  43. POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"
  44. POL_System_TmpCreate "$PREFIX"
  45. cd "$POL_System_TmpDir"
  46.  
  47. #Manual zip registry hack
  48. if [ "$POL_ARCH" == "amd64" ]; then
  49. cat << EOF > "jdarc.reg"
  50. REGEDIT4
  51.  
  52. [HKEY_CURRENT_USER\Software\PWRD]
  53.  
  54. [HKEY_CURRENT_USER\Software\PWRD\zhuxian2]
  55. "DX9CInstalled"="1"
  56. "launcher"="C:\\\\Program Files (x86)\\\\Perfect World Entertainment\\\\Jade Dynasty\\\\patcher\\\\patcher.exe"
  57. "launcher_pid93"="C:\\\\Program Files (x86)\\\\Perfect World Entertainment\\\\Jade Dynasty\\\\patcher\\\\patcher.exe"
  58. EOF
  59. INSTALLDIR="Program Files (x86)/Perfect World Entertainment/Jade Dynasty"
  60. else
  61. cat << EOF > "jdarc.reg"
  62. REGEDIT4
  63.  
  64. [HKEY_CURRENT_USER\Software\PWRD]
  65.  
  66. [HKEY_CURRENT_USER\Software\PWRD\zhuxian2]
  67. "DX9CInstalled"="1"
  68. "launcher"="C:\\\\Program Files\\\\Perfect World Entertainment\\\\Jade Dynasty\\\\patcher\\\\patcher.exe"
  69. "launcher_pid93"="C:\\\\Program Files\\\\Perfect World Entertainment\\\\Jade Dynasty\\\\patcher\\\\patcher.exe"
  70. EOF
  71. INSTALLDIR="Program Files/Perfect World Entertainment/Jade Dynasty"
  72. fi
  73.  
  74. #Select zip for offline install
  75. if [  "$INSTALL_METHOD" = "LOCAL"  ]
  76. then
  77. POL_SetupWindow_message "$(eval_gettext 'You can get .zip download link from the following xml file. Just search for string conaining JD.') $DOWNLOADXML"
  78. POL_SetupWindow_browse "$(eval_gettext 'Select the zip file!')" "$TITLE"
  79. ZIPFILE="$APP_ANSWER"
  80. mkdir -p "$WINEPREFIX/drive_c/$INSTALLDIR"
  81. POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting...')" "$TITLE"
  82. POL_System_7z x -y -o"$WINEPREFIX/drive_c/$INSTALLDIR" "$ZIPFILE"
  83. POL_Wine --ignore-errors regedit "jdarc.reg"
  84. POL_SetupWindow_detect_exit
  85. POL_SetupWindow_message "$(eval_gettext 'If Arc fails to detect your game add it manualy. The file you should add is located at: ') '$WINEPREFIX/drive_c/$INSTALLDIR/patcher/patcher.exe' !"
  86. fi
  87.  
  88. #POL_Call POL_Install_gdiplus
  89. POL_Download "$ARCLINK" ""
  90. POL_SetupWindow_wait_next_signal "Arc launcher is A MUST to play the game -.- .Arc setup window my freeze for minute or two (depending on your PC). This is to be expected." "$TITLE"
  91. mv "$ARCSETUP" "ArcSetup.exe"
  92. POL_Wine --ignore-errors "ArcSetup.exe"
  93. POL_SetupWindow_detect_exit
  94.  
  95. POL_Shortcut "$LAUNCHERNAME" "$LAUNCHERTITLE"
  96. Set_Managed "Off"
  97. POL_SetupWindow_VMS "64"
  98.  
  99. #end the installation
  100. POL_System_TmpDelete
  101. POL_SetupWindow_message "$(eval_gettext 'Installation successfull! When the game prompts you for DIRECTX install you should just politely DECLINE!')"
  102. POL_SetupWindow_Close
  103. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement