| Home Page | Recent Changes | Preferences

OS Detection

Detecting the OS UT is running on.

Reasons are dubious, but this snippet will tell you which OS you're on.

if(consolecommand("get WinDrv.WindowsClient")=="Unrecognized property")
// I'm windows
if(consolecommand("get XDrv.XClient")=="Unrecognized property")
// I'm linux
if(consolecommand("get MacDrv.MacClient")=="Unrecognized property")
// I'm mac

Posted by Fish HF on the Beyond Unreal coding forums. Original thread can be found [6].

Comments

Trystan: Original poster referred to UT. I'll try to test this tonight to see if it works on UT2K3.

El Muerte TDS: and what about "SDLDrv.SDLClient" that one is system independed, besides on dedicated servers the viewport setting doesn't matter. Also, what is the use, the Unreal engine is system independed in UScript, even things like filenames are corrected.

Trystan: Knowledge considered useless now may be priceless in the future. shrug. Mychaeel requested it added so I tried to find a spot to put it in. Personally I rather enjoy knowing I can hit three platforms with one mod. =)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In