The forum
[scripts] Age of empires 2
update script, testing and expansions
Author | Replies |
Jump to the page: 1 - 2 | |
fekir | Saturday 17 August 2013 at 9:20 |
fekir
|
Hello to everybody,
last week I wanted to play with Age of empires 2 through PlayOnLinux, but I had several performance issue. So i decided to write some scripts to install this game with a never wine version (I didn't even need to tweak settings), and that gives you the possibility to install updates (official and nonofficial). I've also managed to create a script for "age of vampires", "forgotten empires" and "tale of middle-earth", three mod of AoE2. I'm also testing "age of chivalry: hegemony", but it does not work for now. In my script, every time you install a mod or an expansion, the prefix is copied (see the scripts please), so that you can mess everything up with mods and patch without messing up the previous installation. That means that it is possible having all the mods installed at the same time. (in Windows it's not possible!!!) Unfortunately i do not have a cd-drive on my PC, witch means I'm not able to say if you need to use a nocd crack or not. The games and the mods needs to be tested, but till now I've played without problems. I've decided to pubblish them here to speed up the testings, or would it be better to submit them? I'll make a new post for every script. Edit: I've also managed to use, till now, only one version of wine (version 1.6), it means that the final user does not need to download several mb for playing all these games. Edit2: I do not have a Mac, but since the scripts are pretty easy I think they are also mac-copatible, but I can't assure it. Edited by fekir |
fekir | Saturday 17 August 2013 at 9:20 |
fekir
|
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Age Of Empires II: The Age of Kings" PREFIX="AOE2_king" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "" "$TITLE" POL_SetupWindow_Init POL_Debug_Init POL_SetupWindow_free_presentation "$TITLE" "$(eval_gettext 'This tutorial will help you to install $TITLE from Ensemble Studios (http://www.ensemblestudios.com/) on your PC. \\n\\nPlease consider some OpenSource alternative programs that runs natively on GNU/Linux, as for example 0 A.D. (http://play0ad.com/) befor installing $TITLE through Wine. \\n\\nThis installation program is provided by: Fekir \\n\\n$TITLE will be installed in $HOME./PlayOnLinux//wineprefix/$PREFIX \\n\\nPlayOnLinux is not responsible for anything that might happen as a result of using these scripts. \\n\\nClick on next to start.')" ############################################# # Prepare everything for AOE2: Age of Kings # ############################################# POL_Wine_SelectPrefix "$PREFIX" POL_Wine_PrefixCreate "$WORKING_WINE_VERSION" POL_Wine_InstallFonts ######################### # Select file & install # ######################### POL_SetupWindow_InstallMethod "CD,LOCAL" SETUP_OPTIONS="" if [ "$INSTALL_METHOD" = "CD" ]; then POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE" POL_SetupWindow_cdrom POL_SetupWindow_check_cdrom "aoesetup.exe" POL_Wine start /unix "$CDROM/aoesetup.exe" "$SETUP_OPTIONS" else cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" POL_SetupWindow_wait "$(eval_gettext 'Please wait while $TITLE is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" fi POL_Wine_WaitExit "$TITLE" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "empires2.exe" "$TITLE" "" "-nostartup" ######################################### # Install AOE: Age of Kings, Patch 2.0a # ######################################### POL_SetupWindow_question "Do you want to install the 2.0a Patch?" "Patch" if [ "$APP_ANSWER" = "TRUE" ]; then SETUP_OPTIONS="" POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL" if [ "$INSTALL_METHOD" = "LOCAL" ]; then cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" else cd "$POL_System_TmpDir" SETUP_EXE="Age2upA.exe" POL_Download "http://download.microsoft.com/download/aoeaok/Update/2.0a/W9XNT4/EN-US/Age2upA.exe" "20b9fd4ebd51d0375882f4f510ca7c36" fi POL_SetupWindow_wait "$(eval_gettext 'Please wait while the 2.0a Patch is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot fi ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit |
fekir | Saturday 17 August 2013 at 9:21 |
fekir
|
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Age Of Empires II: The Conquerors" PREFIX="AOE2_conq" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" POL_GetSetupImages "http://files.playonlinux.com/resources/icones_back2/Age%20Of%20Empires%20II%20:%20The%20Conquerors%20Expansion" "" "$TITLE" POL_SetupWindow_Init POL_Debug_Init ############################################ # Check if AOE2: Age of Kings is installed # ############################################ if [ "$(POL_Wine_PrefixExists "AOE2_king")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Age of Kings"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi POL_SetupWindow_presentation "$TITLE" "Ensemble Studios" "http://www.ensemblestudios.com/" "Fekir" "$PREFIX" ############################################### # Prepare everything for AOE2: The Conquerors # ############################################### POL_Wine_SelectPrefix "$PREFIX" cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_king" "$WINEPREFIX" ######################### # Select file & install # ######################### POL_SetupWindow_InstallMethod "CD,LOCAL" SETUP_OPTIONS="" if [ "$INSTALL_METHOD" = "CD" ]; then POL_SetupWindow_message "$(eval_gettext 'Please insert the game media into your disk drive.')" "$TITLE" POL_SetupWindow_cdrom POL_SetupWindow_check_cdrom "aocsetup.exe" POL_Wine start /unix "$CDROM/aocsetup.exe" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" else cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" POL_SetupWindow_wait "$(eval_gettext 'Please wait while $TITLE is installed.')" "$SETUP_EXE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" fi POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x1.exe" "$TITLE" "" "-nostartup" ######################################### # Install AOE: Age of Kings, Patch 1.0c # ######################################### POL_SetupWindow_question "Do you want to install the 1.0c Patch?" "Patch" if [ "$APP_ANSWER" = "TRUE" ]; then POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL" SETUP_OPTIONS="" if [ "$INSTALL_METHOD" = "LOCAL" ]; then cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" else cd "$POL_System_TmpDir" SETUP_EXE="SetupAoC.exe" POL_Download " http://web.archive.org/web/20120208151108/http://download.microsoft.com/download/ageIIConquerers/Update/1.0c/W982KMe/EN-US/Age2XPatch.exe" "8170ef5a8fa02725dcecc230b2f172ec" fi POL_SetupWindow_wait "$(eval_gettext 'Please wait while the 1.0c Patch is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot fi ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit Edited by fekir |
fekir | Saturday 17 August 2013 at 9:21 |
fekir
|
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Age Of Empires II: Forgotten Empires" PREFIX="AOE2_forg" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" #POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE" POL_SetupWindow_Init POL_Debug_Init ############################################## # Check if AOE2: The Conquerors is installed # ############################################## if [ "$(POL_Wine_PrefixExists "AOE2_conq")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Conquerors"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi POL_SetupWindow_presentation "$TITLE" "AoFE team" "http://www.forgottenempires.net" "Fekir" "$PREFIX" ################################################## # Prepare everything for AOE2: Forgotten Empires # ################################################## POL_Wine_SelectPrefix "$PREFIX" cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_conq" "$WINEPREFIX" ######################### # Select file & install # ######################### cd "$POL_System_TmpDir" SETUP_OPTIONS="" POL_Download "http://forgottenempires.net/fe_update.zip" "a98fc5214b4292bfd588c48ced5b4781" unzip "fe_update.zip" cp -r "$POL_System_TmpDir/Games" "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/" cp "$POL_System_TmpDir/Age2_x1/age2_x2.exe" "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/age2_x1" cp "$POL_System_TmpDir/Age2_x1/FixAoFE.exe" "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/age2_x1" cp "$POL_System_TmpDir/version.txt" "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/" POL_Wine start /unix "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/age2_x1/FixAoFE.exe" "$SETUP_OPTIONS" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x2.exe" "$TITLE" "" "-nostartup" ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit Edited by fekir |
fekir | Saturday 17 August 2013 at 9:22 |
fekir
|
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Age of Vampires - Blood Reign in Transylvania" PREFIX="AOE2_vamp" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" #POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE" POL_SetupWindow_Init POL_Debug_Init ############################################## # Check if AOE2: The Conquerors is installed # ############################################## if [ "$(POL_Wine_PrefixExists "AOE2_conq")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Conquerors"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi POL_SetupWindow_presentation "$TITLE" "Khan Ivayl" "http://aok.heavengames.com/features/blacksmith-features/age-of-vampires-blood-reign-in-transsylvania/" "Fekir" "$PREFIX" ################################################################################### # Prepare everything for AOE2 MOD, Age of Vampires - Blood Reign in Transsylvania # ################################################################################### POL_Wine_SelectPrefix "$PREFIX" cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_conq" "$WINEPREFIX" ######################### # Select file & install # ######################### POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL" SETUP_OPTIONS="/S" if [ "$INSTALL_METHOD" = "LOCAL" ]; then cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" else cd "$POL_System_TmpDir" POL_Download "http://www.moddb.com/downloads/mirror/38147/72/edbbf5c7bf6010664ed22ff66f030eef" "313c491d6fef25977e1dc7cfbb5c0648" unzip edbbf5c7bf6010664ed22ff66f030eef cd "Age_of_Vampires_Bloodreign_in_Transsylvania" SETUP_EXE="Install_Age_of_Vampires.exe" fi POL_SetupWindow_wait "$(eval_gettext 'Please wait while the $TITLE is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x1.exe" "$TITLE" "" "-nostartup" ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit |
fekir | Saturday 17 August 2013 at 9:22 |
fekir
|
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Tales of Middle-Earth" PREFIX="AOE2_midd" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" #POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE" POL_SetupWindow_Init POL_Debug_Init ############################################## # Check if AOE2: The Conquerors is installed # ############################################## if [ "$(POL_Wine_PrefixExists "AOE2_conq")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Conquerors"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi POL_SetupWindow_presentation "$TITLE" "ToME Team" "http://aok.heavengames.com/tales-of-middle-earth" "Fekir" "$PREFIX" ########################################################## # Prepare everything for AOE2 MOD, Tales of Middle-Earth # ########################################################## POL_Wine_SelectPrefix "$PREFIX" cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_conq" "$WINEPREFIX" ######################### # Select file & install # ######################### POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL" SETUP_OPTIONS="/VERYSILENT" if [ "$INSTALL_METHOD" = "LOCAL" ]; then cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" else cd "$POL_System_TmpDir" SETUP_EXE="Tales of Middle-Earth Setup.exe" POL_Download "http://www.moddb.com/downloads/mirror/49149/73/932401b564335cd36651c636c95a49db" "1288456158e127c7ffde0cbf6a8e52cb" unzip 932401b564335cd36651c636c95a49db cd 932401b564335cd36651c636c95a49db_FILES fi POL_SetupWindow_wait "$(eval_gettext 'Please wait while the $TITLE is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x1.exe" "$TITLE" "" "-nostartup" ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit |
fekir | Saturday 17 August 2013 at 10:33 |
fekir
|
Ok, I also managed to install Rome at War, seems to work fine
#!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Rome at War" PREFIX="AOE2_raw" WORKING_WINE_VERSION="1.6" POL_System_TmpCreate "$PREFIX" #POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE" POL_SetupWindow_Init POL_Debug_Init ############################################## # Check if AOE2: The Conquerors is installed # ############################################## if [ "$(POL_Wine_PrefixExists "AOE2_conq")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Conquerors"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi POL_SetupWindow_presentation "$TITLE" "WildFire Games" "http://wildfiregames.com/raw/" "Fekir" "$PREFIX" ################################################ # Prepare everything for AOE2 MOD, Rome at War # ################################################ POL_Wine_SelectPrefix "$PREFIX" cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_conq" "$WINEPREFIX" POL_SetupWindow_menu_num "$(eval_gettext 'In order to installa $TITLE we need to install first Mod Pack Studio Lite 2.0')" "$TITLE" "DOWNLOAD~LOCAL" "~" SETUP_OPTIONS="/S" if [ "$APP_ANSWER" -eq 1 ]; then cd "$HOME" POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE" SETUP_EXE="$APP_ANSWER" else cd "$POL_System_TmpDir" POL_Download "http://wildfiregames.com/raw/litsetup_v20.zip" "660ca5503b3536f4f73376d37e4f43f2" unzip "litsetup_v20.zip" SETUP_EXE="litsetup.exe" fi POL_SetupWindow_wait "$(eval_gettext 'Please wait while the $TITLE is installed.')" "$TITLE" POL_Wine start /unix "$SETUP_EXE" "$SETUP_OPTIONS" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot ######################### # Select file & install # ######################### cd "$POL_System_TmpDir" POL_Download "http://wildfiregames.com/raw/WFSRaWScenv_2.zip" "792168f8ad473969390d5406f5f04f80" unzip WFSRaWScenv_2.zip mv *.mp3 "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/Sound/stream" mv *.txt "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/History" mv *.ai "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/AI" mv *.per "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/AI" mv *.cpx "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II/Scenario" mv *.dll "$WINEPREFIX/drive_c/Program Files/Microsoft Games/Age of Empires II" POL_SetupWindow_wait "$(eval_gettext 'Please wait while the $TITLE is installed.')" "$TITLE" POL_Wine_WaitExit "$TITLE" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x1.exe" "$TITLE" ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit Edited by fekir |
petch | Saturday 17 August 2013 at 13:52 |
petch
|
Hi fekir,
Well, first your scripts look nice, and with no huge problems to report; Things to report then: - The use of POL_System_TmpCreate so early in the script looks a bit strange, even if it should work. Still, I'd recommend to call it just before it's necessary, so you don't have to call POL_System_TmpDelete in some error paths, for example; - They're few POL_SetupWindow_free_presentation that long, but it happened before (Word and Excel 2003 Viewers, also from you ;) ), so I suppose it's ok - typo befor => before - For installation path use $POL_USER_ROOT/wineprefix/$PREFIX. (and of course $WINEPREFIX would be even better, but it's not defined at that point) - improvement, POL_Shortcut now accepts an extra argument, that in recent versions of PoL/PoM can create a system menu entry in the provided section: POL_Shortcut "empires2.exe" "$TITLE" "" "-nostartup" "Game;StrategyGame;" - cp -r "$HOME/PlayOnLinux's virtual drives/AOE2_king" "$WINEPREFIX" Do not rely on "PlayOnLinux's virtual drives" symlink, PoL itself does not rely on it, and users may have removed/renamed it, not to mention it only exists since PoL 4.0.16 and has an obvious different name of Macs ;) Again better use $POL_USER_ROOT/wineprefix/$OTHERPREFIX Since 4.1.6 there's a POL_System_CopyDirectory that will display a progress bar; But the script(s) will need a POL_RequiredVersion 4.1.6 statement to check installed version Last but not least, see my concern about virtual drives cloning below. - Also starting from 4.1.6, you can use POL_System_unzip instead of unzip. It's not (yet) nice enough to also have a progress bar, but it catches unarchiving errors and display a PoL-style fatal error message, which your script doesn't. - Sadly POL_System_mv can't really be used instead of mv here, because it can only move one file at a time, no wildcards. You could add failures catching though - Don't ever use "Program Files" in paths, as it is localized, use $PROGRAMFILES instead Ok, so the remaining concern is about virtual drives cloning; It has not been a supported operation on virtual drives so far, so we need to make sure it doesn't break existing invariants, or introduce new problematic constraints. About the "Wine" part of virtual drives (the "prefix" itself), I don't expect huge problems; Wine itself does not see to put any absolute paths in the registry: the only ones I found there come from record of installation paths, and look harmless. The .lnk files seem to contain only "windows" paths, and should be safe too. The drive_c may contain symlinks though, and I think we'd better preserve them using cp -a. Copy-on-write filesystems like btrfs would benefit from --reflink, but it may not be supported by cp on OS X's, to be checked. One need to be sure that $WINEPREFIX/dosdevices/* use relative symlinks, because otherwise I suspect Wine will keep using the original drives instead of the clones. About the extra files PoL puts in the virtual drives directories, there's currently only playonlinux.cfg and playonlinux.log. playonlinux.cfg does not contain absolute paths, but if cloning has to become supported, that would become a new requirement. I think copying playonlinux.log over is ok, as its content is somehow also part of the virtual drive's history. I'm not sure what are all the resources, files and directories created for a virtual drive (configurations/pre_shortcut/? That kind of stuff); And which ones should be cloned along with the wineprefix/$PREFIX content. In your scripts, POL_Wine_PrefixCreate will never have been called for those virtual drives, so those won't even have the default resources, with unknown consequences. I think it would be safer to call POL_Wine_PrefixCreate, even if most of want it will create will be immediately overwritten by the copy (that will need to be adjusted because the target would then become an existing directory). If you followed me so far, it would be best if this operation was first validated by Tinou, and if it is, it's very likely that he will require that this operation is implemented as a PlayOnLinux function, so that it can be adjusted to new invariants. My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Sunday 18 August 2013 at 7:59 |
fekir
|
Hi, I'm updating all the script with
- POL_RequiredVersion - $POL_USER_ROOT/wineprefix/$PREFIX - POL_System_CopyDirectory and so on, and some other fixes. I only have a problem with $PROGRAMFILES since the prefix is not initialized, I googled a bit and found this article (http://www.playonmac.com/en/commentaires-759.html), so I assumed i have to use POL_LoadVar_PROGRAMFILES, since I do not create a new prefix I did not use POL_System_mv since all the mv and cp operation are pretty fast, while copying the whole prefix was slow, with a progress bar it's better. I've also found a critical bug in Tales of Middle earth, the games hang up if you select a "standard map", previously I've made only some tests with "custom map". So the games doesn't play some scenario, which is the best way to let the user know? I would also like to know if it is possible to change the icon of the shortcut, for example ToMe creates a .ico file for the shortcut, which is not used by PlayOnLinux (it uses the icon of the executable). I do not have the games CD with me, so I can't test the installation of "userscript" in Age ofo Empires 2; The conquerors. There shouldn't be problem since it is used by the mods and seems to work, but I've omitted it on this forum. I thought it might be better to eventually update the script if it works. I'm not posting again all the scripts since they are similar, but only one to show the major changes. [code] #!/bin/bash # Date : # Last revision : # Distribution used to test : Debian Jessie # Author: Fekir # Wine version used: 1.6 [ "$PLAYONLINUX" = "" ] && exit 0 source "$PLAYONLINUX/lib/sources" TITLE="Age Of Empires II: Forgotten Empires" PREFIX="AOE2_forg" WORKING_WINE_VERSION="1.6" POL_SetupWindow_Init POL_Debug_Init ############################################## # Check if AOE2: The Conquerors is installed # # and if PlayOnLinux is v 4.1.6+ # ############################################## POL_RequiredVersion 4.1.6 || POL_Debug_Fatal "This program requires $APPLICATION_TITLE 4.1.6" if [ "$(POL_Wine_PrefixExists "AOE2_conq")" = "False" ]; then POL_SetupWindow_message "$(eval_gettext 'Please install "Age Of Empires II: The Conquerors"')" "$TITLE" POL_System_TmpDelete POL_SetupWindow_Close exit fi #POL_GetSetupImages "http://files.playonlinux.com/resources/icones/AgeOfEmpires.ico" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE" POL_SetupWindow_presentation "$TITLE" "AoFE team" "http://www.forgottenempires.net" "Fekir" "$PREFIX" ################################################## # Prepare everything for AOE2: Forgotten Empires # ################################################## POL_System_TmpCreate "$PREFIX" POL_Wine_SelectPrefix "$PREFIX" POL_System_CopyDirectory "$POL_USER_ROOT/wineprefix/AOE2_conq" "$WINEPREFIX" ######################### # Select file & install # ######################### cd "$POL_System_TmpDir" SETUP_OPTIONS="" POL_LoadVar_PROGRAMFILES POL_Download "http://forgottenempires.net/fe_update.zip" "a98fc5214b4292bfd588c48ced5b4781" POL_System_unzip "fe_update.zip" cp -r "$POL_System_TmpDir/Games" "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Games/Age of Empires II/" cp "$POL_System_TmpDir/Age2_x1/age2_x2.exe" "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Games/Age of Empires II/age2_x1" cp "$POL_System_TmpDir/Age2_x1/FixAoFE.exe" "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Games/Age of Empires II/age2_x1" cp "$POL_System_TmpDir/version.txt" "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Games/Age of Empires II/" POL_Wine start /unix "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Games/Age of Empires II/age2_x1/FixAoFE.exe" "$SETUP_OPTIONS" POL_Wine_reboot ################### # Making shortcut # ################### POL_Shortcut "age2_x2.exe" "$TITLE" "" "-nostartup" "Game;StrategyGame;" ################ # Clean & exit # ################ POL_System_TmpDelete POL_SetupWindow_Close exit [/code] edit: another question: As I told you at the beginning of the post, I'm using a computer without a CD drive, which means that I can't tell you if the games works well with the CD. Therefore I was thinking if it was possible to create a directory under $HOME/.PlayOnLinux, something like "cdprefix" and add a simlink inside the c_drive of the game. This should increase the performance of several games, and it does not need a cd-crack, and the user does not have to search for cracks. I would prefer not to copy the cd inside the prefix because when i copy it, I would copy 700mb of files which are not needed the execute the expansion or some mod. Let me know what you think about it, but I think it would be really a nice feature. edit2: Documentation needs to be updated, all this candy functions are not documented and not even mentioned in the news, for example (using google), POL_System_mv is mentioned only here.... ;-) edit3: Sorry, I found out another bug, this time at rome at war. I need to make a link to WFSRaWScnv2.akx to make the mod work, but if you do "wine WFSRaWScnv2.akx", you obtain an error saying that the .exe format is not correct, but if you do "wine start /unix WFSRaWScnv2.akx", the it works without problems. How should I proceed to make a correct link? Edited by fekir |
petch | Sunday 18 August 2013 at 14:41 |
petch
|
Correct
That could be mentionned in the script description that nobody reads, and possibly as a POL_SetupWindow_message in the script, that more people will notice. If it's not a huge bug, I'd put the warning at the very end of the installation. If it could be a no-go for some users, I'd put it near the beginning, just after the presentation. For Urban Chaos, where level restart would just exit the game, I managed to modify the resources to add "(CRASH)", or whatever string it was, at the end of the menu entry. But that's somewhat specific.
Some old scripts used ImageMagick to extract and convert icon formats at installation time, but this lead to lot of script complexity and uglyness; So the standard is now to extract the icons as 48x48 PNGs (minimum) and put them on the server. Putting the icon filename as a third POL_Shortcut argument (usually "$SHORTCUTNAME.png") is then all what's required to set a different icon.
You forgot to remove POL_System_TmpDelete from the error path; Paranoid advice: the current directory is something rather volatile, statements should not blindly modify it but it's the kind of bug that's difficult to spot when writing functions; So I'd put the cd right before POL_Download, with nothing inbetween, just to be on the safe side. The concerns about cloning remain, but since I have no better solution to offer right now, I won't insist on it. I talked about it with Tinou, and as expected it should be a new PoL function.
Some scripts copy cdrom contents already (That's what ..._CopyDirectory is used for in the first place), specially to work around problems with cdrom switching during installations. But it should not fool real cdrom presence checks. And if it can be made to, it would probably not be legal in many countries including ours. That's why we do not support the usage of disk images either. So the "no no-cd patch" argument doesn't stand.
One problem with this approach is that the cdrom content would not be removed when no longer used; Removing it with this model would require some specific handling in PlayOnLinux, which doesn't look likely any time soon. cp --reflink on btrfs would make copying the cd content basically free, but that's not a general solution; For other filesystems, closest implementation is to use cp -l for read-only files; That would require special-casing paths in the virtual drive while cloning instead of just cp -a, but would require no change to PoL itself.
That's what happens when the documentation is not updated as the code evolves, as usual... The fact that the documentation is not easily updatable doesn't help with that.
Not sure what's the type of this file, I suppose it's a renamed .dll... Does POL_Wine rundll32.exe WFSRaWScnv2.akx work too? My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Sunday 18 August 2013 at 15:27 |
fekir
|
The problem with the bug I've found the games stops to run, it freezes during the loading, it does not crash.
I'll think about the warning taking into account what you've written. For the .ico file: what happens if someone does not have an internet connection? Wouldn't it be better to use the .ico file which is available on the filesystem?
right! Regarding the copy of cdroms... I know this is not the right place for discussing it, but isn't it a better solution than using a no-cd patch? And for some games, depending on the licence of the game itself (have no idea about AoE, I should check it, but I can't find the licence on my hard disk right now), it may be also legal. I'm also pretty sure that it's legal to make a backup copy in many countries, but I do not wan't to insist about it since this is not the right place and a complex problem. Regarding the problem of where to copy the content of the cd-rom, i thought that maybe something like a cd - manager (similar to the prefix manager) would have been a good solution. I do not think that WFSRaWScnv2.akx may is a renamed dll, with the command file I get: "WFSRaWScnv2.akx: Composite Document File V2 Document, No summary info" I've tried file on some .dll and I got different content. How can I execute the command POL_Wine rundll32.exe WFSRaWScnv2.akx without using a script? I get "POL_Wine: command not found". |
petch | Sunday 18 August 2013 at 16:33 |
petch
|
Don't expect PlayOnLinux scripts to run without an internet connection, too many things depend on it.
I doubt Tinou wants any features that looks even remotely to a cdrom bank into PlayOnLinux. I can't talk for him, but I have this strong feeling that it's a no-go.
Mmmh then I suppose it spawns the app associated with the document type. Not sure how to emulate that without knowing what's associated exactly. Otherwise I suppose a shortcut to start.exe can be used, if an absolute path to the .akx file is provided as argument (start.exe will be launched from its directory)... My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Sunday 18 August 2013 at 17:08 |
fekir
|
Sorry, I do not understand what I should do, I do not have any start.exe file... I assume that when you click on the shortcut made by PlayOnLinux, the command "wine xxx.akx" is executed, isn't it somehow possible to change it in "wine start /unix xxx.akx" ?
Ok. I think that the scripts may be ready now (excluding Rome at War since it has the xxx.akx file), I'll add the warning to Tale of Middle Earth and pubblish them again. If you think they are OK I'll ask for the validation (Rome at War excluded if we don't find a solution). |
fekir | Sunday 18 August 2013 at 17:19 |
fekir
|
|
petch | Sunday 18 August 2013 at 17:36 |
petch
|
That's the idea, my suggestion was POL_Shortcut "start.exe" "Shortcut name" "" "/unix '$WINEPREFIX/drive_c/... .../WFSRaWScnv2.akx'" (start.exe can be found in /windows/command/)
I forgot to answer this one. Configure button > (select virtual drive) > Miscellaneous tab > Open a shell You'll be in an environment close to scripts' one when the prefix has been selected. Edited by petch My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Sunday 18 August 2013 at 18:28 |
fekir
|
great it worked! Is it somehow possible to change the shell? I can't even copy and paste... If you think that everything is OK, I would ask for the validation. Thank you very much for everything! |
petch | Sunday 18 August 2013 at 18:51 |
petch
|
That's probably not a problem with the shell, but with the terminal emulator. PlayOnLinux probably used xterm. On Debian based distros it uses the x-terminal-emulator alternative, but that can end up being xterm too, if that's what is selected. It implements old fashioned X style cut&paste (first button: set selection beginning, third button: select end; or drag with first button; Then middle button for pasting). My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Monday 19 August 2013 at 8:22 |
fekir
|
Yeah, sorry, I ment the terminal emulator. Thanks. But x-terminal-emulator was set on mate terminal, and now on sakura, POL still uses xterm...
Oh, I almost forgot: Is it somehow possible, since it's only a game and you do not need to search for files, to disable the desktop integration? Every time i install the mods and expansion my home is filled with .lnk files and my Documents folder with the empty folder Music, Video Images, which is a bit annoying... Edited by fekir |
petch | Tuesday 20 August 2013 at 13:29 |
petch
|
Strange, maybe the "DEBIAN_PACKAGE" flag is not set? This is all a bit adhoc...
That's a Wine feature, but it's possible to disable it after-the-fact: just install the pseudo-component PrivateUserDirs that will replace the symlinks in the virtual drive with plain directories. To automate it for new virtual drives, you can add POL_Call POL_Install_PrivateUserDirs in ~/.PlayOnLinux/configurations/post_prefixcreate (create the script if missing). Edited by petch My scripts wiki: https://github.com/petchema/playonlinux/wiki GOGmix: https://www.gog.com/en/mix/playonlinux_install_scripts |
fekir | Tuesday 20 August 2013 at 15:10 |
fekir
|
I have no idea how I could check it...
great! Again: thank you very much! Edited by fekir |
This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com