Adding key to Registry - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

lekfir
Posts: 130
Joined: Sun Feb 15, 2009 5:26 pm

Adding key to Registry

Hi,
I want to add a String Value to existing registry key.
How can I perform that?
Thanks!
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Adding key to Registry

Hi,

In the Registry page you can create the value you want and in the Edit Registry Entry dialog you can select the "Append to existing value" option. Please note that this works only for REG_MULTI_SZ entries. If you need a REG_SZ entry, you can try using a custom action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lekfir
Posts: 130
Joined: Sun Feb 15, 2009 5:26 pm

Re: Adding key to Registry

Thanks Cosmin.
1. I want to add values only if the key exit. For example, only if HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Filetrace, I want to add a new String value.
2. I want that on uninstall, this value will not be deleted.
3. In addition, I am changing a value of another Reg_DWORD and not inserting a new value. (Changing the a value from '2' to '3'), how can i perform that so on uninstall the value will not be deleted or atleast will be the same as it was before my installation?

Thanks agan!
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Adding key to Registry

Hello,

1) You can use a Search to detect if that registry key exists, the result will be stored in a property (let's say ABC)
2) Create your registry key from the Registry page, then go to the Organization page, and mark the newly added registry key's component as "Do not register with Windows Installer". Condition that component with something like:

Code: Select all

(Not Installed) AND ABC
This will install the component (and it's registry resource) only if the search found the registry value you were looking for at step 1)
3) If you are looking for incrementing/decrementing a registry value, this thread discusses it in detail.
Marking a component as "Do not register with Windows Installer" will leave that component and its associated resources on the computer. Note however that leaving resources on a computer after uninstall is not recommended, and definitely unacceptable should you ever need to apply for Windows Certification.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”