scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Check if steam is installed in wineprefix before installation

Open Kreyren opened this issue 6 years ago • 17 comments

I was trying to install Mafia II where it's installation failed, but steam was installed. While i try to run the same installation again it prompts me to install Steam which is already present in wineprefix which is not expected.

Recommends adding a sanity check for steam verb to check if steam is installed in said wineprefix to avoid duplicated. Same logic should also be included in other verbs.

Kreyren avatar Jun 05 '19 17:06 Kreyren

Is this possible? I.e. how should we determine whether or not Steam is installed. For example, checking if steam.exe is probably not sufficient.

plata avatar Jun 06 '19 18:06 plata

Is this possible? I.e. how should we determine whether or not Steam is installed. For example, checking if steam.exe is probably not sufficient.

i would check for executable and last file that is beeing installed in steam installation based on modify date. Unless you want to make a tarbar extraction and then follow up with tar -d to verify that it has been extracted correctly.

Example of sanitized code: https://github.com/RXT067/KREYROCK/blob/f89326058f850ce858b5b5f967e0cbc9405cbb04/src/slash-bedrock/share/brl-fetch/distros/exherbo

This example it checking for file content:

# Configuration of $td/etc/paludis/repositories/installed.conf
		if ! grep -qF "builddir = \${root}/var/tmp/paludis_${target_name}" "$td/etc/paludis/repositories/installed.conf" ; then
			printf "builddir = \${root}/var/tmp/paludis_${target_name}\n" \
				>> "$td/etc/paludis/repositories/installed.conf" || die "Unable to update $td/etc/paludis/repositories/installed.conf"
			info "File $td/etc/paludis/repositories/installed.conf has been configured"
		elif grep -qF "builddir = \${root}/var/tmp/paludis_${target_name}" "$td/etc/paludis/repositories/installed.conf" ; then
			info "File $td/etc/paludis/repositories/installed.conf is already configured"
		else
			unexpected_die
fi

Notice that there are no unexpected reactions either the expected file fits the if statement or it fails where else should never happend in this scenario. -> Would be cool if phoenicis has simmilar code quality

~~excluding that this is script~~

Kreyren avatar Jun 06 '19 18:06 Kreyren

I think this is dangerous. You cannot be 100% sure that this test is able to verify if there is a fully completed Steam installation. If the previous install crashed, the users might never be able to recover from that. Therefore I prefer the current behavior.

plata avatar Jun 07 '19 15:06 plata

Current behavior just installs over and causes all kinds of unexpected results.. That is more dangerous..

And you can be 100% sure depending on the implementation.. Those are basics of code sanitization..

For example in this scenario: Steam will self-repair if some files are missing so we can just add definitions to check only mandatory files for steam runtime.

Kreyren avatar Jun 08 '19 14:06 Kreyren

For example in this scenario: Steam will self-repair if some files are missing

That's exactly what I'm talking about. If we simply assume that Steam is installed already, this will not happen (possibly leaving a broken installation).

plata avatar Jun 08 '19 18:06 plata

That's exactly what I'm talking about. If we simply assume that Steam is installed already,

Which is insane since you can never be sure if steam was installed correctly..

Kreyren avatar Jun 08 '19 19:06 Kreyren

But that's my point: We cannot be sure if Steam was installed correctly. However, we can assume that the Steam installation itself knows if Steam was installed correctly.

plata avatar Jun 09 '19 09:06 plata

@plata We can be sure since we can check for the executable and other pathname..

Steam installation is just going to overwrite the steam based on my experience which is insane..

we don't want any unexpected results here!!!

Kreyren avatar Jun 10 '19 03:06 Kreyren

I had no problem installing a steam app today. However, It seems that the downloader "Downloading runtime json..." message is displayed everytime, the order messages only appear a few milliseconds. @plata any idea why ?

ImperatorS79 avatar Jun 10 '19 10:06 ImperatorS79

The message should be printed every time according to the code: https://github.com/PhoenicisOrg/scripts/blob/53a6846f18c9841225d063a1a5d15c7aa94abbdd/Engines/Wine/Engine/Implementation/script.js#L112 https://github.com/PhoenicisOrg/scripts/blob/53a6846f18c9841225d063a1a5d15c7aa94abbdd/Engines/Wine/Engine/Implementation/script.js#L127

plata avatar Jun 10 '19 10:06 plata

I though it would be printed only when the file is actually being downloaded.

ImperatorS79 avatar Jun 10 '19 10:06 ImperatorS79

The json is downloaded every time. The runtime itself is downloaded only if the json is different.

plata avatar Jun 10 '19 11:06 plata

Yes, but when the download is finished and a new message occurs, the json downloading message should disappear. But is seems it is displayed over and over while the installation process, like a default message.

ImperatorS79 avatar Jun 10 '19 11:06 ImperatorS79

Which message do you expect instead?

plata avatar Jun 10 '19 11:06 plata

All the messages in SteamScript.go() for example.

ImperatorS79 avatar Jun 10 '19 11:06 ImperatorS79

@ImperatorS79 which are? assuming it beeing wine output i doubt that phoenicis windows is optimize to handle them..

Also stop fragmenting issues this issue is about sanitization of steam script.

Kreyren avatar Jun 10 '19 15:06 Kreyren

This is not any wine output, I am talking about phoenicis message that guides you during the installation process. But you are right, I should open a new issue for that.

ImperatorS79 avatar Jun 10 '19 15:06 ImperatorS79