you can even make this application like something which is used to uninstall applications by the way i just made this simple because you all should understand the basics of this so hope you understand what this actually is , lets make this . just open visual basic 2008/2010 and create a new project and select windows applications(windows forms application) after form loaded go to form properties and edit things what you do usually , now go to toolbox and drag and drop a listview tool into the form and go to listview properties and select columns and a small windows will popup , on the windows click add two times to add two columns
now change column text ,ColumnHeader1 change the text to Name and change the text of ColumnHeader2 to Uninstall Path and click ok , make your form look like this
now double click your form and add this code
now debug
now change column text ,ColumnHeader1 change the text to Name and change the text of ColumnHeader2 to Uninstall Path and click ok , make your form look like this
now double click your form and add this code
Imports Microsoft.Win32 Public Class Form1 'Author : Mohamed Shimran 'Blog : http://www.ultimateprogrammingtutorials.blogspot.com Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each AI As AppInfo In GetInstalledApps() If AI.UnInstallPath IsNot Nothing Then Dim LI As New ListViewItem LI.Text = AI.Name LI.SubItems.Add(AI.UnInstallPath.Replace("""", "")) LI.SubItems.Add(AI.SilentUnInstallPath) ListView1.Items.Add(LI) End If Next End Sub Structure AppInfo Dim Name As String Dim UnInstallPath As String Dim SilentUnInstallPath As String End Structure Function GetInstalledApps() As List(Of AppInfo) Dim DestKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" Dim iList As New List(Of AppInfo) For Each App As String In Registry.LocalMachine.OpenSubKey(DestKey).GetSubKeyNames iList.Add(New AppInfo With {.Name = Registry.LocalMachine.OpenSubKey(DestKey & App & "\").GetValue("DisplayName"), _ .UnInstallPath = Registry.LocalMachine.OpenSubKey(DestKey & App & "\").GetValue("UninstallString")}) Next Return iList End Function End Class
now debug
preview -
11 comments
dude,
ReplyI am in search of creating the installer.
I think that: my files that should be placed will be stored in resource folder.
And when I click install on the main form (installer)
all the files will be copy and paste to the installation directory (textbox1)
but the problem remain that:
How can I add my application in the installed app.
and how to create uninstaller for this (which delete all the files and delete itself at the end)
Reply me soon
Hello,
ReplyI think you should use an installer creator rather than making one for yourself, look here for a list of installer creators http://en.wikipedia.org/wiki/List_of_installation_software
Very nice post
ReplyI'm programmer located in Italy. I'm going to use your code. Thanks!
ReplyNice code, i've been following you! thank you.
ReplyBrilliant - and simple. Thanks!
ReplyWow this is great. Im having a problem reading all installed programs on my machine. Im not sure its its because they were installed and put in the Programs x64 folder or if they just dont show up. Everything it reads in the registry is correct but I guess what im trying to do is read all the uninstallers for all programs installed. Could I do that using this same code?
ReplyHey ,
ReplyYou can try this. Create a new project and add your stuff. Now you can copy the files to be copied in the root of the assembly. You can add a event of by clicking on the button it will copy the files to the directory and then you can add a event to add a registry string and a key with your install dir on it (receive from textbox) and icon or something. And now to hide your code and files to install , use a packager like boxedpacker.
Mate, I would like to share this in my blog. With your credit ofcourse. :)
ReplyGood sample... small, uses the framework and gets the desired results. Thanks!
ReplyNice one, tried, do some mod, got my desired result....thanks so much...
ReplyPost a Comment
Note: Only a member of this blog may post a comment.