How to remove the demonic "Build and Sysgen" commands from Platform Builder for Windows Embedded Compact 7
By now, all of you reading this blog should know that you should NEVER EVER DO A BUILD AND SYSGEN (a "blddemo" without "-q") on your build tree.
The reason for this is that this command will try to rebuild the entire tree which (besides taking forever!) will overwrite binaries that may have been updated through QFE's and will result in errors because Microsoft does not supply all of the source code required to rebuild everything. Executing this command will lead to a corrupted build tree for which the only resolution is to do a complete re-install of Windows Embedded Compact 7. The "(Re)Build and sysgen" commands are only useful for people who have full source code: The Microsoft Windows Embedded Compact Development Team (even with premium shared source you don't get a full 100% of source code!).
This has always been an issue, ever since the invention of Windows CE (now known as Windows Embedded Compact).
Despite years and years of lobbying by many MVPs (including myself) with Microsoft they simply refuse to remove these demonic commands from the build menu. In previous versions of Windows CE it was very simple to remove these commands from the build menu (to prevent accidental clicking of these commands). Unfortunately, things have become worse in Platform Builder for Windows Embedded Compact 7. As in the previous version of Windows CE (6.0 R3) the "(Re)Build and Sysgen" commands are in the "Advanced Build" menu. In the previous version of CE you would simply "Customize" the toolbar and remove the "Build and Sysgen" commands from the "Advanced Build" menu. Not anymore... For some strange reason the "Advanced Build Commands" submenu now shows "(Advanced command placeholder)" when in "Customize-mode" and deleting individual commands is no longer possible:
So, what to do? Deleting the whole "Advanced Build Commands" menu seems a bit rigorous, especially since it does contain some very useful commands (like "Clean sysgen" and "Build Current BSP and Subprojects" etc.). All of these commands are also available by right clicking the correct nodes in the Solution Explorer, but still, it's nice to have them handy in the "Advanced Build Commands" menu as well.
Luckily, Platform Builder for Windows Embedded Compact 7 introduces a new feature; Custom Build Commands.
Using Custom Build Commands we can re-create the non-demonic commands from the "Advance Build Commands" menu and omit the demonic commands. That way we can safely delete the entire "Advanced Build Commands" menu, so let's start with that:
- Click "Customize..." in the "Tools" menu
- Click the "Build" menu
- Right click the "Advanced Build Commands" submenu
- Choose "Delete" from the context menu
- and finally close the "Customize" dialog
We can now add the useful commands back as custom build commands:
- Click "Options..." from the "Tools" menu
- Open the node "Platform Builder -> OS Design and Build -> Build Commands"
- Click on the "Add" button in the "Custom build commands" section
- Add the following commands:
- Sysgen (blddemo -q) blddemo -q
- Clean Sysgen (blddemo clean -q) blddemo clean -q
- Build Current BSP and Subprojects (blddemo -qbsp) blddemo -qbsp
- Rebuild Current BSP and Subprojects (blddemo -c -qbsp) blddemo -c -qbsp
Now click OK and see the magic in your "Build" menu: