blog/_posts/2020-04-13-how-to-fix-the-s...

7.8 KiB

title date url layout category image description
How to fix The Saboteur installation on Origin and Windows 7 2020-04-13 18:00 how-to-fix-the-saboteur-installation-on-origin-and-windows-7 post Tutorials /img/blog/how-to-fix-the-saboteur-installation-on-origin-and-windows-7_1.png It's 2020, and there are still .NET issues within commercial programs...

A missing blog post image

Introduction

It's COVID-19, Spring (sales), and Epic Games is still running an offensive "dumping" strategy against Steam on the video games market.
But still, let's talk about Origin today, the EA's games platform.

I (very simply) wanted to enjoy Spring sales by getting a legit copy of the highly recommended The Saboteur (2009) game.

This blog post has been written in English to higher its helping potential, nevertheless some screen-shots show French content as the target system is my personal setup here.

An History of Sadness

So after having get a license, I have been downloading this piece of software, and (simply) expecting it to work out-of-the-box as any legitimately owned game.

And at this very moment (last step of the installation process), we got the (sadly) famous error message :

Error: The .Net Framework redistributable package was not installed successfully. Setup cannot continue. (5100)

Let's take a look to the installer log (C:\Program Files (x86)\Origin Games\The Saboteur\__Installer\InstallLog.txt) :

{% highlight plaintext %}


Install Date: 04/12/2020 12:28:18 Started logging


12:28:18 Install Location: C:\Program Files (x86)\Origin Games\The Saboteur
12:28:18 [...] 12:28:18 Touchup not running under compatibility mode 12:28:18 [...] 12:28:18 Processing EAIN file 'C:\PROGRA~1\ORIGIN~1\THESAB~1__INST~1\Touchup.dat'. 12:28:18 Installation registry missing. Game not yet installed. 12:28:18 (Config)Studio: Electronic Arts 12:28:18 (Config)Game Name: The Saboteur 12:28:18 (Config)Display Game Name: The Saboteur 12:28:18 (Config)Updating ForceUninstallAllFiles to: 0 12:28:18 (Config)Updating ForceUninstallAllFiles to: 1 12:28:18 EAI data version: 5.03.02.00 12:28:18 [...] 12:29:53 Started DotNet runtime install phase for: dotnet35sp1 12:29:53 Launching process: Command: "C:\PROGRA~1\ORIGIN~1\THESAB~1__INST~1\dotnet\dotnet35sp1\redist\dotnetfx35.exe" /q /norestart Working directory: C:\PROGRA~1\ORIGIN~1\THESAB~1__INST~1\dotnet\dotnet35sp1\redist
12:29:53 Process exited with exit code 5100. 12:29:53 Error installing DotNet runtime. 12:31:45 Installer finished with exit code: 1 12:31:45 Shutting down data reader.


12:31:45 Stopping install logging


{% endhighlight %}

The program to incriminate is this one : C:\Program Files (x86)\Origin Games\The Saboteur\__Installer\dotnet\dotnet35sp1\redist\dotnetfx35.exe.
It's actually an official .NET Framework 3.5 SP1 installer wizard shipped by the Origin team along with the game to meet required dependencies (SHA256 : 6ba7399eda49212524560c767045c18301cd4360b521be2363dd77e23da3cf36).

Anyway, if you do try to install it manually, the wizard will "advise" you to use "Programs and Features" and "enable" it from there.

A missing blog post image

Actually, if you got on this blog post, you might have sadly noticed the feature is already enabled 😂

A missing blog post image

What the EA team definitely missed is that, since October 2019, Micro$oft released .NET Framework 4.8 for Windows 7 SP1 (and above) through Windows Update (KB4503548). And it appears installing 3.5 on Windows 7 if this update is installed is broken.

A missing blog post image

So let's trust Micro$oft when they say the 3.5.1 version is installed (from here : ".NET Framework [4.8] runs side-by-side with the .NET Framework 3.5 SP1"), and let's try to "imitate" a successful installation of the latter.

One more issue, Origin bundles Touchup.exe, a program being run by Origin itself to install the game and its requirements.
I imagine it refers to the respective Touchup.dat file that should contain the dependencies list, but we can't really open and edit such a BLOB, as we would maybe have done against a regular configuration file.

A missing blog post image

So, how could I possibly trick Touchup and make it think the .NET dependency is already anyhow satisfied ?

Yes nice catch, here is a solution.
Open up a commands prompt (as cmd.exe or powershell.exe), and navigate through your file system until you encounter an executable program (your Web browser main binary for instance).
Run it with the same parameters passed by Touchup, close its GUI if one opened up, and check its exit code :

{% highlight batchfile %} cd .\a\windows\directory\path .program_name.exe /q /norestart echo %errorlevel% :: Replace %errorlevel% by $? on PowerShell. {% endhighlight %}

If the prompt prints 0 (or True on PowerShell), stop right here : You got a candidate.
Copy the binary program as C:\PROGRA~1\ORIGIN~1\THESAB~1\__INST~1\dotnet\dotnet35sp1\redist\dotnetfx35.exe (you should make a backup of the original dotnetfx35.exe before).

Once it's done, you may try to run the game installation from Origin again, and... surprise 🎉

But what if I can't manage to find any program exiting with 0 ?

It's I.T., you can build your own using Code::Blocks for instance 😉

Quicker solution, vlc.exe (yes, the awesome video player from VideoLAN) is a candidate.

{% highlight c %} #include <stdio.h>

int main(int argc, const char* argv[]) { printf("I'm about to trick Touchup !");

return 0;

} {% endhighlight %}

Paste the snippet above, compile it using the shipped-in MinGW, fetch the resulting .EXE under your newly created project's release build directory and rename it as dotnetfx35.exe.

Congratulations, you got your own .NET Framework 3.5 SP1 installer now :trollface:

Conclusion

So you'd have understood, here we worked around the installer non-modularity (and bug ?) by emulating a 0 exit code that would cause Touchup.exe to successfully exit too, tricking Origin and making it set the game as correctly and fully-installed in its local database...

Before leaving and hoping that this piece of writing helped you, an advice for the EA development managers : If your launcher s*cks before AND after its rewrite, maybe it's actually time to change the chair/keyboard middlewares (and rewrite it again), isn't it ?