Jump to content

Linux multiarch installer


snake45

Recommended Posts

i made a small bash script for multiarch support (ubuntu, debian, fedora, arch, etc) could be greatly improved but it would be good to see an installer other then the lame repository for ubuntu

 

#!/bin/bash

INSTALLER="https://downloads.cncnet.org/TiberianSun_Online_Installer.exe"
WINETRICKS="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"

echo "Downloading wine"

if [ -f /etc/lsb-release ]; then
    apt-get install wine -y
elif [ -f /etc/debian_version ]; then
    aptitude install wine -y
elif [ -f /etc/redhat-release ]; then
    yum|dnf install wine -y
else
   echo "Unable to determine distribution"
   exit
fi

echo "Configuring wine."

WINEARCH=win32 WINEPREFIX=~/.wine winecfg

echo "Downloading winetricks."

res=$(wget "$WINETRICKS" -q --show-progress)

if [ ! $? -eq 0 ]
then
   echo "Failed to download winetricks"
   exit
fi

echo "Installing dotnet20."

chmod +x winetricks && sh winetricks dotnet20

echo "Downloading installer."

res=$(wget "$INSTALLER" -q --show-progress)

if [ ! $? -eq 0 ]
then
   echo "Failed to download installer"
   exit
fi

wine $INSTALLER

Link to comment
Share on other sites

That's very cool! We were actually talking about something like this not long time ago. I will do some testing with it.

 

I just uploaded the installer I use on the debian package, it will give access to 3 games at the same time rather than just one.

https://downloads.cncnet.org/CnCNet.exe

(Should be started with "/silent" arg to prevent unnecessary clicks)

 

Random suggestions:

The installers can actually install dotnet20 into the prefix on their own, but I guess it doesn't harm to try it via winetricks in the bash script manually. I would suggest to just continue if the download of winetricks somehow fails.

 

Wineprefix should be .cncnet to ensure we are not installing it into the default prefix that might contain something that breaks support for the games.

Code from the debian package script as example:

 


#!/bin/bash
LAUNCHER="$HOME/.cncnet/drive_c/Games/CnCNet/CnCNetLauncher.exe"
INSTALLER="/usr/bin/CnCNet.exe"
INSTALLERARGS="/silent"

export WINEPREFIX="$HOME/.cncnet"

if [ ! -f "$LAUNCHER" ];
then
  WINEARCH=win32 WINEDLLOVERRIDES="mscoree,mshtml=" wine wineboot
  wine "$INSTALLER" "$INSTALLERARGS"
fi
  wine "$LAUNCHER"
[/Code]

 

Note: the WINEDLLOVERRIDES="mscoree,mshtml=" trick prevents the annoying mono/gecko installation prompts

 

 

I'm not sure if it will always be possible to create a 32bit wineprefix on a 64bit OS, not all of the distros have multiarch support I guess. The debian package tries to install wine:i386 for that reason, but I will do some testing!

 

 

I have yet to investigate how rpm packages work, maybe could have some use for your script with those packages too...

 

Oh, btw... On what distro did you test it already?

 

 

-

Some random information for all readers, the following installers will detect when they're running under wine and apply all the needed settings and dll overrides automatically:

RedAlert1_Online_Installer.exe

TiberianSun_Online_Installer.exe

TiberianDawn_Online_installer.exe

RA1installer.exe

 

Tiberian Sun singleplayer and Tiberian Dawn singleplayer will NOT run under wine out of the box, you'll have to tweak your rendering settings until the games run smooth. And don't forget to add a dll override for "ddraw" and "wsock32" for all game executables.

Link to comment
Share on other sites

heres an updated version,

 

i ignored if winetricks fails or not and also added the overrides, and also changed the prefix to .cncnet which makes since as to the conflicts. i also base64 the exe (not posted for forum length) and utilize it from a variable (not sure if this work). i will mess around with the other overrides later unless you guys already got around to it.

 

also: currently i am running on ubuntu and no apparent issues.

 

edit again: fixed missing variable.

 

last edit: https://github.com/zen45/cncnet-installer.sh

 

#!/bin/bash

