mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2010
Posts: 5
D
dvl Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Oct 2010
Posts: 5
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

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
I'm not familiar with running mIRC under Wine, but what do $os return?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
$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.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2010
Posts: 5
D
dvl Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Oct 2010
Posts: 5
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...

Joined: Mar 2006
Posts: 395
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
Works for me :-)


[02:16] * Titanic has quit IRC (Excess Flood)

Link Copied to Clipboard