Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Random/Unique or Serial DWORD property

1 view
Skip to first unread message

Christopher Painter

unread,
Jan 23, 2008, 9:38:07 PM1/23/08
to
I have a requirement that involves a registry dword value where every
time I install, reinstall, repair or uninstall he product I need to
write a value that has never been written to the registry value
before. This could be an increment pattern or a guid pattern.

I am attempting to do this without writing any custom actions ( other
then Type 51's of course ). Can anyone think of an elegant way to do
this or should I just write a CA and be done with it?

Thanks,
Chris

Stefan Krueger [MVP]

unread,
Jan 26, 2008, 2:19:44 PM1/26/08
to
Since there's no math functionality in Windows Installer, you would need a
custom action to increment a counter.
There's also no GUID generation functionality as far as I know, so again
that would require a custom action.

The only two options which come to my mind that wouldn't require a custom
action would be:
- Append instead of incrementing, like: read the existing string, append one
character and write it back. So the string will keep getting longer with
each (re-)install. Of course, this wouldn't be a DWORD if that's a
requirement.
- Use a predefined property that changes every time, like the Time property.
It's a string formatted accoring o the user's locale settings. Again, no
DWORD.

If you need to keep *and update* this entry even during uninstall I guess a
custom action is the only way. I believe Windows Installer won't write
entries from the Registry table during a complete uninstall (all components
being removed).

--
Stefan Krueger
Microsoft Windows Installer MVP

Please post your questions in the newsgroup or vist one of these web sites:

Windows Installer FAQ
http://www.msifaq.com - http://www.msifaq.de

InstallSite - Resources for Setup Developers
http://www.installsite.org
http://www.installsite.de (GERMAN)


"Christopher Painter" <chr...@yahoo.com> schrieb im Newsbeitrag
news:201f558a-fc8e-4f08...@l32g2000hse.googlegroups.com...

Christopher Painter

unread,
Jan 27, 2008, 12:25:02 PM1/27/08
to
Thanks Stefan. Unfortunatly the requirements ( including DWORD ) are
pretty much set in stone because I'm dealing with MS Office 2007.

http://blogs.msdn.com/mshneer/archive/2007/09/04/deploying-your-vsto-add-in-to-all-users-part-i.aspx
http://blogs.msdn.com/mshneer/archive/2007/09/05/deploying-your-vsto-add-in-to-all-users-part-ii.aspx

It seems there is a registry key in HKLM that contains a Count value
( DWORD ) and subkeys Create and Delete. When Office runs it checks
the HKCU Count to see if it's processed the command previously. If
not, it processes the Create / Delete command and updates the HKCU
count.

What I'm trying to do with this is use this pattern to indirectly
install and remove HKCU registry entries. Basically everytime Create
and Delete would be mutually exclusive registry components where the
Create needs to be created when the feature is added and delete needs
to be created on absence of the feature. Count has to always change
in order to send a signal for the state change to drive the pattern.

As you said, DWORD and install Delete component on uninstall is a
problem. One that I can ( and have ) easily solve with a CA but I was
trying to be more elegant in my solution.

And of course if anyone can think how to handle VSTO AddIns for all
users without dealing with the ugly nature of VSTOInstaller's per-use
story I'd love to hear that even more.

Thanks!

Chris

0 new messages