2

I am writing an installer using Wix 3 which installs a plugin to a 3rd party application. The application uses a group of registry keys to detect installed plugins. Each plugin is required to add a new subkey with a numerical name from 0-9 to the HKEY_LOCAL_MACHINE\SOFTWARE\Vendor\App\Plugins. The key contains a single string value which is the ProgId of a COM component which the application will instantiate. So for example I would need to add the following key to install my plugin:

HKEY_LOCAL_MACHINE\SOFTWARE\Vendor\App\Plugins\0
  REG_SZ   ProgId    "MyCompany.MyPlugin"

However, if the 0 key already exits, my installer needs to be smart enough to create key 1 instead of 0 and on down through key 9. Is there a way to achieve this using the Wix syntax? I know I can write a custom action to do this, but if at all possible I would like to avoid it.

1 Answer 1

2

You could use RegistrySearch to find the first empty value. But it would be easier to use the approach I describe at http://www.joyofsetup.com/2007/07/01/semi-custom-actions/.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the answer that was very slick and helpful. Just one question, in the post the last parameter passed to WcaAddTempRecord is wzComponent. Is this supposed to be the ID of a component already in my Wix files or should I use WcaAddTempRecord to add a new component to the component table specifically for my registry entry? Thanks again!
It should be an existing component that controls whether the registry values are written.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.