I am attempting to accomplish something, but cannot seem to find my way through the issue. Can you help?

What I want to do:

I am writing an install for an upgrade to an existing application. I want to do the following:

Read the registry to find out if version 3.0 of our product is installed.

1. If the value exists, the variable “UPGRADE” is set to “TRUE”.

2. If UPGRADE = TRUE I want to modify four registry keys:

a. “HKCU\Software\Criterion\3.0”

b. “HKLM\Software\Criterion\3.0”

c. “HKCU\Software\Criterion”

d. “HKLM\Software\Criterion”

If I can modify the registry key names in this way, all of the sub-keys will already be there, and I will not have to write them out, again. This is imperative to the upgrade because the sub-keys are customized from customer to customer.

Is there a way to do this using Setup Factory? If not, can you point me to a good resource for registry modification via command line?