All three can be done, yet I do not recommend #3 at all (just don't do it).
Use Windows Installer properties to implement #1 would best meet your goals.
If you don't put any condition on the custom action you use to generate your
properties, it will run every time (install, remove, repair, upgrade,
everything). Make sure your custom action is an immediate custom action so
that it can set the properties. Know that immediate custom actions are not
normally elevated, so hopefully you can read Excel's registry key without
requiring elevation.

-Blair

-----Original Message-----
From: Miles Waller [mailto:miles.wal...@gmail.com] 
Sent: Thursday, May 26, 2011 6:53 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Installer with variable registry key

Hi,

I'm writing an installer for an excel addin.  In order to register the
addin, with excel, I need to add an entry under a registry key.  The entries
are named OPEN, OPEN2, OPEN3 ... sequentially for each addin that is
registered.

Because many addins could have been installed by the user before the
installer runs, and also the user could remove some other addin (which
causes excel to rewrite the registry entries so they are still sequential
with no gaps), then go to uninstall my addin, the names of the entries in
the registry need to be determined at install time, which I will do in a
custom action.

What's the cleanest way to do this, to ensure uninstall and rollback all
work properly?  I considered the following:

 1. run an immediate action which examines the registry and sets a property
with the entry name that will be used; this property can then be used by a
normal registry action within wix;
 2. run an immediate action which examines the registry and inserts rows in
the "registry" table so that when the install actually runs, it will insert
the correct key;
 3. run a deferred action that does all the checking and adds the registry
entries in one place.

I was aiming to do as little as possible in the custom action, and keep as
much in the xml as possible, but it does seem to be an uphill struggle...!

Last of all, in the uninstall sequence, do immediate actions get to run (and
if so, when) or would 1 or 2 above not work simply because they never get
fired.

Thanks,

Miles
----------------------------------------------------------------------------
--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to