All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - ADSReg.exe (REG file parser)
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 09 Aug 2002 :  08:26:47  Show Profile  Email Poster
ADSReg.exe: Registry parser

ADSReg is a registry file parser that allows you to easily apply registry key and value changes via a text file, similar to the Windows Desktop environment. By passing ADSReg.exe a file name as a command-line parameter, it will parse the target file and apply registry changes.

The parser supports all registry branches, including HKEY_CURRENT_USER, which is not supported by the parser in current ADS CE builds.

ADSReg currently supports the following value types:
  • REG_SZ

  • REG_DWORD

  • REG_BINARY

  • REG_EXPAND_SZ

  • REG_MULTI_SZ



All text on a line after a semicolon (;) is ignored by the parser, and can be used to delimit comments.

A sample reg file with syntax examples is included with the source.

Key APIs Used


_tfopen
_fgetts
fclose
RegCreateKeyEx
RegSetValueEx
RegCloseKey

Lines of code: 738


Source Download
Rev 5 (15k zip).



modified Mar 31, 03: Added API List and LOC
modified Mar 20, 03: Rev 5 mods - check file header for details (ctacke)
modified Feb 26, 03: Added REG_BINARY support (ctacke)
modified Feb 27, 03: Added REG_EXPAND_SZ and REG_MULTI_SZ support (ctacke)
modified Mar 4, 03: Added support for strings inside a REG_SZ value (ctacke)
modified Nov 29, 04: Note that parser supports the HKCU registry branch (akidder)

ctacke

877 Posts

Posted - 26 Feb 2003 :  18:10:10  Show Profile  Email Poster
Rev 2 Feature Update: REG_BINARY

We've added support for REG_BINARY data. Binary data is noted by "hex" (see above example) and may span multiple lines if a line continuation ("\") is used. The line continuation character MUST be the last character on the line to be valid.
Go to Top of Page

ctacke

877 Posts

Posted - 27 Feb 2003 :  11:13:54  Show Profile  Email Poster
Rev 3 Feature Update: REG_EXPAND_SZ and REG_MULTI_SZ

We've added support for REG_EXPAND_SZ and REG_MULTI_SZ data. These keys are noted in reg files by "hex(7)" and "hex(2)" respectively (see above example) and may span multiple lines if a line continuation ("\") is used. The line continuation character MUST be the last character on the line to be valid.
Go to Top of Page

ctacke

877 Posts

Posted - 04 Mar 2003 :  08:52:05  Show Profile  Email Poster
Rev 4 Feature Update: Double Quotes

We've added support for the double quote character (ASCII 34) inside a REG_SZ value. Now only the outermost quotes of the value are seen as the delimiter.

For example, to run an application whos path has a space in it from the Start | Run command, the entire command must be in quotes, like this:

"FlashFX DiskMyApp.exe"

If you want to persist this in the Run dropdown, you would add the following key to your REG file:


[HKEY_LOCAL_MACHINEExplorerRunHistory]
"0"=""FlashFX DiskMyApp.exe""


Note that the outermost quotes delimit the value so the inner quotes are treated as part of the value itself.
Go to Top of Page

ctacke

877 Posts

Posted - 20 Mar 2003 :  15:52:03  Show Profile  Email Poster
Rev 5 Feature Update: Improved Parsing of Comments; REG_MULTI_SZ as Strings

Rev 4 had some difficulties parsing lines that included comments, especially binary data with comments not on the final line. We've greatly improved the parsing algorithm and the parsing rules are included at the top of the ADSparse.cpp source file.

We have also added the ability to enter REG_MULTI_SZ keys as strings (supplementing the current ASCII value list) to make human entry of the values much simpler.
Go to Top of Page

ctacke

877 Posts

Posted - 20 Mar 2003 :  16:28:17  Show Profile  Email Poster
Registering ADSReg with system

If you want ADSReg.exe to automatically parse REG files when they are double-tapped, add the following registry keys to your system (which can be done with ADSReg!):


[HKEY_CLASSES_ROOT\.reg]
"Default"="regfile"

[HKEY_CLASSES_ROOT\regfile\DefaultIcon]
"Default"="\Windows\ADSReg.exe,0"

[HKEY_CLASSES_ROOT\regfile\Shell\open\command]
"Default"="\Windows\ADSReg.exe %1"
Go to Top of Page
  Topic  
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000