Customizing Windows Embedded CE 6.0 makeimg processing using batch files


The Make Binary Image tool (Makeimg.exe) calls a number of programs and batch files in the process of making the run-time image (check http://msdn.microsoft.com/en-us/library/aa908853.aspx for details).

What you may not know is that makeimg checks for the existance of several batch files in %_FLATRELEASEDIR% at almost every step of its execution: this allow the developer who creates these files to perform custom build actions. The files that makeimg will call if it finds them are the following (note that %_FLATRELEASEDIR% is omitted):

  • PreMakeImg.bat: this file is called before makeimg runs other commands
  • PreFmergeBib.bat / PostFmergeBib.bat: these files are called immediatly before and after fmerge merges .bib files in ce.bib.
  • PreFmergeReg.bat / PostFmergeReg.bat: these files are called immediatly before and after fmerge merges .reg files in reginit.ini.
  • PreFmergeDb.bat / PostFmergeDb.bat: these files are called immediatly before and after fmerge merges .db files in initdb.ini.
  • PreFmergeObj.bat / PreFmergeObj.bat: these files are called immediatly before and after fmerge merges .dat files in initobj.tmp
  • PreRomImage.bat / PostRomImage.bat: these files are called immediatly before and after romimage is called (see below).
  • PostMakeImg.bat: this file is called after makeimg has run all the other commands.

There is a predefined PreRomImage.bat which is copied in the flat release directory from %_WINCEROOT%\PUBLIC\CEBASE\OAK\FILES. This file will call a batch file for each entry in the %_DEPTREES% variable – if a file named <depttree entry>-preri.bat exists – and the batch file %_TGTPLAT%-preri.bat which will get called last; the %_DEPTREES% environment variable lists the public projects under %_WINCEROOT%\PUBLIC (i.e. RDP, DCOM, IE,…) plus %_TGTPROJ%. This mean that you can perform pre-romimage steps on a public project, workspace or BSP base.

Note that if you put the batch files in the FILES folder in your OS design folder or in your BSP folder, they will be automatically copied in in the flat release directory.

Advertisements
This entry was posted in Windows Embedded CE and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s