If you want to automatically set a virtual desktop, just use Set_Desktop "On" "1024" "768". Although that could be any resolution you want, not just 1024x768.
You probably don't need POL_SetupWindow_message to tell the user to put in their CD. POL_SetupWindow_cdrom already asks and if they haven't put it in by then, there is a refresh option.
In this case, POL_SetupWindow_check_cdrom isn't going to do much since practically every Windows CD has an autorun.inf. If there was something more unique that could be used, that would be better.
If not neccessary, it's usually best to avoid start /unix, but if it's needed, that's fine.
Thanks for review.
I know about the Set_Desktop function but since not everyone uses the same resolution as me I decided to leave it up to user to do it.
I saw some scripts using the POL_SetupWindow_message when installing via CD/DVD/ISO so I though it's necessary. Anyway I removed it.
About the POL_SetupWindow_check_cdrom
Since there are offen many versions of the game (with diffirent file structure,like remakes or gold/complete editions) picking a specific file could result in some people complaining about the script not working for them. But I changed it to data1.cab lets see if that works.
And about the start/unix after some tests (on many difirent scripts) it works with no problem.
EDIT: New version of the script. Now uses a less common file to check if the cd is legit. Also the latest stable Wine is used lets see how it performs.
#!/bin/bash
# Date : (2016-01-21)
# Last revision : (2017-05-08)
# Wine version used : 2.0.1
# Distribution used to test : Ubuntu 17.04 x64
# Author : LinuxScripter
# Licence : GPLv3
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Majesty 2"
AUTHOR="LinuxScripter"
PREFIX="Majesty2"
EDITOR="Paradox Interactive"
GAME_URL="http://www.majesty2.com/"
WORKINGWINEVERSION="2.0.1"
POL_SetupWindow_Init
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
# Downloading wine if necessary and creating prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
POL_Call POL_Install_vcrun2005
POL_Call POL_Install_d3dx9
POL_SetupWindow_InstallMethod "DVD,STEAM"
if [ "$INSTALL_METHOD" == "DVD" ]; then
# Asking for CDROM and checking if it's correct one
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "0x0409.ini"
POL_Wine start /unix "$CDROM/setup.exe"
POL_Wine_WaitExit "$TITLE"
else
POL_Call POL_Install_steam
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
POL_Wine "steam.exe" steam://install/25980
POL_Wine_WaitBefore "$TITLE"
fi
# Making shortcut
if [ "$INSTALL_METHOD" == "STEAM" ]; then
POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/25980"
else
POL_Shortcut "Majesty2.exe" "$TITLE" "" "Game;StrategyGame;"
fi
POL_SetupWindow_Close
exit 0
Ändrat av LinuxScripter