Hi there,

I'm trying to create an installer package that writes a default value on a
fresh install but preserves a changed value on upgrade or maintenance.

What I did was author my MSI package in the following way:

<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 entry in the Property table is:

Property = PORTVALUE, Value="1234"

In the Registry table, the relevant entry (partial) is Value = #[PORTVALUE].

When I run this on a fresh install, it correctly writes a DWORD with value
1234.
When in maintenance/upgrade, it incorrectly writes a REG_SZ 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.

It seems that this could easily be fixed by me modifying my Property table
in the following way:

Property = PORTVALUE, Value="#1234"

And in the Registry table:

But there don't seem to be easy ways to do this.  It looks like I would set
my RegistryValue @type to "String" and prefix my Property @Value with #, but
it seems a little conceptually murky ("So it gets installed as a DWORD, but
you set it to be a string?").

Does anyone have any suggestions on how to make this work?  How do you
preserve a non-string registry value?  I think I have to be missing
something because it seems this will break if you use any type other than
string.

Let me know if I haven't been clear.

Thanks,
:D
-------------------------------------------------------------------------
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
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to