Unique computer id
Shari
shari at gypsyware.com
Thu Jul 21 09:24:07 CDT 2005
Okay, here is the verdict. I created a stack with one button, so
that the person having the problem could run this with the internet
on, and off, and send me a report to compare the two.
With the internet on, Test Three produced several lines of info,
including the Physical Address. Test One produced the desired info.
With the internet off, Test Three produced one line of text.
"Windows IP Configuration". That was it. Test One was empty,
accordingly.
Test Two worked in both instances, producing the same info. My
conclusion is that Test Two is more stable. Although in reading thru
the archives, there seemed to be a question about the stability of
such info.
As the problem seems only to happen on Windows, I did not test Mac
with this test. Far as I know, the Mac OSX code is stable (stable
meaning it gets some unique computer info on pretty much any OSX
system, and does not return "Nope".) I have no code for Mac PPC. If
anyone does, I'd love to have it.
### Mac OSX code ###
put shell("/sbin/ifconfig en0") into ifConfigs
if char 1 to 4 of ifConfigs = "zsh:" then
return "Nope"
else
get matchText(ifconfigs,"(?s)ether (.*?) ",getInfo) # These
are spaces on either side of (.*?)
if it is false then
return "Nope"
end if
### end Mac OSX code ###
### The code in the button of the test stack sent to the user: ###
on mouseUp
global checklist
put firstTest() into testOne
put secondTest("C") into testTwo
put thirdTest() into testThree
put the short date & return & the abbreviated time & return &
return into checklist
put "Test One" & return & base64encode(testOne) & return & return
after checklist
put "Test Two" & return & return & base64encode(testTwo) after checklist
put "Test Three" & return & base64encode(testThree) after checklist
put the effective filename of this stack into theFile
set the itemDel to "/"
put "checklist.txt" into the last item of theFile
open file theFile for write
write checklist to file theFile
close file theFile
answer "Checklist file has been created."
end mouseUp
function firstTest
local checkpointCharley
put (there is a file (specialFolderPath("system") &
"/IPCONFIG.EXE")) into winExists
put (there is a file (specialFolderPath("system") &
"/SYSTEM32/IPCONFIG.EXE")) into sys32Exists
if winExists or sys32Exists then
put "EXISTS" & return after checklist
set the hideConsoleWindows to true
put shell("ipconfig /all") into temp
get matchText(temp,"Physical Address[\. ]*:
([A-Z0-9-]*)",checkpointCharley)
else
put "Default" & return after checklist
return "Default"
end if
return checkpointCharley
end firstTest
function secondTest driveCharley
local checkpointJoe
put char 1 of driveCharley & ":" into pDisk
set the hideConsoleWindows to true
put shell("dir " & pDisk) into tDirData
get matchText(tDirData,"Volume Serial Number is (.*)\n",checkpointJoe)
if it is true then
return checkpointJoe
else if it is empty then
return "Empty"
else
return "Other"
end if
end secondTest
function thirdTest
local checkpointMajor
put (there is a file (specialFolderPath("system") &
"/IPCONFIG.EXE")) into winExists
put (there is a file (specialFolderPath("system") &
"/SYSTEM32/IPCONFIG.EXE")) into sys32Exists
if winExists or sys32Exists then
set the hideConsoleWindows to true
put shell("ipconfig /all") into checkpointMajor
end if
return checkpointMajor
end thirdTest
### end test code ###
--
Mac and Windows shareware games
http://www.gypsyware.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.runrev.com/pipermail/metacard/attachments/20050721/e9cc02f7/attachment.html
More information about the metacard
mailing list