Skip to content

Instantly share code, notes, and snippets.

@Aetopia
Last active January 29, 2023 15:22
Show Gist options
  • Save Aetopia/62e7eba283a57acae02621b2e9756543 to your computer and use it in GitHub Desktop.
Save Aetopia/62e7eba283a57acae02621b2e9756543 to your computer and use it in GitHub Desktop.
Wait for an internet connection then launch a minimal instance of Steam.
  1. Install GCC.

  2. Run the following command to compile:

    gcc -Wall -Wextra -s -mwindows -Ofast LaunchSteam.c -lWininet -o LaunchSteam.exe
#include <windows.h>
#include <wininet.h>
#include <libgen.h>
int main(__attribute__((unused)) int argc, char *argv[])
{
SetCurrentDirectory(dirname(argv[0]));
while (!InternetGetConnectedState(NULL, 0))
Sleep(1);
// Steam Command Line Parameters: https://developer.valvesoftware.com/wiki/Command_Line_Options
ShellExecute(0,
"open",
"steam.exe",
"-silent -forceservice -no-browser -nofriendsui -no-dwrite -nocache -noverifyfiles -noreactlogin",
NULL,
SW_HIDE);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment