Borgas
Posts: 56
Joined: Tue Jan 22, 2008 10:49 pm

Modify is changing registry REG_DWORD

When running setup in modify mode. All registry REG_DWORD is changing to REG_SZ. The values has #as start char.
Attachments
setup.aip
(672.2 KiB) Downloaded 322 times
Borgas
Posts: 56
Joined: Tue Jan 22, 2008 10:49 pm

Re: Modify is changing registry REG_DWORD

It is not in Modify mode it is in Repair mode.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Modify is changing registry REG_DWORD

Hello,

Please note that the DWORD values are stored in the registry with the prefix "#". This character is needed in order to interpret and store the value as an integer. Please take a look on this article: Registry Table

On MaintenanceTypeDlg, your project contains an init event that sets the values of the properties that will be stored in DWORD registry values to the values of some registry searches. Please note that a search operation will always return a string. The DWORD value, interpreted as a string contains the "#" prefix.

This search value, that already contains a "#" character is then written in the registry as a DWORD, thus another "#" character will be added as a prefix.

In this case, if the value begins with two or more consecutive number signs "#", the first "#" is ignored and value is interpreted and stored as a string. That's why the registry type of your values is transformed in REG_SZ (string) and contains the "#" prefix.

The only workaround for this issue is to parse the result properties of the searches, trimming the first "#" character for the resulted string. You could achieve this using a VBS script custom action configured to run after "Searches" in "Wizzard Dialog stage". You should also drag this custom action in "Install Execution Stage" after "Searches", while pressing Shift key and select "Skip action in Install Execution Stage if executed in Dialogs Stage" option from "Advanced execution scenarios".

This is an example VBS code for REGTCPPORT property:

Code: Select all

mystring = Session.Property("REGTCPPORT")
mystring = Right(myString,Len(mystring) - 1)
Session.Property("REGTCPPORT")= mystring
Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”