Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

How to test for SSE2 capable CPU and Intel Chipset

- - - - -

  • Please log in to reply
15 replies to this topic

#1
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Hi guys,

I hope you can help me out here ...

Is there an easy way (for a non programmer like myself) to test for the presence of an SSE2 capable CPU during an unintended installation ? I would like to add ffdshow to my unattended installation but there are SSE2 special versions available so in case a SSE2 capable CPU is present, an optimized version should be installed of course.

Also ...

I would like to test for the presence of an Intel Chipset during installation because the usual winnt.sif way of installing the Intel Chipset drivers do not install the Intel disk drivers. Instead one has to call the Setup program using the -INTELIDE switch. However, on a Non Intel Chipset this will cause an error of course.

Thanks for any help you can give !
Happy new year !! :w00t:

Bye,
Alex


How to remove advertisement from MSFN

#2
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
No one ?? :(

I did a search but couldn´t dig up anything useful ...

Thanks,
Alex

#3
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts
Check these links:

http://web.inter.nl....rink/chkcpu.htm
This is a command line util. Output can be redirected to a file, then the file scanned to check what you need. The option most helpful for what you need is:
CHKCPU /V >> file.txt

http://www.cpuid.com/cpuz.php4
This utility has a "ghost" mode that the output gets directed to text file.
you might want to try this:
cpuz -file=test.txt
It also detects the HW chipset.

For the Intel Chipset thing:

For identifying I know that Everest Home edition allows to write a hw report to a text file. Checking the text file could be a possible solution to your problem. Also, everest does not need to be installed to use it, you could run it on a hidden cmd windows from a cd folder, then (with cmd-line parameters) specify that the report be written to a text file. There are some members here, like un4given1, that are cmd-line gurus. If you need to check for a particular string in a text file, he might be able to help.

You may want to check this thread. I have an Intel Chipset, but I have not tried to do an Unattended install of the Intel drivers yet (mostly use UACDs for my work). :}

When you say the Intel disk drivers, you mean IDE drivers? Have you tried to extract the files from the setup.exe file with 7-zip? I checked mine, and I can extract the contents from the exe file.

Also, you might try and get a look at the My Drivers utility. This utility allows you to backup the drivers files you have installed on your system.

#4
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Hi shotgun,

thanks for your detailed answer ! :thumbup

I have quickly tried both Chkcpu and CPUZ with your commands. The first one adds this to the file:

SSE2 support            : Yes

which should make it hard to use that information since it will only toggle yes or no and the word "SSE2" will always be in that file.

CPUZ on the other hand seems to be more useful because it gives this information amongst others:

Instructions Sets  MMX, SSE, SSE2


So I guess this means on an non SSE2 capable system, the word SSE2 will not appear in the text file.

However, I do not yet know what commands I would need inside a RUNONCEX.cmd (!!) to check for that phrase in that file.

I guess something like

"if exists SSE2 in file.txt then reg add ... SSE2 version "
"if not exists SSE2 in file.txt then reg add .... normal version"

But honestly, I don´t know the exact code. The above is just a wild guess .. :rolleyes:

As for the Intel Chipset, CPUZ, as you said, also detects the chipset but I cannot look for the word "INTEL" since the CPU is also described as INTEL ... :unsure:

When you say the Intel disk drivers, you mean IDE drivers? Have you tried to extract the files from the setup.exe file with 7-zip? I checked mine, and I can extract the contents from the exe file.


Yes, I mean the IDE drivers. I do install all the chipset drivers using the winnt.sif method and it does work fine for all chipsets BUT ... a normal installation will use the Microsoft pci.sys IDE drivers and not the intelide.sys drivers. Only if you install the Intel Chipset drivers using the -INTELIDE switch, will Windows use the intelide.sys driver.

Thanks,
Alex

#5
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts

which should make it hard to use that information since it will only toggle yes or no and the word "SSE2" will always be in that file.

