Jump to content

ConvRegToAu3 - Reg to Autoit converter


Sanja Alone

Recommended Posts

ConvRegToAu3 - Reg to Autoit converter

Using AutoIt, i wrote a simple tool named ConvRegToAu3 for the conversion of reg-files in to the AutoIt-functions RegWrite and RegDelete.

Converter understands all types of parameters (known by AutoIt), supports the delete of branches and parameters (strings like [-branch] and "value"=-). Converter also replace absolute path by relative one (by default this feature is disabled - use /a1, /a2 command line switches or ReplAbsPaths parameter in crta.ini to enable it). For detailed information about configuration of replacement function see crta.ini.

Limitations:

A little slow work with large files (a 675Kb-regfile of branch HKLM\SYSTEM\CurrentControlSet\Services, chosen for a test, is processed almost 30 seconds on Athlon XP Thoroughbred-B 1500MHz). I do not consider this moment a problem, as a converter is intended not for conversion of registry, but for updating applications installation AutoIt-scripts with their settings from corresponding reg-files. Usually, reg-files with application settings have a small size (to one hundred kilobytes or little more), and such files are converted only a few seconds. Such nonlinear dependence is related to processing of arrays by AutoIt.

From version 2006-05-22 a little recoder (written on C++) from UTF-16 LE BOM, UTF-16 BE BOM, UTF-8 BOM to ANSI (WIN) encoding is built-in in crta (standard reg-file in the NT-like systems by default saved in the UTF-16 LE BOM).

Who needs such tool - Download it (scroll page down and press Download; file size is 142 Kb).

Site in Russian language, but you can download a converter and start it without parameters - a window will appear with a short description in English.

In addition, setup scripts of some applications are on this page.

Most scripts are intended for the Russian versions of the applications.

Comments inside scripts also in Russian language (CP Win-1251). If I will have spare time - will translate.

You may contact me via e-mail (in Russian, Ukrainian or English language)

P.S. Sorry for my bad English.

Edited by Sanja Alone
Link to comment
Share on other sites

  • 4 weeks later...

  • 4 weeks later...
Cool. :)

Thanks!

But the links are down at the moment.

