Hello WiX community,

After the advice given to me yesterday, I've been focusing on the
subject I've had least replies on. Basically, I am trying to only
write a registry entry if it does not exist and create some keys to go
with it, or if it does exist, I want to modify things, and at
uninstall time, restore things to how they were. Since my attempts so
far combined with examples will probably be more informative, here
they come:

<Property Id="PROGID_XYZ" Value="Test.ProgID">
      <RegistrySearch Id='ExtXyzRegistry' Type='raw'
        Root='HKLM' Key='Software\CLASSES\.xyz' />
</Property>

That ought to fill PROGID_XYZ with an already existing ProgID, or if
the filetype is unknown, substitute my own default handler.

<Component Id="ComponentXYZ" Guid="<snip>">
  <snip>
  <RegistryKey Root="HKLM" Key="Software\Classes\[PROGID_XYZ]"
                Action="createAndRemoveOnUninstall">
    <RegistryValue Type="string" Name="SomeWeirdValue" Value="Stuff" />
  </RegistryKey>
</Component>

This created the value in the proper place, but upon uninstallation,
it removed the entire key, which makes sense since I asked it to. But
in this case, the RegistrySearch was successful, and thus the
appropriate ProgID already existed, and I essentially wiped out the
file associations. Oops. How can I avoid this? If I were to make it
action="create", I would never remove the handler afterwards if I
understand correctly.

To have it all in a little neat list, these are the requirements I am
trying to achieve:
* .XYZ exists - make changes in existing ProgID.
* .XYZ does not exist - make the .XYZ key, and make my default ProgID.
* Uninstallation: .XYZ already existed at installation - place back
any settings I overwrote in the 'foreign' ProgID, and remove any new
entries I made.
* Uninstallation: .XYZ never existed at installation - remove .XYZ and
my default ProgID.

I have studied conditions, features, components and the various
options available to me with a RegistrySearch, but I am pretty much
lost. As such I appreciate any advice or examples you folks can give
me to work off. :)

Regards,

Jan Wester

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to