WINETRICKS="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
MD5_SUM="f264e0c4977518edf4527019e408bef5"
SERVICE="CnCNet.exe"
BINARY="TVpQAgQP//+4QBoBuhAOH7QJzSG4AUzNIZCQVGhpcyBwcm9ncmFtIG11c3QgYmUgcnVuIHVuZGVy
IFdpbjMyDQokN1BFTAEIGV5CKuCPgQsBAhmiRpiqEMBAEAIBBgRQAQQCQIEQQBAQEOB8CSABLAEY
Q09ERdChEKIEIGBEQVRBUALABKZAwEJTU5QO0KrALmlkYXRhfAngCqpAwC50bHMI8LTALnJkYXRh
GAECtEBQLnJlbG9jHAkQAUBQLnJzcmMsIAEstkBQUAHsQFAKBnN0cmluZzwQQG0RQATEKUCsKEDU
KEAYKUARCyQpQARGcmVlEzApQAxJbml0SW5zdGFuY2UWTClAD0NsZWFudXBJbnN0YW5jZRBoKEAJ
Q2xhc3NUeXBlEGwoQAlDbGFzc05hbWUSgChAC0NsYXNzTmFtZUlzEqgoQAtDbGFzc1BhcmVudBDA
KUAJQ2xhc3NJbmZvE/goQAxJbnN0YW5jZVNpemUTsClADEluaGVyaXRzRnJvbQ/IKUAIRGlzcGF0
Y2gU8ClADU1ldGhvZEFkZHJlc3MRPCpACk1ldGhvZE5hbWUTeCpADEZpZWxkQWRkcmVzcxXEKUAO
RGVmYXVsdEhhbmRsZXISrChAC05ld0luc3RhbmNlE9QoQAxGcmVlSW5zdGFuY2UHVE9iamVjdI1A
w41A/yUg4UCLwP8lHOFAi8D/JRjhQIvA/yUU4UCLwP8lEOFAi8D/JQzhQIvA/yUI4UCLwP8lKOFA
0Bp97ytyoBu2QXtLgFKMR4BtDLrQymvedbDOy0r+3dkGsto6H8lfpHWfNHtHCchKNOyBjtGF3Q97
UdbRrYntab3zV6vo108UFHQCnlp/cEFPbDa3Jw6GP6v0cGLHF308M+DIpGeiFIRTpbDRtTs+ODRp
yWjSqLP3sUkqic64GLp9fvrZxSoidPjGano0IrqOumQd1+QlNR4vtXSmmkmBb353A//truz2Cg=="
ARGUMENTS="/silent"

echo "Downloading wine"
if [ -f /etc/lsb-release ]; then
    apt-get install wine -y
elif [ -f /etc/debian_version ]; then
    aptitude install wine -y
elif [ -f /etc/redhat-release ]; then
    yum|dnf install wine -y
else
   echo "Unable to determine distribution"
   exit
fi

echo "Configuring wine."
WINEARCH=win32 WINEPREFIX=~/.cncnet winecfg 
WINEARCH=win32 WINEDLLOVERRIDES="mscoree,mshtml=" wine wineboot

echo "Downloading winetricks just incase."
res=$(wget "$WINETRICKS" -q --show-progress)
if [ $? -eq 0 ]
then
   chmod +x winetricks && sh winetricks dotnet20
fi

echo "Unpacking CnCNet.."
echo "$BINARY" | base64 --decode >> $SERVICE
sum=`md5sum $SERVICE`
if [ ! "$sum" == "$MD5_SUM" ]; then
   echo "MD5 sums do not match"
   exit
fi
wine $INSTALLER $ARGUMENTS

Link to comment
Share on other sites

Wow, great and thoughtful work snake45.

 

Did you notice that you can install some games and applications through winetricks?

For example here is Tiberian Sun:

https://github.com/Winetricks/winetricks/blob/master/src/winetricks#L12586

 

Wouldn't that be a great outlet for installing the cncnet version? Do you think you could update their existing installer for TS?

 

(But even if you don't want to work on the winetricks port.... Thumbs up!)

Link to comment
Share on other sites

well poop.. i didnt even know you could install games there. more wasted time.. oh well, hehe. anyhow i will leave those decisions to admins. i just figured id contribute if i could as cnc was life back when and was excited to see it revived.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...