I am creating a vb.net installation in winforms, and I want that my app will be added, like in other programs, to Control Panel -> Programs -> Programs and Features and Features with it's info.
I tried to do it with the following code:
My.Computer.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall\Myapp").SetValue("Display Name", "Appname")
My.Computer.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall\Myapp").SetValue("Display Version", "1.0.0.0")
My.Computer.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall\Myapp").SetValue("Publisher", "SomePublisher")
My.Computer.Registry.LocalMachine.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall\Myapp").SetValue("Uninstall Path", "uninstpath")
What's wrong in my code, and how can I fix it?
I found an indirect way to do it - via cmd. That's not the best way, but it may work.
You can write the following text in the resources as name.cmd:
And then, you open it in cmd programically: