Click here to Skip to main content
15,886,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Guys,

Am working on a scenario,
Read all the HKCU Registry keys present in a MSI file, and Exporting them to a any output folder.
MSI File (Windows Installer File, will provide you an example if required for reference)
I tried with many scripts, C#, autoit ... I can go up to reading the HKCU files only.
Not able to export them to a output folder.
help me in doing this successfully, Am hitting my head against wall

Please help me with logic or reference code.

Please Help

Cheers,
Posted
Comments
ZurdoDev 5-Jun-14 17:02pm    
Where are you stuck?

1 solution

This is not actually a question. You have to mention where you are stuck and what you have tried. Also read this article:
Reading Data from MSI Database[^]
 
Share this answer
 
Comments
Mohan Subramani 6-Jun-14 0:08am    
Manikandan,

Thanks for your reply

Am reading the HKCU registry hive using the below code,

private void button3_Click(object sender, EventArgs e)
{
FileInfo msiFile = new FileInfo(@"C:\temp\WinInstaller\Sample.msi");
WindowsInstaller.Installer inst = (WindowsInstaller.Installer)new Installer();
Database instDb = inst.OpenDatabase(msiFile.FullName, WindowsInstaller.MsiOpenDatabaseMode.msiOpenDatabaseModeTransact);
WindowsInstaller.View view = instDb.OpenView("SELECT `Registry`.`Key`, `Registry`.`Name`, `Registry`.`Value` FROM `Registry` WHERE `Registry`.`Root`=1 ORDER BY `Registry`.`Root`");
view.Execute(null);



Here, Root value '1' refers to the HKCU registry hive,

Registry (s72) Root (i2) Name (L255) Value (L0)
69ADA5050611 1 PATH C:\Program Files\Sample\


I want to export all the read HKCU registry Key values into a valid .reg file which i can save it on my local drive,
Am lost in which logic i need to follow,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900