Not if the SSE2 line is ALWAYS in the same place (not checked it thou) :whistle:
Even if the line changes, it would be a matter of searching for SSE2 then the YES or NO part. But as you mention, the CPUz maybe more useful for checking that.

As for the Intel Chipset, CPUZ, as you said, also detects the chipset but I cannot look for the word "INTEL" since the CPU is also described as INTEL ...

Ok. But it also reports the Chipset and IDE Controller. That's the section I believe will help you most. It reports the manufacturer (INTEL) only in the IDE Controller section, but in the CHIPSET it reports the chipset version in the Northbridge? and Southbridge sections.

I guess something like

"if exists SSE2 in file.txt then reg add ... SSE2 version "
"if not exists SSE2 in file.txt then reg add .... normal version"

But honestly, I don´t know the exact code. The above is just a wild guess .


I believe you would need to use FINDSTR (windows 2000/XP). It searches for a string within a text file. I'll keep searching for a quick way to use it for what you need. ;)

#6
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Hi Shotgun,

I believe you would need to use FINDSTR (windows 2000/XP). It searches for a string within a text file. I'll keep searching for a quick way to use it for what you need.


Thats lovely ! :w00t:

THANKS !
Alex

#7
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts
Got it!

Try this (TESTSSE2.BAT):
@echo off
chkcpu /v | findstr "SSE2" | findstr "No" > NUL

rem echo %errorlevel%
if not errorlevel 1 echo No SSE2 support! & goto end
if errorlevel 1 echo Processor supports SSE2! & goto end

:end

What this does is that the output of chkcpu gets redirected to the first findstr, which finds the line with "SSE2", then that output gets redirected to the 2nd findstr which tests for "No" in the output of the previous command. This 2nd output is redirected to NUL so that nothing is displayed. If you want to check it you can remove the "> NUL" part.

The remark (REM) is to show the value returned. I commented it out in case you want to change something and test.

That single line outputs 0 if the SSE2 has a No and a 1 otherwise.
The following lines just test the value returned and echo the appropiate message.

Hope that helps!

#8
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Argh, my head is spinning ! :P

Thanks, first of all for your help ! I do not completely understand your wonderful piece of code yet but I will nevertheless try it out !

However, now I get a "0" or a "1" right ? So what do I do know with those numbers ? Remember, I am in a runonceex.cmd so I think (?) I need something like "if exists" or "f not exists" ... but I am not sure ...

Sorry, for being such a neewb in these things ... :rolleyes:

Thanks,
Alex

#9
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Hi again,

after thinking about it for a while I came up with a solution:

@echo off

SET CDROM=%CD:~0,2%
%CDROM%\SETUP\Codecs\CHKCPU.EXE /v | findstr "SSE2" | findstr "No" > NUL

rem echo %errorlevel%
if not errorlevel 1 goto NoSSE2
if errorlevel 1 goto SSE2

:NoSSE2
start %CDROM%\SETUP\Codecs\ffdshow\ffdshow-20041012.exe /S
goto end

:SSE2
start %CDROM%\SETUP\Codecs\ffdshow\SSE2\ffdshow-20041012-sse2.exe /S
goto end

:end
exit

Would this work ? I will test it right away, however I have no idea how to do all that in a runonceex.cmd ...

But if it works, thats at least a good start ! :D

Thanks,
Alex

#10
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Well,

the SSE checking works but %CDROM% is not working in that bat file although it is working fine in runonceex.cmd :rolleyes:

Any other way to fill the %CDROM% variable with the correct drive letter during installation except for placing text files into the DVD root directory as explained in the FAQ ? I don´t like that too much, it´s kind of cheap :lol:

I would prefer to have all my code in runonceex anyway ... :rolleyes:

Thanks,
Alex

#11
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts

except for placing text files into the DVD root directory as explained in the FAQ ? I don´t like that too much, it´s kind of cheap

