Last active
January 5, 2018 06:22
-
-
Save NeroBurner/4cc4e49595e64221616148bfc15c5595 to your computer and use it in GitHub Desktop.
start warframe with 32/64bit wine-bottle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# exit on first error | |
set -e | |
function print_synopsis { | |
echo "$0 [options]" | |
echo "" | |
echo "options:" | |
echo " --winecfg start winecfg with the current wine bottle" | |
echo " --regedit start regedit with the current wine bottle" | |
echo " -w, --winetricks install packages to wine bottle, don't launch game" | |
echo " -r, --registry update wine registry, don't launch game" | |
echo " -c, --config create basic warframe configuration file inside wine bottle" | |
echo " -i, --install same as defining --winetricks, --registry and --config" | |
echo " -u, --update use Warframe executable to update downloaded game files" | |
echo " --32bit use 32bit wine bottle and 32bit Warframe" | |
echo " -h, --help print this help message and quit" | |
} | |
# user defined constants | |
wine_prefix_base="/home/${USER}/Games/wine_prefix/Warframe" # wine bottles, script will append '_amd64' or '_i386' | |
# WARNING: keep download_dir and download_dir_windows in sync! | |
# specify the download folder, where all the game files are | |
download_dir="/home/${USER}/Warframe/drive_c/Program Files/Warframe/Downloaded" | |
download_dir_windows="z:\\\\home\\\\${USER}\\\\Warframe\\\\drive_c\\\\Program Files\\\\Warframe\\\\Downloaded" | |
video_memory_size=2048 # Video RAM of your GPU | |
user_email="" # your email, set in basic config (optional) | |
# on default start the game | |
start_game=true | |
use_x64=true | |
# As long as there is at least one more argument, keep looping | |
while [[ $# -gt 0 ]]; do | |
key="$1" | |
case "$key" in | |
--winecfg) | |
start_winecfg=true | |
;; | |
--regedit) | |
start_regedit=true | |
;; | |
-w|--winetricks) | |
do_winetricks=true | |
start_game=false | |
;; | |
-r|--registry) | |
do_registry=true | |
start_game=false | |
;; | |
-c|--config) | |
do_config=true | |
start_game=false | |
;; | |
-i|--install) | |
do_winetricks=true | |
do_registry=true | |
do_config=true | |
start_game=false | |
;; | |
-u|--update) | |
do_update=true | |
;; | |
--32bit) | |
use_x64=false | |
;; | |
-h|--help) | |
print_synopsis | |
exit 0 | |
;; | |
*) | |
echo "Unknown option '$key'" | |
print_synopsis | |
exit 1 | |
;; | |
esac | |
# Shift after checking all the cases to get the next option | |
shift | |
done | |
# show all executed commands | |
set -x | |
export PULSE_LATENCY_MSEC=60 | |
# without this I get about 30 to 40 fps instead of 15 to 30 | |
#export __GL_THREADED_OPTIMIZATIONS=1 | |
# define variables | |
export MSI="${download_dir}/Public/Warframe.msi" | |
warframe_exe_base="${download_dir}/Public" | |
# distinction between 32bit and 64bit | |
if [ "$use_x64" = true ] ; then | |
export WINEPREFIX="${wine_prefix_base}_amd64" | |
export WINEARCH=win64 | |
export WARFRAME="${warframe_exe_base}/Warframe.x64.exe" | |
WINE=wine64 | |
else | |
export WINEPREFIX="${wine_prefix_base}_i386" | |
export WINEARCH=win32 | |
export WARFRAME="${warframe_exe_base}/Warframe.exe" | |
WINE=wine | |
fi | |
# folder where warframe saves its configuration and launcher | |
warframe_config_dir="${WINEPREFIX}/drive_c/users/${USER}/Local Settings/Application Data/Warframe" | |
config_file="${warframe_config_dir}/EE.cfg" | |
# start specified program and then exit, good for debugging | |
if [ "$start_winecfg" = true ] ; then | |
echo "calling winecfg and exit this script afterwards" | |
winecfg | |
exit 0 | |
fi | |
# start specified program and then exit, good for debugging | |
if [ "$start_regedit" = true ] ; then | |
echo "calling regedit and exit this script afterwards" | |
regedit | |
exit 0 | |
fi | |
if [ "$do_winetricks" = true ] ; then | |
echo "using winetricks to install needed packages" | |
# - winetricks for Warframe | |
# with wine 2.21-staging only those two packages are needed | |
# 20180105 - add win7: with winXP only dx9 is supported, with win7 dx10 is available | |
winetricks -q vcrun2015 xact win7 | |
# from the lutris installer the following packages were installed | |
#winetricks -q vcrun2015 xact xinput win7 hosts | |
fi | |
if [ "$do_registry" = true ] ; then | |
reg_file="/tmp/wf.reg" | |
echo "update windows registry, creating temporary file at '$reg_file'" | |
if [ "$use_x64" = true ] ; then | |
Enable64Bit="dword:00000001" | |
else | |
Enable64Bit="dword:00000000" | |
fi | |
# create registry file | |
cat <<EOF > "$reg_file" | |
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\\Software\\Digital Extremes\\Warframe\\Launcher] | |
"APR2007_xinput_x64.cab"="743B333C2DB3D4CF190FB39C29F3C346" | |
"APR2007_xinput_x86.cab"="C234DF417C9B12E2D31C7FD1E17E4786" | |
"DownloadDir"="${download_dir_windows}" | |
"DSETUP.dll"="9E0711BED229B60A853BCC5D10DEAAFC" | |
"dsetup32.dll"="0F58CCD58A29827B5D406874360E4C08" | |
"DXSETUP.exe"="DDCE338BB173B32024679D61FB4F2BA6" | |
"dxupdate.cab"="8ADF5A3C4BD187052BFA92B34220F4E7" | |
"Enable64Bit"=${Enable64Bit} | |
"EnableAggressiveDownload"=dword:00000001 | |
"EnableBulkDownload"=dword:00000000 | |
"EnableDirectX10"=dword:00000001 | |
"EnableDirectX11"=dword:00000000 | |
"EnableFullScreen"=dword:00000000 | |
"EnableMTRendering"=dword:00000000 | |
"Jun2010_XAudio_x64.cab"="EDEB828A8E54A9F3851007D80BC8DD6E" | |
"Jun2010_XAudio_x86.cab"="9D2DA3B1055120AF7C2995896F5D51ED" | |
"Language"="en" | |
"LauncherExe"="C:\\\\users\\\\${USER}\\\\Local Settings\\\\Application Data\\\\Warframe\\\\Downloaded\\\\Public\\\\Tools\\\\Launcher.exe" | |
"LauncherGPU"=dword:00000000 | |
"LauncherStats"=dword:00000000 | |
"Oct2005_xinput_x64.cab"="C39E4358CEA9538AB1D4B842DA669BC6" | |
"Oct2005_xinput_x86.cab"="B296431A5DFFF596FEF2F04B4F36362A" | |
"ReadCba"="9CBC69E1D9AE2874F4D1AF57A19AE923" | |
"ReadEula"="ECFEC2AEE8054A9E7665DBD03D1DE6A1" | |
"ServerCluster"=dword:00000000 | |
"UpdateVersion"=dword:00000016 | |
"VerifyVersionPublic"=dword:00000002 | |
[HKEY_CURRENT_USER\\Software\\Wine\\DllRedirects] | |
"wined3d"="wined3d-csmt.dll" | |
[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D] | |
"OffscreenRenderingMode"="fbo" | |
"RenderTargetLockMode"="readtex" | |
"StrictDrawOrdering"="disabled" | |
"VideoMemorySize"="${video_memory_size}" | |
[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides] | |
"rasapi32"="native" | |
"d3dcompiler_43"="native,builtin" | |
"d3dcompiler_47"="native,builtin" | |
EOF | |
# update registry to set warframe download folder and other wine options | |
$WINE regedit /S "${reg_file}" | |
fi | |
if [ "$do_config" = true ] ; then | |
echo "create basic configuration file '$config_file'" | |
# create folder if they don't exist | |
mkdir -p "$warframe_config_dir" | |
# write basic configurations | |
cat <<EOF > "$config_file" | |
+nowarning | |
+version=5 | |
[KeyBindings,/EE/Types/Input/KeyBindings] | |
[LotusDedicatedServerAccountSettings,/Lotus/Types/Game/DedicatedServerAccountSettings] | |
email= | |
[LotusWindows_KeyBindings,/Lotus/Types/Input/KeyBindings] | |
[Windows_Config,/EE/Types/Base/Config] | |
Stats.Visible=1 | |
Graphics.AnisotropicFiltering=AF_NONE | |
Graphics.AntiAliasing=AA_FXAA | |
Graphics.AutoDetectGraphicsSettings=0 | |
Graphics.BlurLocalReflections=0 | |
Graphics.Borderless=1 | |
Graphics.Brightness=1.4540318 | |
Graphics.Contrast=0.99721003 | |
Graphics.DynamicLighting=0 | |
Graphics.DynamicResolution=DYNRES_USER | |
Graphics.EnableColorCorrection=0 | |
Graphics.EnableDOF=0 | |
Graphics.EnableHDR=0 | |
Graphics.EnableMotionBlur=0 | |
Graphics.EnableScreenShake=0 | |
Graphics.EnableVolumetricLighting=0 | |
Graphics.GeometryDetail=GD_LOW | |
Graphics.LocalReflections=0 | |
Graphics.LowShaderQuality=1 | |
Graphics.MaxFrameRate=200 | |
Graphics.ParticleSysQuality=PQ_LOW | |
Graphics.ShadowQuality=SQ_LOW | |
Graphics.VSyncMode=VSM_NEVER_SYNC | |
Flash.FlashDrawScale=0.75108659 | |
Flash.FlashDrawScaleMode=MSM_CUSTOM | |
Client.Email=${user_email} | |
EOF | |
fi | |
if [ "$do_update" = true ] ; then | |
echo "updating Warframe files" | |
# download most recent msi file from the official website | |
wget "http://content.warframe.com/dl/Warframe.msi" -O "$MSI" | |
# use warframe executable to update the game files | |
$WINE "${WARFRAME}" -silent -log:/Preprocessing.log -dx10:1 -dx11:0 -threadedworker:1 -cluster:public -language:en -applet:/EE/Types/Framework/ContentUpdate | |
fi | |
if [ "$start_game" = true ] ; then | |
#WINEDEBUG=-all wine64 "${LAUNCHER}" | |
# start MSI file instead of launcher, because launcher.exe can't replace itself under wine and loops forever | |
WINEDEBUG=-all $WINE msiexec /i "${MSI}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment