BREW: Batch compile MIF file

In order to DYNAMICALLY insert values into the MIF, you must have .dtd files with the appropriate properties. You then import its properties using the MFX file.

Sample DTD file (cid.dtd)

<!ENTITY APPLICATION_CLASSID "0x00ABCDEF">

Another Sample DTD file (ver.dtd)

<!ENTITY APPLICATION_VERSION "1.0.0">

Sample MFX file

<?XML version="1.0" encoding="utf-8"?>
<!DOCTYPE BREWRes
[
<!ENTITY % version_dtd SYSTEM "ver.dtd">
<!ENTITY % classid_dtd SYSTEM "cid.dtd">
%version_dtd;
%classid_dtd;
]>

... some mfx stuff here

<String Id="8" Name="IDS_STRING_8">
<Text>&APPLICATION_VERSION;</Text>
</String>

... more mfx stuff here

<Applet BaseId="1000" CLSID="&APPLICATION_CLASSID;">

... more mfx stuff here

Finally, to put it all together, just make sure the MFX file can find the *.dtd files, and then call this in command prompt:

brewrc.exe -o output.mif -nh input.mfx

And you're done.

No comments: