Hello again Adrian,
Yes, that fixed the error from occuring, but the registry value is not being set. It keeps the value of 'NotSet' which is what I defined in the 'Edit Property' dialog as the value. The custom action VBScript execution is current under the 'Install' node of the 'InstallExecuteSequence'.
This is because you are setting the property too late, meaning after the registry has already been created. Try placing your custom action under InstallExecuteSequence->Begin standard action. That should do it.
Secondly, how do I only set the registry entry on the first install? I solved it using the custom action with the '(NOT Installed) AND (NOT OLDPRODUCTS)' execution condition. The VBScript would only fire on first install which created the registry key and stored the datetime to the format I wanted. As per your reply, you said I should rather create the key in the registry page so that the installer will remove it on uninstall. Can I tell the registry value to only be set on first install?
You can condition the installation of the registry value by conditioning its component. Right click the registry value and select "Go to Component". You will be taken to the component to which the registry key belongs. In the right pane, place your condition in the component's condition field. Your component will now only be installed if the condition is true, and thus so will the registry value.
Let me know if this works for you.
Best regards,
Gabriel