Worf Posted December 12, 2008 Share Posted December 12, 2008 HiI am currently writting a program to aid in creating Unattended Windows XP CD and i need to be able to detect the windows version through the source file like Nlite does.Anyone have a routine that can do this?Many thanksWorf Link to comment Share on other sites More sharing options...
jaclaz Posted December 12, 2008 Share Posted December 12, 2008 Maybe you can use the PID's, see my post here:http://www.msfn.org/board/index.php?showtopic=127263&hl=jaclaz Link to comment Share on other sites More sharing options...
Yzöwl Posted December 12, 2008 Share Posted December 12, 2008 Or mine here! which with modification for install media would be something like this!@Echo off&SetlocalSet "Root=E:"Call :G_If %Pid% Equ 000 Echo: Other ^(includes some retail, upgrade and evaluation ^versions^)If %Pid% Equ 007 Echo: RetailIf %Pid% Equ 009 Echo: Not for resale - bundleIf %Pid% Equ 011 Echo: Upgrade ^(XP Home?^)If %Pid% Equ 083 Echo: Windows Genuine AdvantageIf %Pid% Equ OEM Echo: OEMIf %Pid% Equ 270 Echo: Volume LicenseIf %Pid% Equ 296 Echo: MSDNIf %Pid% Equ 308 Echo: Microsoft Action Pack subscriptionIf %Pid% Equ 347 Echo: Microsoft Action Pack subscriptionIf %Pid% Equ 335 Echo: RetailIf %Pid% Geq 640 (If %Pid% Leq 652 Echo: Volume License)If %Pid% Equ 699 Echo: Volume Windows XP Tablet EditionIf %Pid% Equ 071 Echo: UnknownPing -n 6 127.0.0.1>Nul&Goto :Eof:G_For /f "delims=" %%# In ('Find "Pid="^<%Root%\I386\SETUPP.INI') Do Set "%%#"Set "Pid=%Pid:~-3%"You would just need to alter the content of variable %Root% defined on line 2! Link to comment Share on other sites More sharing options...
mr_smartepants Posted December 13, 2008 Share Posted December 13, 2008 (edited) Here's the batch file I wrote for my OEMSCAN addon here: http://siginetsoftware.com/forum/showthread.php?t=272You should be able to tailor it for your use, it is designed to be run at T-39 via DetachedProgram in winnt.sif.It's primary mission is to find OEM PIDs, so you'll need to alter the code. A list of PIDs can be found here: http://wiki.lunarsoft.net/wiki/Product_IDsAfter the file copy stage, a new file is created for all unattended installs at %systemroot%\system32\$WINNT$.INFThe batch uses an entry in that to determine the install source at dospath=X:\blahIt then sets that as the source variable then scans for setupp.ini to check the PIDs.Pure magic I tell ya! Make the following entry in i386\winnt.sif (or unattend.txt)[GuiUnattended]DetachedProgram = CMD.EXEArguments="/Q /C FOR /F %? IN ('%SYSTEMROOT%\SYSTEM32\MOUNTVOL.EXE^|FINDSTR :\') DO IF EXIST %?WIN51 START %?.\OEM\OEMSCAN.CMD"Contents of OEMSCAN.CMD@echo offrem This batch file was created by mr_smartepantstitle= Scanning for matching OEMBIOS stringecho Scanning for matching OEMBIOS string, please waitFOR %%i IN (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 "%%i:\WIN51" SET CDROM=%%i::VARIABLESSET HOME="%CDROM%\OEM\SCAN_XHM"SET PRO="%CDROM%\OEM\SCAN_PRO"SET MCE="%CDROM%\OEM\SCAN_MCE"SET W2K3="%CDROM%\OEM\SCAN_2k3":PATHsetLocal EnableDelayedExpansionfor /f "tokens=* delims= " %%a in (%systemroot%\system32\$WINNT$.INF) do (echo %%a | find "dospath=" > nulif not errorlevel 1 set str=%%a)for /f "tokens=2 delims==" %%a in ('echo !str!') do (SET dospath=%%aecho dospath=!dospath!):TYPEif not exist %dospath%\I386\SETUPP.INI goto TYPEXfor /f "tokens=* delims= " %%? in (%dospath%\I386\SETUPP.INI) do set Pid=%%?set Pid=%Pid:~-3%if '%Pid%'=='OEM' echo WinXP OEM version detected && goto VERSION:TYPEXecho "Incorrect Windows type. OEM files not found!"goto ERROR:VERSIONsetLocal EnableDelayedExpansionfor /f "tokens=* delims= " %%a in (%dospath%\I386\SETUPP.INI) do (echo %%a | find "Pid=" > nulif not errorlevel 1 set str=%%a)for /f "tokens=2 delims==" %%a in ('echo !str!') do (set myvar=%%aecho myvar=!myvar!set finalvar=!myvar:~0,5!echo finalvar=!finalvar!)rem English PIDsif '%finalvar%'=='76487' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76481' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76500' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76477' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='76475' echo WinXP Home version detected && goto HOMErem Other Language PIDsif '%finalvar%'=='76392' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76396' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76413' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76440' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76447' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='55375' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='55679' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='76470' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='76460' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='76412' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='76381' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='55372' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='55677' echo WinXP Home version detected && goto HOMErem win2003 PIDsif '%finalvar%'=='69712' echo Windows 2003 version detected && goto 2K3if '%finalvar%'=='69753' echo Windows 2003 version detected && goto 2K3if '%finalvar%'=='69713' echo Windows 2003 version detected && goto 2K3if '%finalvar%'=='69754' echo Windows 2003 version detected && goto 2K3if '%finalvar%'=='69770' echo Windows 2003 version detected && goto 2K3if '%finalvar%'=='69769' echo Windows 2003 version detected && goto 2K3rem questionable PIDsif '%finalvar%'=='55274' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='55276' echo WinXP Pro version detected && goto HOMEif '%finalvar%'=='55277' echo WinXP Home version detected && goto HOMEif '%finalvar%'=='55285' echo WinXP Pro version detected && goto MCEif '%finalvar%'=='55661' echo WinXP Pro version detected && goto MCE:VERSIONXecho "Could not find suitable SLP Product ID"goto ERROR:HOMEif not exist %CDROM%\win51ic goto MCECALL "%HOME%\OEMSCAN.EXE"GOTO END:MCEif not exist %CDROM%\win51ip goto 2K3if not exist %CDROM%\CMPNENTS\MEDIACTR\I386\MEDIACTR.CAB goto PROCALL "%MCE%\OEMSCAN.EXE"GOTO END:PROif not exist %CDROM%\win51ip goto 2K3CALL "%PRO%\OEMSCAN.EXE"GOTO END:2K3if not exist %CDROM%\win51aa goto 2K3aCALL "%W2K3%\OEMSCAN.EXE"GOTO END:2K3aif not exist %CDROM%\win51ia goto 2K3bCALL "%W2K3%\OEMSCAN.EXE"GOTO END:2K3bif not exist %CDROM%\win51ib goto 2K3cCALL "%W2K3%\OEMSCAN.EXE"GOTO END:2K3cif not exist %CDROM%\win51is goto ERRORCALL "%W2K3%\OEMSCAN.EXE"GOTO END:ENDEXIT:ERRORecho Could not match filesecho Please report errors to mr_smartepantspauseGOTO END Edited December 13, 2008 by mr_smartepants Link to comment Share on other sites More sharing options...
jaclaz Posted December 14, 2008 Share Posted December 14, 2008 It seems like there is a "new" 012:http://www.msfn.org/board/index.php?showto...127263&st=8jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now