mIRC Home    About    Download    Register    News    Help

Print Thread
Detect if mIRC is running under Wine #226684 11/10/10 06:03 PM
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

Re: Detect if mIRC is running under Wine [Re: dvl] #226685 11/10/10 06:12 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
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?

Re: Detect if mIRC is running under Wine [Re: 5618] #226695 12/10/10 12:23 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
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
Re: Detect if mIRC is running under Wine [Re: dvl] #226699 12/10/10 12:50 AM
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...

Re: Detect if mIRC is running under Wine [Re: dvl] #226747 14/10/10 05:45 AM
Joined: Mar 2006
Posts: 393
T
The_JD Offline
Fjord artisan
Offline
Fjord artisan
T
Joined: Mar 2006
Posts: 393
Works for me :-)


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