Because it is neither a question of an individual project nor of an OpenBuilder version, I made a new topic.
The issue really consists out of two separate issues which are independent from each other.
1st Part: The Driver Issue:
In the first version MS operating systems like XP and W2003 contain a file "Driver.cab" which contains a lot of drivers in compressed form.
When adding a service pack, an additional cab is added, usually called sp<N>.cab, where <N> is the number of the service pack.
Then some of the files inside driver.cab are obsolete and to be replaced by the sp<N>.cab files.
How to decide whether my source CD contains a service pack? This has to be done by the script itself and not by editing the script!
The installation CD contains a file DRVINDEX.INF with a section like
Maybe there is CabFiles=driver or CabFile=sp2,driver[Version]
signature="$Windows NT$"
CabFiles=sp1,driver
The CabFile values are symbolic links and points to a section like
where the real cab files can be found.[Cabs]
driver=driver.cab
sp1=sp1.cab
When looking for a driver, the script has to look into the first entry first. If the driver is not there then it has to look into the second entry.
2nd Part: The Mouclass Issue
It is not longer a mouclass issue but generally a driver issue.
Solution for #1 and #2:
In a projectinfo script some code like:
If,ExistFile,%allFiles%,FileDelete,%allFiles% If,ExistFile,%sglFiles%,FileDelete,%sglFiles% IniRead,"%SourceDir%\I386\%driverIndex%","Version","CabFiles","%myTemp%" FileCreateBlank,%allFiles% TXTAddLine,%allFiles%,"%myTemp%","Append" FileCreateBlank,%sglFiles% TXTAddLine,%sglFiles%,"[CabLinks]","Append" Set,"%cmd%","/c for /f #$qtokens=1-2 delims=#$c#$q %a in (%allFiles%) do echo link1=%a >> %sglFiles%&echo link2=%b >> %sglFiles%" ShellExecute,Hide,"cmd.exe", "%cmd%" IniRead,"%sglFiles%","CabLinks","link1","%spCab%" IniRead,"%sglFiles%","CabLinks","link2","%drCab%" If,%drCab%,NotEqual,"",If,%spCab%,NotEqual,"",IniRead,"%SourceDir%\I386\%driverIndex%","Cabs","%spCab%","%spCabFile%" If,%drCab%,Equal,"",If,%spCab%,NotEqual,"",IniRead,"%SourceDir%\I386\%driverIndex%","Cabs","%spCab%","%drCabFile%" If,%drCab%,NotEqual,"",IniRead,"%SourceDir%\I386\%driverIndex%","Cabs","%drCab%","%drCabFile%" IniWrite,"%iniFile%","Cabs","SP_CAB","%spCabFile%" IniWrite,"%iniFile%","Cabs","DR_CAB","%drCabFile%"and in the copy&expand script
IniRead,"%iniFile%","Cabs","SP_CAB","%spFile%" IniRead,"%iniFile%","Cabs","DR_CAB","%drFile%" If,"%spFile%",NotEqual,"",Run,%ScriptFile%,try-sp If,NotExistFile,#$q%TargetDir%\i386\system32\drivers\mouhid.sys#$q,ShellExecute,"hide","expand.exe","#$q%SourceDir%\I386\%drFile%#$q -F:mouhid.sys #$q%TargetDir%\i386\system32\drivers#$q" If,NotExistFile,#$q%TargetDir%\i386\system32\drivers\mouclass.sys#$q,ShellExecute,"hide","expand.exe","#$q%SourceDir%\I386\%drFile%#$q -F:mouclass.sys #$q%TargetDir%\i386\system32\drivers#$q" Set,"%cFile%",mouclass.sy Run,%ScriptFile%,driver-compress Set,"%cFile%",mouhid.sy Run,%ScriptFile%,driver-compress [try-sp] If,ExistFile,"%SourceDir%\I386\%spFile%",ShellExecute,"hide","expand.exe","#$q%SourceDir%\I386\%spFile%#$q -F:mouclass.sys #$q%TargetDir%\i386\system32\drivers#$q" If,ExistFile,"%SourceDir%\I386\%spFile%",ShellExecute,"hide","expand.exe","#$q%SourceDir%\I386\%spFile%#$q -F:mouhid.sys #$q%TargetDir%\i386\system32\drivers#$q" [driver-compress] Echo,"Cab Compressing file %cFile%s" If,ExistFile,"%TargetDir%\i386\system32\drivers\%cFile%s",ShellExecute,"hide","makecab.exe","%TargetDir%\i386\system32\drivers\%cFile%s %TargetDir%\i386\system32\drivers\%cFile%_" If,ExistFile,"%TargetDir%\i386\system32\drivers\%cFile%_",FileDelete,"%TargetDir%\i386\system32\drivers\%cFile%s"
Soon I'll post a NanoXP experimental project which will contain these and some more suggestions.
Peter
Edited by psc, 03 August 2006 - 02:45 PM.