private void button2_Click(object sender, EventArgs e) { String Name1 = lblDName.Name; String Value1 = txtDName.Text; String Name2 = lblUnisntall.Name String Value2 = txtUninstall.Text; // query the database WindowsInstaller.View view = instDb.OpenView("INSERT INTO Registry (Name, Value) VALUES ('" + Name1 + "', '" + Value1 + "')"); view.Execute(null); } This code work properly, but after inserting values in MSI database. The Value1 and value 2 are created as REG_SZ (String) but as per my requirement, Value1, should be REG_EXPAND_SZ Value 2, should be REG_DWORD Could you please help me in converting them in my code and then to insert into the MSI database. Cheers,
Quote:Value This column is the localizable registry value. The field is Formatted. If the value is attached to one of the following prefixes (i.e. #%value) then the value is interpreted as described in the table. Note that each prefix begins with a number sign (#). If the value begins with two or more consecutive number signs (#), the first # is ignored and value is interpreted and stored as a string. Prefix Meaning #x The value is interpreted and stored as a hexadecimal value (REG_BINARY). #% The value is interpreted and stored as an expandable string (REG_EXPAND_SZ). # The value is interpreted and stored as an integer (REG_DWORD).
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)