You could also check for a file that ONLY exists in the root dir of the CD drive you are installing from. The method mentioned in the FAQ works if you have more than one CD drive.

I use the GetCD program to set my %CDROM% variable. Check for info about it here: http://www.msfn.org/...showtopic=32957

BTW, your solution is perfectly acceptable! Your branching (goto's) are perfect! (at least 4 me)

If you want to run it from runonceex.cmd, you would:

Rename the batch/cmd you posted as inst_ffd.cmd

Then use something like this on your runonceex.cmd:

cmdow @ /HID
@echo off

IF EXIST D:\CD.txt set CDROM=D:
IF EXIST E:\CD.txt set CDROM=E:
IF EXIST F:\CD.txt set CDROM=F:
IF EXIST G:\CD.txt set CDROM=G:
IF EXIST H:\CD.txt set CDROM=H:
IF EXIST I:\CD.txt set CDROM=I:
IF EXIST J:\CD.txt set CDROM=J:

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%\001 /VE /D "Installing ffdshow..." /f
REG ADD %KEY%\001 /V 1 /D "%CDROM%\Software\inst_ffdshow.cmd" /f

EXIT


#12
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
Hi again, Shotgun,

yeah well, in the meantime I found out that the problem is that CHCKCPU will not run from CDROM, at least that "findstring" code part won´t work there. I guess thats because it needs to write to a file to check for that string ?? :unsure:

Anyway, if I copy it to C: and run the script from there, it works so thats fine with me.

I did add something similar to your code to my runonceex but thats not what I meant actually. I was asking if it is possible to add the whole code from the cmd to the runonceex, not just call the external cmd from the runonceex.

But it is working now so thats not a big problem :-)

I will try something similar for the Intel Chipset now .... :whistle:

Bye,
Alex

#13
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts

eah well, in the meantime I found out that the problem is that CHCKCPU will not run from CDROM, at least that "findstring" code part won´t work there. I guess thats because it needs to write to a file to check for that string ??

You need to copy FINDSTR.EXE to the CD too. It can be copied from the Winnt\system32 directory. Sorry I did not mention that before :whistle:

No file is written, the findstr reads the Output of the chkcpu command, by piping the output with the '|' character. Same thing for the second findstr. In others words, all string handling is done in the display buffer. The last > NUL makes sure the buffer is emptied (redirected to NULL device) so nothing is displayed to the screen. Try executing each part to see what I mean. ex:
CHKCPU /V

then... CHKCPU /V | FINDSTR "SSE2" ... etc.

Also, you mentioned not being able to set the %CDROM% variable, how then you were able to run CHKCPU from the CD if the variable was NOT set to point to the CD?

