Michel
Thu Sep 27 17:06:19 CDT 2007
For an elegant solution see my post about PostFmergeObj.bat here:
http://groups.google.co.nz/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/fc6b753f3fae63d3/1969d31b8bcdb80b?hl=en&lnk=st&q=group%3A*windowsce*+author%3Amichel+author%3Averhagen&rnum=19#1969d31b8bcdb80b
For your convenience, I've duplicated the text here:
--------------------------------------
To delete lines out of .dat files without modifying public code I
created the following batch file:
PostFmergeObj.bat:
-- Cut here --------------------------------------------
REM This batch file filters the DAT files
REM CE merges all DAT files into initobj.tmp
REM and then transforms initobj.tmp into a
REM UNICODE version initobj.dat.
REM Just before the conversion to unicode
REM the build system calls PostFmergeObj.bat
REM (this file). We filter out all the
REM strings defined in PostFmergeObj.txt
REM from initobj.tmp
@echo off
echo PostFmergeObj.bat entry.
pushd %_FLATRELEASEDIR%
del initobj.org
ren initobj.tmp initobj.org
findstr /i /v /g:PostFmergeObj.txt initobj.org > initobj.tmp
popd
echo PostFmergeObj.bat exit.
@echo on
-- Cut here --------------------------------------------
This PostFmergeObj batch file uses a text file PostFmergeObj.txt which
contains the exact lines you want to delete out of the dat files. For
instance:
-- Cut here --------------------------------------------
root:-Directory("Program Files")
root:-Directory("My Documents")
Directory("\Program Files"):-File("Command Prompt.lnk","\Windows\cmd.lnk")
-- Cut here --------------------------------------------
Just create the PostFmergeObj.bat and PostFmergeObj.txt files in your
\WINCE500\PLATFORM\<BSP>\FILES folder and it all works automatically.
--------------------------------------
I wouldn't implement option 2 suggested by Bruce because it degrades
performance (copy, then delete; doesn't make any sense...)
Please note that CE uses an algorithm for processing the DAT files that
was designed for RAM based systems. If you mount a persisting medium as
root copying files using dat files will degrade boot performance quite a
bit (depending mostly on the amount of files being copied in your dat
files). Windows CE is doing some pretty dumb things with copying using
.dat files (the CE system *always* copies/creates *all* the
files/directories listed in the .dat files, even if those files/folders
already exist). Besides that it can be desirable to have a RAM disk to
quickly store temporary files (you can also get that with a persisted
root by including the RAM disk, I know...).
Michel Verhagen, eMVP
EmbeddedFusion
www.EmbeddedFusion.com
mverhagen at embeddedfusion dot com
Bruce Eitman [eMVP] wrote:
> I can think of three ways to solve this:
>
> 1. Add a filter to your premakeimg.bat file to remove the lines from the
> dat files
> 2. Run an app at startup that deletes the files from the desktop folder
> 3. Copy the appropriate .dat files from public to your FILES folder and
> remove the lines that put the files on the desktop
>
--