Discussion:
[WiX-users] A bug?-get REG_SZ when using type="integer"
Bei Liu (Volt)
2007-05-16 01:12:09 UTC
Permalink
When use the <RegistryValue>, set the Type="integer",
result: REG_SZ,
expect: REG_DWORD

Is this bug?

Thanks,
Bob Arnson
2007-05-16 03:05:36 UTC
Permalink
Post by Bei Liu (Volt)
When use the <RegistryValue>, set the Type="integer",
result: REG_SZ,
expect: REG_DWORD
Is this bug?
Unlikely but it's impossible to say without more details. Can you show a
minimal example that repro's the problem?
--
sig://boB
http://joyofsetup.com/
BES Installer
2007-05-25 14:43:15 UTC
Permalink
I'm seeing the same behaviour.

In my component I have the following lines:

<RegistryValue Root="HKLM" Key="Software\MyCompany\MyProduct" Name="Port"
Value="[PORTVALUE]" Type="integer" />

<Property Id="PORTVALUE" Value="1234">
<RegistrySearch Id="RegPortValue" Root="HKLM"
Key="Software\MyCompany\MyProduct" Name="Port" Type="raw"></RegistrySearch>
</Property>

In the resulting package, the relevant line in the Property table is:

Property = PORTVALUE, Value="1234"

In the Registry table, Value = #[PORTVALUE].

When I run this on a fresh install, it correctly writes a DWORD with value
1234.
When in maintenance/upgrade, it writes a string with value #1234.

As far as I can tell, the value being retrieved from AppSearch is "#1234"..
but then when it tries to write it to the registry, the registry value
resolves to ##1234 which is a REG_SZ.

Does anyone know what I should be doing in this case? Or does no one beside
me ( and the original poster, apparently) try to preserve DWORD registry
values?

Thanks,
:D
Post by Bei Liu (Volt)
When use the <RegistryValue>, set the Type="integer",
result: REG_SZ,
expect: REG_DWORD
Is this bug?
Unlikely but it's impossible to say without more details. Can you show a
minimal example that repro's the problem?
--
sig://boB
http://joyofsetup.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Rob Mensching
2007-05-25 15:33:25 UTC
Permalink
Unfortunately, by design. That's the Windows Installer behavior for RegSearch. The MSI SDK will have more details if you desire.

From: wix-users-***@lists.sourceforge.net [mailto:wix-users-***@lists.sourceforge.net] On Behalf Of BES Installer
Sent: Friday, May 25, 2007 7:43 AM
To: Bob Arnson
Cc: Bei Liu (Volt); wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] A bug?-get REG_SZ when using type="integer"

I'm seeing the same behaviour.

In my component I have the following lines:

<RegistryValue Root="HKLM" Key="Software\MyCompany\MyProduct" Name="Port" Value="[PORTVALUE]" Type="integer" />

<Property Id="PORTVALUE" Value="1234">
<RegistrySearch Id="RegPortValue" Root="HKLM" Key="Software\MyCompany\MyProduct" Name="Port" Type="raw"></RegistrySearch>
</Property>

In the resulting package, the relevant line in the Property table is:

Property = PORTVALUE, Value="1234"

In the Registry table, Value = #[PORTVALUE].

When I run this on a fresh install, it correctly writes a DWORD with value 1234.
When in maintenance/upgrade, it writes a string with value #1234.

As far as I can tell, the value being retrieved from AppSearch is "#1234".. but then when it tries to write it to the registry, the registry value resolves to ##1234 which is a REG_SZ.

Does anyone know what I should be doing in this case? Or does no one beside me ( and the original poster, apparently) try to preserve DWORD registry values?

Thanks,
:D
On 5/15/07, Bob Arnson <***@joyofsetup.com<mailto:***@joyofsetup.com>> wrote:
Bei Liu (Volt) wrote:

When use the <RegistryValue>, set the Type="integer",

result: REG_SZ,

expect: REG_DWORD



Is this bug?

Unlikely but it's impossible to say without more details. Can you show a minimal example that repro's the problem?


--

sig://boB

http://joyofsetup.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
BES Installer
2007-05-25 18:21:50 UTC
Permalink
So to achieve the desired behaviour, setting the RegistryValue to Type
string but passing in a #-prefixed value will work with no side-affects,
correct? I mean, besides being conceptually wonky, of course.

That is,

<RegistryValue Root="HKLM" Key="Software\MyCompany\MyProduct" Name="Port"
Value="[PORTVALUE]" Type="string" />

<Property Id="PORTVALUE" Value="#1234">
<RegistrySearch Id="RegPortValue" Root="HKLM"
Key="Software\MyCompany\MyProduct" Name="Port" Type="raw"></RegistrySearch>
</Property>

Will write a DWORD on install, and also a DWORD on reinstall/upgrade?

:D
Post by Rob Mensching
Unfortunately, by design. That's the Windows Installer behavior for
RegSearch. The MSI SDK will have more details if you desire.
*Sent:* Friday, May 25, 2007 7:43 AM
*To:* Bob Arnson
*Subject:* Re: [WiX-users] A bug?-get REG_SZ when using type="integer"
I'm seeing the same behaviour.
<RegistryValue Root="HKLM" Key="Software\MyCompany\MyProduct" Name="Port"
Value="[PORTVALUE]" Type="integer" />
<Property Id="PORTVALUE" Value="1234">
<RegistrySearch Id="RegPortValue" Root="HKLM"
Key="Software\MyCompany\MyProduct" Name="Port" Type="raw"></RegistrySearch>
</Property>
Property = PORTVALUE, Value="1234"
In the Registry table, Value = #[PORTVALUE].
When I run this on a fresh install, it correctly writes a DWORD with value 1234.
When in maintenance/upgrade, it writes a string with value #1234.
As far as I can tell, the value being retrieved from AppSearch is
"#1234".. but then when it tries to write it to the registry, the registry
value resolves to ##1234 which is a REG_SZ.
Does anyone know what I should be doing in this case? Or does no one
beside me ( and the original poster, apparently) try to preserve DWORD
registry values?
Thanks,
:D
When use the <RegistryValue>, set the Type="integer",
result: REG_SZ,
expect: REG_DWORD
Is this bug?
Unlikely but it's impossible to say without more details. Can you show a
minimal example that repro's the problem?
--
sig://boB
http://joyofsetup.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...