1999-03-14 15:00:22 +01:00
|
|
|
|
|
|
|
Registry Command Line API Tool
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
This progam is intended to fill a particular need. I needed to make the
|
|
|
|
wine registry look like it would have been if my application would have
|
|
|
|
been installed by its installation program. Since this was not possible I
|
|
|
|
took the following approach.
|
|
|
|
|
|
|
|
1 - Use regedit to export my full Windows registry before I install my
|
|
|
|
application.
|
|
|
|
|
|
|
|
2 - Use regedit to export my full Windows registry after I had install my
|
|
|
|
application.
|
|
|
|
|
|
|
|
3 - Generate the differences between the two image. What I obtain from the
|
|
|
|
diff is what I need to apply to the wine registry.
|
|
|
|
|
|
|
|
Obvisouly the process is not that straight forward to solve, first,
|
|
|
|
you don't get the diff between two Windows regedit exported .reg file by
|
|
|
|
doing a simple diff. What I had to do is a little more complex, but not
|
|
|
|
that much...
|
|
|
|
|
|
|
|
(Assuming that the registry picture files are
|
|
|
|
named ./before.reg and ./after.reg)
|
|
|
|
|
|
|
|
1 - Parse the before.reg and after.reg file into regFixer.pl, in order to
|
|
|
|
obtain lines in the form [HKEY\Sub1\Sub2\...\Subn]"Value"="Data"
|
2001-02-12 19:10:43 +01:00
|
|
|
(where "Data" can be prefixed by the type identifier : hex:, hex(0000000?)
|
1999-03-14 15:00:22 +01:00
|
|
|
or dword:)
|
|
|
|
|
|
|
|
2 - Generate the diff between the before.reg.fix and after.reg.fix
|
|
|
|
into app.diff
|
|
|
|
|
|
|
|
Now we have a app.reg file that contain what has been done by installing the
|
2001-02-12 19:10:43 +01:00
|
|
|
application. To this we extract the parts that we are interested in using
|
1999-03-14 15:00:22 +01:00
|
|
|
grep (and fix it with sed) and put that into app.added by example
|
2001-02-12 19:10:43 +01:00
|
|
|
( let's say we keep the added values only ).
|
1999-03-14 15:00:22 +01:00
|
|
|
|
|
|
|
At this point we know which registry entry to add to the wine registry. It
|
2002-02-28 22:46:43 +01:00
|
|
|
only remains to take the format we have and reset it into a format we get from
|
|
|
|
regedit.
|
1999-03-14 15:00:22 +01:00
|
|
|
|
2001-02-12 19:10:43 +01:00
|
|
|
So, once you parsed app.added into regRestorer.pl you get an app.reg ready to
|
1999-03-14 15:00:22 +01:00
|
|
|
process by regapi.
|
|
|
|
|
|
|
|
So, this package comes with a few pieces:
|
|
|
|
|
|
|
|
regFixer.pl - Will convert the export of regedit
|
|
|
|
into something "diff-able"
|
|
|
|
|
|
|
|
regRestorer.pl - Will convert "cleaned" diff file into
|
|
|
|
something "regapi-able"
|
|
|
|
|
2000-05-18 02:52:22 +02:00
|
|
|
regSet.sh - Will do the procedure explained herein
|
1999-03-14 15:00:22 +01:00
|
|
|
for the added key only.
|
|
|
|
|
|
|
|
|
|
|
|
FAQ
|
|
|
|
---
|
|
|
|
|
|
|
|
Quick Start Guide
|
|
|
|
-----------------
|
|
|
|
1 - Get a snapshot of your windows registry in before.reg, (regedit/export)
|
2001-02-12 19:10:43 +01:00
|
|
|
2 - Install your application,
|
1999-03-14 15:00:22 +01:00
|
|
|
3 - Get a snapshot of your windows registry in after.reg.
|
|
|
|
4 - Invoke ./regSet.sh before.reg after.reg
|
|
|
|
|
|
|
|
|
|
|
|
Adding key I have in a regedit export file (nothing to diff with...)
|
|
|
|
------------------------------------------
|
|
|
|
1 - Invoke ./regSet.sh /dev/null myRegistry.reg
|
|
|
|
|
|
|
|
regapi help
|
|
|
|
-----------
|
|
|
|
1 - regapi has some sort of "man page like" help in it, simply invoke it
|
|
|
|
without any arguments.
|
|
|
|
|
|
|
|
Hope this is of any use to you.
|
|
|
|
|
|
|
|
Sylvain St-Germain.
|