OpenRCT2/scripts
Ted John a8b5304786
Remove exe / com wrapper around openrct2.dll for Windows (#10727)
We get repeated reports of people saying the game is incorrectly reported as a virus. It is becoming more inconvenient for players and even myself, because when we attempt to download a build, it is immediately deleted by scanners (including the default for Windows: Windows Defender).

One scanner is not too much of an issue, but the game is flagged by almost half of available scanners as reported by VirusTotal.

So why is it being flagged?

Windows has a very annoying concept, the subsystem for a binary. The console subsystem allows stdin / stdout as you would expect, just like posix. Unfortunately if a user runs a console subsystem binary from the desktop or explorer, the game will be opened under conhost and thus you get a console showing alongside the game window. This is not a good user experience for most players. To resolve this, you can use the windows subsystem, but this will detach stdin and stdout immediately on launch. There are hacks that can be done in code to allocate a new console but I found this to not work very well with stdin or other terminal emulators.

My solution to the problem was to have two binaries: openrct2.exe and openrct2.com. Both are executable but openrct2.exe is windows subsystem, openrct2.com is console subsystem. The desktop shortcut opens openrct2.exe with no console window showing. Typing openrct2 on the command line will execute openrct2.com (as .com has higher PATH precedence than .exe by default) with working stdin and stdout. In order to reduce the size, I have the entire game inside openrct2.dll and then supply two tiny wrapper EXEs that simply route main(...) into the DLL.

These wrapper EXEs are the problem, they are very small and do nothing but call into a DLL, this must match virus signatures too closely and their size probably reduces the data available for the scanner to analyse.

So as I can not find any other way of achieving my goal of a cli and gui version of OpenRCT2, this changes the build to publish openrct2 as a single executable (rather than a DLL + wrapper EXE), and then duplicate the entire ~10MB exe again and flip the subsystem flag. The installer and zip size won't be affected as this extra size will be completely compressed out, but when unpacked will lead to an extra ~10MB on disc. But I think it is a fair compromise.

VirusTotal now reports all artefacts as safe, for now anyway.
2020-02-18 11:35:27 +00:00
..
linux Change ninja options to less verbosity, continue on error (#10652) 2020-02-04 00:06:15 +01:00
stats Fix count-rct-globals script for Windows 2016-08-28 21:19:55 +01:00
build Change ninja options to less verbosity, continue on error (#10652) 2020-02-04 00:06:15 +01:00
build-appimage Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
build-installer Do major clean up of Windows CI workflow (#10581) 2020-01-19 14:04:59 +00:00
build-portable Remove exe / com wrapper around openrct2.dll for Windows (#10727) 2020-02-18 11:35:27 +00:00
build-symbols Remove exe / com wrapper around openrct2.dll for Windows (#10727) 2020-02-18 11:35:27 +00:00
check-code-formatting Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
get-discord-rpc Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
install-nsis Do major clean up of Windows CI workflow (#10581) 2020-01-19 14:04:59 +00:00
run-clang-format.py Print clang-format version 2019-12-22 21:48:34 +01:00
run-testpaint Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
run-tests Allow tests to work with CRLF test data 2020-02-02 15:47:50 +00:00
setenv Add Linux portable to GitHub CI (#10612) 2020-01-24 11:46:12 +00:00
upload-build Move Windows CI from AppVeyor to GitHub actions (#10573) 2020-01-16 13:17:17 +00:00
vstool Do major clean up of Windows CI workflow (#10581) 2020-01-19 14:04:59 +00:00
vstool.cmd Do major clean up of Windows CI workflow (#10581) 2020-01-19 14:04:59 +00:00