Page 1 of 1 1
Topic Options
#142158 - 2005-06-22 03:51 PM @vmguest macro?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
Would it be possible to add a macro that would return 1 if the session is running within a VMware or VirtualPC guest session? I know it's possible to detect using script code, but a macro would be simpler. Just a thought.
_________________________
silence is golden, but duct tape is silver

Top
#142159 - 2005-06-22 03:57 PM Re: @vmguest macro?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
how you do it scriptwise?
_________________________
!

download KiXnet

Top
#142160 - 2005-06-22 05:26 PM Re: @vmguest macro?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Well here is part of the code Lonk.

You can run a UDF and check for running service too.

Code:
$VMWUser            = Trim(ReadValue($HKLMSMWCV + '\Run','VMware User Process'))
$VMWPath = ReadValue($HKLMSMWCV + '\App Paths\vmware.exe','Path')
$VMWVer = GetFileVersion($VMWPath +'\vmware.exe','ProductVersion')
$VMWToolsVer = GetFileVersion(ReadValue($HKLMSCCS + '\Services\VMware Tools Service','ImagePath'),'ProductVersion')
$CVMVer = GetFileVersion(Left(ReadValue('HKLM\SOFTWARE\Classes\Virtual.PC.Floppy\DefaultIcon',""),-5),'ProductVersion')
$CVMMapper = ReadValue($HKLMSCCS + '\Services\VPCMap','DisplayName')
$CVMMapperVer = GetFileVersion(ReadValue($HKLMSCCS + '\Services\VPCMap','ImagePath'),'ProductVersion')


 

Top
#142161 - 2005-06-22 06:14 PM Re: @vmguest macro?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
Exactly (NTdoc), thanks. A more crude alternative is to look for the file VMwareUser.exe under %programfiles%\vmware\vmware tools\ but that's not reliable when the guest doesn't have vmware tools installed. There's also (optionally) a control panel applet with a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls named VMCPL with a path value assigned (if VMware tools are installed)

Edited by DaveS (2005-06-22 06:24 PM)
_________________________
silence is golden, but duct tape is silver

Top
#142162 - 2005-06-22 06:29 PM Re: @vmguest macro?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, you say there is an easy way to check this with simple reg read and you want it to be applied as macro?
I vote against.
_________________________
!

download KiXnet

Top
#142163 - 2005-06-22 06:38 PM Re: @vmguest macro?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
It's actually a combination of reg-reads and file searching, but different for each product (VMware workstation, VMware GSX/ESX, VirtualPC, VirtualServer, etc.) There's a macro now for @tssession, which is somewhat similar with respect to it showing that you're not running on a "real" or "physical" client. Oh well, nevermind then. Just a suggestion.
_________________________
silence is golden, but duct tape is silver

Top
#142164 - 2005-06-22 06:41 PM Re: @vmguest macro?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol, don't do neverminding when only one person is against, m'kay?
_________________________
!

download KiXnet

Top
#142165 - 2005-06-22 06:44 PM Re: @vmguest macro?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
m'kay
_________________________
silence is golden, but duct tape is silver

Top
#142166 - 2005-06-22 06:50 PM Re: @vmguest macro?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Not sure Ruud can do so easily either. That is part of the issue. Microsoft and VMware are the two biggest players in this field, but the method to determine the version and if it's running does change with each version which makes it a running crap shoot so to speak.

If you really want it then I think you should locate ALL the valid and ACCURATE methods to determine the information, then Ruud could decide to put as macro or not. Just don't think Ruud should have to be the one to track down all that information.

 

Top
#142167 - 2005-06-23 05:19 AM Re: @vmguest macro?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
In general, a good idea. However, all the different versions of VMWare and Virtual PC could cause a maintenance nightmare. For example, do VMWare Workstation, GSX, and ESX Server all behave the same? What about v4 and v5 of VMWare Workstaton?

I think this should rather be handled via UDF as the turn-around time for detection updates would be much shorter.


Edited by sealeopard (2005-06-24 06:07 AM)
_________________________
There are two types of vessels, submarines and targets.

Top
#142168 - 2005-06-23 09:20 PM Re: @vmguest macro?
Skatterbrainz Offline
Starting to like KiXtart

Registered: 2002-10-17
Posts: 172
Loc: Virginia, USA
Actually, you make perfect sense. I can see where it could quickly diverge from the macro def and create problems. I can continue using the UDF approach without any setbacks. Thanks for giving this due consideration.
_________________________
silence is golden, but duct tape is silver

Top
Page 1 of 1 1


Moderator:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org