Please detail your answer since I'm confused by your comment. I'm assuming you are running everything from the CD and the system is completely 'blanked out' (no OS installed before you put the CD. BTW, what are you using for testing the CD install part? Virtual PC, VMWare, a 'test system'?

I was asking if it is possible to add the whole code from the cmd to the runonceex, not just call the external cmd from the runonceex.

Yes and No. You need to call the external cmd, and any other external cmd since it has GOTO statements and you can't use conditional branching in RunOnceEx (the registry key where all these commands are being written). It's easier to maintain in case you want to change the order apps are being installed, or if you substitute an app for another in the future. It would be a headache to edit a large runonceex.cmd file than a small file that only set the specific entries, and the "load" of the work gets done by individual cmd files for each app installed. Many files, but in the end easier to maintain. Please keep in mind that the file is called runonceex.cmd just to remind that this cmd file writes the RunOnceEx registry entries, the moment Windows Executes that registry key it is just executing the statements written by the cmd file, NOT the cmd file itself. If you execute the runonceex.cmd file from an MSDOS window, open Registry Editor (start->run->regedit) then check the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
to see what the cmd just wrote. This key is executed upon first logon, so what gets written there will be executed on the first logon, then dissapear. Windows executes the entries on this key, one by one. It's possible to include more than one line, but that would make the runonceex.cmd file more complex than it needs to be.

#14
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts
HI again, Shotgun,

took me a while to answer because I had to test this on a "non SSE2 capable" system first and I didn´t have one around ...

Anyway, it did not work as expected on an old Athlon PC. This is because the script checks for "SSE2" and "No" but strangely enough, CHKCPU will not mention SSE2 at all if the processor does not even support SSE.

So I had to change the script to make it look for SSE2 and Yes.

That worked but only like this:

@echo off

FOR %%d IN (c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) DO IF EXIST %%d\AIO SET CDROM=%%d

%CDROM%\SETUP\CHKCPU\CHKCPU.EXE /v | %CDROM%\SETUP\CHKCPU\findstr.exe "SSE2" | %CDROM%\SETUP\CHKCPU\findstr.exe "Yes" > NUL
rem echo %errorlevel%
if not errorlevel 1 goto SSE2
if errorlevel 1 goto NoSSE2

:NoSSE2
start %CDROM%\SETUP\ffdshow\ffdshow-20041012.exe /S
goto end


:SSE2
start %CDROM%\SETUP\ffdshow\SSE2\ffdshow-20041012-sse2.exe /S
goto end

:end
exit

It does NOT work if I check for errorlevel 0 instead of 1. Any idea why ?? :rolleyes:

I was also able to complete a working script for checking the Chipset. To be more exact I had to make sure that the Intel Chipset uses one of the 6 ICH Southbridges because the INTEL IDE driver only works for those chipsets. Older chipsets are not supported anymore with the latest Intel Chipset driver so my script which uses CPU-Z goes liike this:

@echo off

%SYSTEMDRIVE%\CPU-Z\cpuz -file=%SYSTEMDRIVE%\chipsatz
findstr /I Southbridge %SYSTEMDRIVE%\chipsatz.txt  | findstr /I ich > NUL
echo %errorlevel% >> %SYSTEMDRIVE%\chipsatz.txt
rem echo %errorlevel% 
if not errorlevel 1 goto ich
if errorlevel 1 goto end

:ich
start %SYSTEMDRIVE%\install\Intel\Setup.exe -INTELIDE -s
goto end

:end
exit

This has to be run from harddisc as CPU-Z needs to write a file.

Of course I am in big trouble if findstr.exe suddenly outputs other errorlevels except 0 and 1 ! This won´t happen though, right ??? :rolleyes:

As for your last message, yes, I didn´t copy findstr.exe. Back then I didn´t even realize that this was a program :P I thought it was some kind of command like copy.

Thanks for all your help ! Couldn´t have done it without you !

:yes:

Bye,
Alex

#15
Shotgun

Shotgun

    Advanced Member

  • Member
  • PipPipPip
  • 462 posts
Check here for info on using FINDSTR.EXE.

It does NOT work if I check for errorlevel 0 instead of 1. Any idea why ??

I believe the last findstr sets errorlevel to 1 if the string is found. I'm not really sure if it returns errorlevel 0, after reading this: FIND.EXE Does Not Return the Proper Errorlevel in Windows NT

Of course I am in big trouble if findstr.exe suddenly outputs other errorlevels except 0 and 1 ! This won´t happen though, right ???

AFAIK, it only returns either 0 or 1.

Glad to be of help! :thumbup

#16
midiboy

midiboy

    Senior Member

  • Member
  • PipPipPipPip
  • 586 posts

I believe the last findstr sets errorlevel to 1 if the string is found. I'm not really sure if it returns errorlevel 0,


No, it returns 0 if the string is found and 1 if it is not found. That is not the problem. I can see the errorlevel when I echo it. That works properly. The problem lies within the if command.

If I check for errorlevel 0 instead of 1 then it will always jump to the same branch regardless of the errorlevel. If I check for errorlevel 1 it works.

Bye,
Alex




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN