Commit Graph

4 Commits

Author SHA1 Message Date
Margen67 2e8c16e028 Change shebang to env
Move parameters from shebang back into set.
Add set -e to setenv and vstool for consistency.
2022-03-16 18:21:11 -07:00
Margen67 3188865313
Script improvements (#14452)
shebang:
 Move parameters from set.
 Add newline after for consistency.
curl:
 Add -f;
  Prevents output on error.
 Use -O where applicable;
  -o with the same filename as the URL is pointless.
 Add -S after -s:
  Makes curl still error despite being silent.
build-symbols:
 Add zip fallback.
get-discord-rpc:
 Move git clone parameters before repository for readability.
 Use --depth 1 to speed up cloning.
install-nsis:
 Use ProgramData environment variable.
build-appimage-docker.sh:
 Add -e to docker run.
 Run script directly.
build-appimage.sh:
 Make if more consistent.
Remove unused Travis scripts.
setenv:
 unset instead of blanking variables.
vstool.cmd:
 Use ProgramFiles(x86) environment variable.
2021-04-12 19:01:15 -03:00
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
Ted John 3ba8369f22
Do major clean up of Windows CI workflow (#10581)
- Move many of the post build operations in openrc2.proj to bash scripts, some of which can be shared with the macOS and Linux CIs.
- Improve performance of NSIS stage by grabbing a pre-packaged portable zip from GitHub. This typically saves the CI a minute and is more reliable.
2020-01-19 14:04:59 +00:00