mIRC Homepage
Posted By: dvl Detect if mIRC is running under Wine - 11/10/10 06:03 PM
Hi,

Is possible detect in some way if mIRC is running under Wine?

This is what I need.

Code:
if (!$wine) { 
;; Some commands for windows only, like $com
}


Thanks
Posted By: 5618 Re: Detect if mIRC is running under Wine - 11/10/10 06:12 PM
I'm not familiar with running mIRC under Wine, but what do $os return?
Posted By: Riamus2 Re: Detect if mIRC is running under Wine - 12/10/10 12:23 AM
$os most likely returns some version of Windows as it's emulating Windows.

I'm not sure what a good way of doing that would be, though you could "hack" it by seeing if certain COMs work or other things that aren't emulated completely. Of course, if those are ever emulated all the way, it will stop working. Maybe checking what processes are running (if Wine even allows that) would work and if the Wine program is running, then you know it's using Wine.
Posted By: dvl Re: Detect if mIRC is running under Wine - 12/10/10 12:50 AM
Code:
alias IsWine {
  .comopen winetest WbemScripting.SWbemLocator
  if ($com(winetest)) { .comclose winetest }
  return $comerr
}

alias test {
  if ($IsWine) { echo -st Running under Wine @ $OS } 
  else { echo -st Running under Windows $OS }
}


I'm not sure if it will be acurate all times, but atm is working for me...
Posted By: The_JD Re: Detect if mIRC is running under Wine - 14/10/10 05:45 AM
Works for me :-)
© mIRC Discussion Forums