There is a static property you can use for this - PlatformService.IsUnix. Your code is looking for runtime, not environment.