Visual Basic Online Course - VB .NET Make sure application is running and installed
Visual Basic Online Course
How to make sure that an Application is Running and Installed
![]() |
Visual Basic Online Course - Tips |
When you create a Visual Basic 2010 or generally a VB.Net application that relies on another VB.Net application for example an Updater.exe application, you will have to code both sides in order no to enable the user to run Updater.exe without the existence of the Main application, and in order to do so, you will have to make sure that :
1) Your Main application is Running.2) Your Main application is Installed.3) Your Main application does exist in the installation folder.
After making sure of all the above points, then you can compile your updater.exe file with your Main Application knowing that updater.exe won't run alone, especially if you're sending updates to the Main application for the user to receive using Updater.exe.
Here are the Codes to do so :
1) VB 2010 Get list of all installed applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Visual Basic Online Course | |
'VB 2010 Make sure application is installed | |
Imports Microsoft.Win32 | |
Public Class Form1 | |
Private Sub Form1_Load(sender As System.Object, _ | |
e As System.EventArgs) Handles MyBase.Load | |
GetInstalledApps(ListBox1) | |
End Sub | |
Function GetInstalledApps(ilst As ListBox) As String | |
Dim DestKey As String = _ | |
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" | |
For Each App As String In _ | |
Registry.LocalMachine.OpenSubKey(DestKey).GetSubKeyNames | |
ilst.Items.Add(App) | |
Next | |
Return ilst.Items.ToString | |
End Function | |
End Class |
2) VB 2010 Get list of all running applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Visual Basic Online Course | |
'VB 2010 Get list of all running applications | |
Function GetAllRunningApps(ilst As ListBox) As String | |
'For every process which is running on the computer | |
For Each p As Process In Process.GetProcesses | |
'If it doesn't have a title | |
If p.MainWindowTitle <> String.Empty Then | |
ilst.Items.Add(p.ProcessName) | |
End If | |
Next | |
Return ilst.Items.ToString | |
End Function |
3) VB 2010 Make sure application exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Visual Basic Online Course | |
'VB 2010 Make sure a file exists | |
Function AppExists() As Boolean | |
Dim AppPath As String = ("C:\folder\sample\app.exe") | |
If IO.File.Exists(AppPath) = True Then | |
Return True | |
Else | |
Return False | |
End If | |
End Function |
Thank you for reading, download VB 2010 Project from here
♥ Here are some online Visual Basic lessons and courses :
- Visual Basic .Net - Snippets collection
- Visual Basic .Net - How to check for the internet connection
- Visual Basic .Net - POP3 and Receiving E-mails
- Visual Basic .Net - Generate Random Combinations
- Visual Basic .Net - Play sounds on Button Click or Mouse Hover
- Visual Basic .Net - Progressbar control
- Visual Basic .Net - The application failed to initialize
- Visual Basic .Net - Working with Database full example
- Visual Basic .Net - There is already an open DataReader associated
- Visual Basic .Net - SyBase Advantage Database [Add, Edit, Search, Delete and DataGridView]
- Visual Basic .Net - Math Functions
- Visual Basic .Net - Communicating with clients [Requirements Docs, Use-Case]
- Visual Basic .Net - Receive Emails using POP3 mail Server
- Visual Basic .Net - Command Prompt
- برنامج المشتريات و المبيعات و المخازن
- Visual Basic .Net - Free POS System Project Source Code