Discussion:
[WiX-users] RegistrySearch for REG_DWORD handling using WiX Installer
Brian Pang
2010-11-19 22:16:21 UTC
Permalink
Hi,

RegistrySearch for REG_DWORD handling using WiX Installer.

After the RegistrySearch it returns REG_SZ with "#1".
How do you resolve this issue so it will set the return type to an REG_DWORD and
value of 1?

Thanks in advance!
<Property Id="PORT" Value="12345"> <RegistrySearch Id="idPORT"
Key="SOFTWARE\Company\Product" Name="Port" Root="HKLM" Type="raw" />
</Property> <File ..........> <RegistryKey Root="HKLM"
Key="SOFTWARE\Company\Product" Action="create"> <RegistryValue
Name="Port" Value="#[PORT]" Type="integer" /> </RegistryKey> </File>
Rob Mensching
2010-11-22 14:30:40 UTC
Permalink
Sadly, the Windows Installer doesn't support that.
Post by Brian Pang
Hi,
RegistrySearch for REG_DWORD handling using WiX Installer.
After the RegistrySearch it returns REG_SZ with "#1".
How do you resolve this issue so it will set the return type to an REG_DWORD and
value of 1?
Thanks in advance!
<Property Id="PORT" Value="12345"> <RegistrySearch Id="idPORT"
Key="SOFTWARE\Company\Product" Name="Port" Root="HKLM"
Type="raw" />
</Property> <File ..........> <RegistryKey Root="HKLM"
Key="SOFTWARE\Company\Product" Action="create">
<RegistryValue
Name="Port" Value="#[PORT]" Type="integer" /> </RegistryKey>
</File>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
--
virtually, Rob Mensching - http://RobMensching.com LLC
Neil Sleightholm
2010-11-22 17:57:47 UTC
Permalink
As Rob said it is not supported in Windows Installer but it quite a
simple custom action in DTF. I had a similar problem reading the SQL
port my instance was using, here is an example:

public static ActionResult ReadSqlTcpPort(Session session)
{
session.Log("Begin ReadSqlTcpPort");

using (RegistryKey reg =
Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL
Server\MYINSTANCE\MSSQLServer\SuperSocketNetLib\Tcp"))
{
// If key is found, look for value
if (null != reg)
{
session["SqlTcpPort"] = reg.GetValue("TcpPort",
string.Empty).ToString();
}
else
{
session["SqlTcpPort"] = string.Empty;
}
}

return ActionResult.Success;
}

Neil

-----Original Message-----
From: Brian Pang [mailto:***@yahoo.com]
Sent: 19 November 2010 22:16
To: WiX-***@lists.sourceforge.net
Subject: [WiX-users] RegistrySearch for REG_DWORD handling using WiX
Installer

Hi,

RegistrySearch for REG_DWORD handling using WiX Installer.

After the RegistrySearch it returns REG_SZ with "#1".
How do you resolve this issue so it will set the return type to an
REG_DWORD and
value of 1?

Thanks in advance!
<Property Id="PORT" Value="12345"> <RegistrySearch
Id="idPORT"
Key="SOFTWARE\Company\Product" Name="Port" Root="HKLM"
Type="raw" />
</Property> <File ..........> <RegistryKey Root="HKLM"
Key="SOFTWARE\Company\Product" Action="create">
<RegistryValue
Name="Port" Value="#[PORT]" Type="integer" /> </RegistryKey>
</File>




------------------------------------------------------------------------
------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
Rob Mensching
2010-11-23 01:08:36 UTC
Permalink
PS: Burn's RegistrySearch returns the value expect. <smile/>
Post by Neil Sleightholm
As Rob said it is not supported in Windows Installer but it quite a
simple custom action in DTF. I had a similar problem reading the SQL
public static ActionResult ReadSqlTcpPort(Session session)
{
session.Log("Begin ReadSqlTcpPort");
using (RegistryKey reg =
Server\MYINSTANCE\MSSQLServer\SuperSocketNetLib\Tcp"))
{
// If key is found, look for value
if (null != reg)
{
session["SqlTcpPort"] = reg.GetValue("TcpPort",
string.Empty).ToString();
}
else
{
session["SqlTcpPort"] = string.Empty;
}
}
return ActionResult.Success;
}
Neil
-----Original Message-----
Sent: 19 November 2010 22:16
Subject: [WiX-users] RegistrySearch for REG_DWORD handling using WiX
Installer
Hi,
RegistrySearch for REG_DWORD handling using WiX Installer.
After the RegistrySearch it returns REG_SZ with "#1".
How do you resolve this issue so it will set the return type to an REG_DWORD and
value of 1?
Thanks in advance!
<Property Id="PORT" Value="12345"> <RegistrySearch
Id="idPORT"
Key="SOFTWARE\Company\Product" Name="Port" Root="HKLM"
Type="raw" />
</Property> <File ..........> <RegistryKey Root="HKLM"
Key="SOFTWARE\Company\Product" Action="create">
<RegistryValue
Name="Port" Value="#[PORT]" Type="integer" /> </RegistryKey>
</File>
------------------------------------------------------------------------
------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
--
virtually, Rob Mensching - http://RobMensching.com LLC
Loading...