I'm finding that the key is only deleted if it's empty: it has no
values, and the default value is not set. This is both using your
example, and using an Action='createKey' <Registry> element to
explicitly create the key that you're interested in, as follows:
 
<Registry Id='Reg01Parent' Root='HKLM' Key='Software\Acme'
Action='createKey'>
      <Registry Id='Reg01' Name='SomeIntKey' Type='integer' Value='1'
Action='write' />
</Registry>

I suspect this is an underlying issue with Windows Installer. Viewing
the output .msi with Orca shows the following data (table, best viewed
in fixed-width font):
 
Registry    | Root | Key           | Name       | Value | Component
------------+------+---------------+------------+-------+---------------
--
Reg01       | 2    | Software\Acme | SomeIntKey | #1    | MainExecutable
Reg01Parent | 2    | Software\Acme | +          |       | MainExecutable

Your example has only the 'Reg01' row present.
 
If your application depends on an empty key being present I think you'll
have to work around it. If you need to reset a registry value to the
value it had before installation, rather than removing the value, then I
think you will need to use a custom action - I can't see any way in the
Registry table
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/se
tup/registry_table.asp) of leaving a value on the system.

(Registry terminology: keys contain values; values have data. This is
consistent with the API names, e.g. RegCreateKey, RegQueryValueEx,
RegSetValueEx. Note that Windows Installer's schema is inconsistent in
its use of terminology here: 'Name' should, IMO, be 'ValueName' and
'Value' should be data.)
 
-- 
Mike Dimmick

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Douglas
Watts
Sent: 15 September 2006 15:47
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Registry Key on Uninstall



WIX Version: 2.0.4415.0

Problem Summary: How to prevent pre-existing registry keys from being
removed during uninstall.

 

I'm still quite new to WiX so please bear with me.  I am trying to
understand a scenario.

I am going to install an application that will create some registry
entries but will also update some that already exist.  During the
uninstall all registry keys are removed.  I need to keep any that
already existed.

 

Here is a simple script that shows what I'm talking about.  To test it,
simply create a README.TXT file for it to install.  Also, manually
create a registry key in HKLM\Software\Acme called 'SomeIntKey'.  The
key is a DWORD so set its value to any non-zero value.

 

If you install the MSI created with this script then the registry key is
changed to 1 (that's good).  Now uninstall the MSI.  The key is removed
(that's bad)!

 

How do I prevent the key from being removed during uninstall?

 

<?xml version='1.0'?>

<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>

   <Product Id='457E3468-BA41-47bd-83A8-F6D44B282171'

            Name='Test Package'

            Language='1033'

            Version='1.0.0.0'

            Manufacturer='Acme, Inc.'>

 

      <Package Id='????????-????-????-????-????????????'

               Description='My first Windows Installer package'

               Comments='This is my first attempt at creating a Windows
Installer database'

               Manufacturer='Acme, Inc.'

               InstallerVersion='200'

               Compressed='yes' />

 

      <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />

 

      <Directory Id='TARGETDIR' Name='SourceDir'>

         <Directory Id='ProgramFilesFolder'>

            <Directory Id='INSTALLDIR' Name='TestProg' LongName='Test
Program'>

               <Component Id='MyComponent'
Guid='457E3468-BA41-47bd-83A8-F6D44B282173'>

                  <File Id='readme' Name='readme.txt' DiskId='1'
src='readme.txt' />

                  <Registry Id='Reg01' Root='HKLM' Key='Software\Acme'
Name='SomeIntKey' Type='integer' Value='1' Action='write' />

               </Component>

            </Directory>

         </Directory>

      </Directory>

 

      <Feature Id='MyFeature' Title='My 1st Feature' Level='1'>

         <ComponentRef Id='MyComponent' />

      </Feature>

   </Product>

</Wix>

 

 

__________________________________

Doug Watts

Advectis, Inc.

Direct: 678.460.4605

Cell:   770.314.6704

 

The #1 Network for Mortgage Document Collaboration

 

Information contained in this email message is intended only for the use
of the individual or entity to which it is addressed, and may contain
information that is privileged, confidential, and exempt from disclosure
under applicable law. Access to this email by anyone other than the
addressee is prohibited. If you are not the intended addressee,  you may
not copy, forward disclose or otherwise use it or any part of it in any
way. To do so may be unlawful. If you received this e-mail by mistake,
please advise the sender immediately. 

 

 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to