Started implementation of the functions GetDefaultCommConfigA/W.
[wine.git] / programs / regapi / README
blobb1d3dceb624f42cb800db5cd884200c2f6ac2bfe
2 Registry Command Line API Tool
3 ------------------------------
5   This progam is intended to fill a particular need.  I needed to make the 
6   wine registry look like it would have been if my application would have 
7   been installed by its installation program.  Since this was not possible I 
8   took the following approach.
10   1 - Use regedit to export my full Windows registry before I install my 
11       application.
13   2 - Use regedit to export my full Windows registry after I had install my 
14       application.
16   3 - Generate the differences between the two image.   What I obtain from the 
17       diff is what I need to apply to the wine registry.
19   Obvisouly the process is not that straight forward to solve, first, 
20   you don't get the diff between two Windows regedit exported .reg file by 
21   doing a simple diff.   What I had to do is a little more complex, but not 
22   that much...
24   (Assuming that the registry picture files are 
25   named ./before.reg and ./after.reg)
27   1 - Parse the before.reg and after.reg file into regFixer.pl, in order to 
28       obtain lines in the form [HKEY\Sub1\Sub2\...\Subn]"Value"="Data"  
29       (where "Data" can be prefixed by the type identifyer : hex:, hex(0000000?) 
30       or dword:)
32   2 - Generate the diff between the before.reg.fix and after.reg.fix 
33       into app.diff
35   Now we have a app.reg file that contain what has been done by installing the
36   application.  To this we extract the part's that we are interested in using 
37   grep (and fix it with sed) and put that into app.added by example 
38   ( let say we keep the added values only ).
40   At this point we know which registry entry to add to the wine registry.  It 
41   only remains to take the format we have and reset it into a format similar
42   to the one we get from regedit.
44   I say "similar" because there is a tiny difference between Windows regedit 
45   export format and the format actualy required by the tool.
47   The problem with this (and it is not a big one) is that regedit export long 
48   data streams onto many lines, and since I dont have tons of time I setup 
49   another Perl script (regRestorer.pl) that fixes this (this could easily 
50   be done in C obviously) (left as excercise ;-) ).  
51     
52   So, once you parsed app.added into regRestorer.pl you get a app.reg ready to 
53   process by regapi.
55   So, this package comes with a few pieces:
57   regFixer.pl     - Will convert the export of regedit 
58                     into something "diff-able"
60   regRestorer.pl  - Will convert "cleaned" diff file into 
61                     something "regapi-able"
62   
63   regSet.sh       - Will do the procedure explained herein 
64                     for the added key only.
66   
67 FAQ
68 ---
70   Quick Start Guide
71   -----------------
72   1 - Get a snapshot of your windows registry in before.reg, (regedit/export)
73   2 - Install you're application,
74   3 - Get a snapshot of your windows registry in after.reg.
75   4 - Invoke ./regSet.sh before.reg after.reg
78   Adding key I have in a regedit export file (nothing to diff with...)
79   ------------------------------------------
80   1 - Invoke ./regSet.sh /dev/null myRegistry.reg
82   regapi help
83   -----------
84   1 - regapi has some sort of "man page like" help in it, simply invoke it 
85       without any arguments.
87 Hope this is of any use to you.
89 Sylvain St-Germain.