Jürgen Welzenbach did a nice job of showing how to filter files from the OS by using PostFmergeBIB.bat (see Discover the Windows Embedded Experience: A flexible way to exclude files from CE image), but I thought that I would take a shot at simplifying what he did. The main reason that I wanted to simplify it is to make it more understandable for those of you that aren’t so familiar with batch files. I also wanted to avoid embedding the tags that he used in the bib files directly.
Jürgen created a batch file named make_bibremove.bat which isn’t such a bad idea, but I ran into trouble with it because it wasn’t in my PATH and when PostFmergeBIB.bat is called the current directory isn’t the _FLATRELEASEDIR.
So what I did is included all of the “code” in PostFmergeBIB.bat and used a second file to list the files that should be removed from the OS by removing their reference from ce.bib. My PostFmergeBIB.bat is:
set TAGFILE=%_FLATRELEASEDIR%\platformbib.rem
set BIBFILE=%_FLATRELEASEDIR%\ce.bib
set TEMPFILE=%BIBFILE%2
 
 
if exist %TAGFILE% (
                REM use findstr to find all lines in %BIBFILE% that contain
                REM strings found in %TAGFILE% and exclude them from the output
                REM that is redirected into %TEMPFILE% Then move the %TEMPFILE%
                REM into the %BIBFILE%
                findstr /i /v /g:%TAGFILE% %BIBFILE% > %TEMPFILE%
                move /Y %TEMPFILE% %BIBFILE%
)
 
Platformbib.rem in the _FLATRELEASEDIR contains a list of files to be removed. Each line in the file should contain one file name. It might look like:
iesample.lnk
about.htm
aboutbg.gif
Now that we have a PostFmergeBIB.bat and a PlatformBIB.rem, we need to have someplace to keep them and we need them to be in the _FLATRELEASEDIR when makeimg runs. So place these files in your FILES folder (either in your Platform or OSDesign or PBWorkspace) which gives us a place to keep them. To copy them to the _FLATRELEASEDIR, you can manually copy them or you can run buildrel. When you run makeimg, your new PostFmergeBIB.bat will run after fmerge merges the bib files into ce.bib.
You may also be interested Micheal Verigan's article on filtering DAT files - Filtering dat files | GuruCE
For more on the Platform Builder build system take a look at: Summary of Building Windows CE which lists the articles that I have written about building Windows CE using Platform Builder.
 
Copyright © 2009 – Bruce Eitman
All Rights Reserved