Links are not down, but hosting is free :) Thus, then your try to download file, an additional page is open and your must click the link on this new page (http://sanjaalone.h15.ru/files/crta.zip). Sorry for this, but I don't have money for pay hosting-service and users will have to bear with such inconveniences. Or... do not use my converter and scripts.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I made some alterations in the converter

Changes (2006-01-31):

  • Progress bar is added (activated by the /b switch or ProgressBar parameter in the ini-file).

Changes (2006-01-30):

  • Added possibility of errors correction in the REG_SZ parameters containing the "carriage return" inwardly (regedit make mistakes at the export of such parameters in a reg-file) - you may disable this function using /f command line switch or parameter FixSZErr in the crta.ini.

Changes (2006-01-29):

  • The terms of verifications of types are toughened. Any quantity of "equal" characters in the names and in the values of any parameters are now correctly converted.
  • Branches/parameters are framed quotation marks in case of using REG ADD command for the empty parameters of type REG_MULTI_SZ. At difficult for converting combinations of characters in the names of such parameters, the warning is written in a resulting file. And in the case of the non-use of REG ADD, for these parameters, warning is always written about the error in case of such transformation (search strings beginnings with ;--- WARNING).
  • In case of impossibility of transformation of any parameter (from list of types supported by the converter) in a resulting file the proper report is written with information about a line number of initial file that became a source of problem (search strings beginnings with ;--- ERROR).
  • Possibility of setting of process priority for converter is added (switches /p0, /p1, /p2, /p3, /p4, /p5; and Priority parameter in the crta.ini file).

Changes (2006-01-27):

  • Work speed is considerably raised (almost in 10 times!) - test file converts about 30 sec. instead of 4,5 mins.
  • Problems with single quotation marks (') are fully removed in the names of branches, in the names of all parameters, and also inwardly REG_MULTI_SZ parameters - any amount of such characters now will be correctly converted in the sequence of Chr(39).
  • Added possibility of configuring by means of ini-file (see comments in the crta.ini). The command line switches have greater priority then ini-file parameters.
  • Added possibility to import of empty parameters of type REG_MULTI_SZ (hex(7):00,00 and hex(7):00) to the registry with help of command REG ADD. As AutoIt is not able to do such things themselves - all similar lines will grow into the analogue of hex(7):00,00,00. Command line switch /r will cancel using of REG ADD - in such case warning will be written in a resulting file.
  • Added ignoring of parameters of type REG_NONE (hex(0)).

Changes (2006-01-23):

  • Work is corrected with the multistring parameters of type REG_MULTI_SZ (linebreaks is now added @LF and parameters are correctly imported in a registry).
  • Recognition of parameters of REG_BINARY is complemented (now hex and hex(3)). This was not my mistake, simply regedit always exports the parameters of type REG_BINARY as hex, but frequently used by me RegShot (modificated by ParaGlider) - as hex(3). Both variants are correct and properly recognized now by ConvRegToAu3.
  • Added ignoring of parameters of types of REG_DWORD_BIG_ENDIAN (hex(5)), REG_LINK (hex(6)).
  • Now in a resulting file the lines like RegWrite('registry_branch') are written only if there is the proper empty registry_branch (without parameters and subbranches inwardly) in a reg-file. It is done for optimization of resulting AutoIt-scripts by reducing the number of redundant actions in it.
  • The command line parser is rewritten - the command line switches are now independent, also they can be used together (for example: crta in.reg /c/h/d). The new command line switch is added (/h) - copy to clipboard result of the last conversion only (current content of destination file are skipped; use this switch in conjunction with /c).

Edited by Sanja Alone
Link to comment
Share on other sites

  • 2 weeks later...

Changes (2006-07-14):

  • At the correction of errors in string parameters containing "carriage return" character, this character was replaced a macro @CR, now - @CRLF (such line feed is normally perceived by applications).

Changes (2006-06-22):

  • Put information about content of command line, and also results of its analysis to log file.
  • All entries in a log file now in two languages: Russian (if the OS language is Russian) and English - in all the other cases.
  • A language can be forcedly set by means of ini-file (parameter Language in crta.ini).

Changes (2006-06-20):

  • Added possibility to log actions (/l1, /l2 switches; parameters LogFile, LogLevel in an ini-file). Look details in crta.ini.
  • It is possible to use macros in a command line. The list of macros is extended (see crta.ini for details).
  • In the case of using /a1/c/h switches (i.e., when an initial file is an au3-script, and it is needed to replace in it absolute paths by relative one, and after replacement to place result of this operation in the clipboard) offcutted on 14 lines (size of "cap") content of destination file was placed in a buffer - it is corrected.

Changes (2006-06-16):

  • Format of resulting strings in paths-replacing function is changed to standard mode (uniting substrings). The mode Opt("ExpandVarStrings",1) is not used from now on.

Changes (2006-06-14):

  • Added function of replacement of absolute paths by relative one (both after transformation and generally without it - input file in this case must be an au3-script). A function is configured by means of ini-file (by default, variables undertake from current system environment). Along with long paths, the short paths (format 8.3) also replaced.

Changes (2006-05-22):

  • Added recognition of input Unicode-files (UTF-16 LE BOM, UTF-16 BE BOM, UTF-8 BOM) and their transformation to ANSI for the subsequent converting (you may disable this function using /u command line switch or parameter UTFtoANSI in the crta.ini).
  • Work is corrected with the singlestring parameters of type REG_MULTI_SZ (now here, as well as in multistring parameters, line feeds is correctly placed @LF).

Changes (2006-05-17):

  • Information is corrected about a line numbers of input file in reports ;--- ERROR and ;--- WARNING.

Changes (2006-05-16):

  • An error is corrected with progress bar control - it is now possible to combine the attributes of its window.
  • A standard icon is replaced with my avatar from forum.oszone.net.

Changes (2006-02-02):

  • Fixed an error, arising up in the case of delete of branch, containing in the name character "-".
  • The terms of determination of the wrong REG_SZ parameters and parameters of REG_DWORD are defined more precisely.
  • The proper report is written in a resulting file (;--- ERROR) if a resulting file line turns out longer 4095 characters (limitation of AutoIt), and also in the case of finding of parameters, unsupported by AutoIt types (REG_NONE (hex(0)), REG_DWORD_BIG_ENDIAN (hex(5)), REG_LINK (hex(6)), REG_RESOURCE_LIST (hex(8)), REG_FULL_RESOURCE_DESCRIPTOR (hex(9)), REG_RESOURCE_REQUIREMENTS_LIST (hex(a)), REG_QWORD (hex(b )), and also the wrong parameters of type DWORD (hex(4)) ).

Edited by Sanja Alone
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...