Welcome to ADO.NET Access 2003—your ultimate hub for VB.NET and ADO.NET programming excellence. Discover in-depth tutorials, practical code samples, and expert troubleshooting guides covering a broad range of topics—from building robust WinForms applications and seamless MS Access integration to working with SQL Server, MySQL, and advanced tools like WebView2 and Crystal Reports. Whether you're a beginner or a seasoned developer, our step-by-step articles are designed to empower you to optimize.

Looking for MS Access Developer❓❓

Application developer

Post Page Advertisement [Top]

Visual Basic Online Course
How to make sure that an Application is Running and Installed

VB 2010 Make sure application is running
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
Github Gist
'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
Guthub Gist
  '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
Github Gist
'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

📥 download VB 2010 Project (MediFire)

By implementing these checks, you ensure that Updater.exe operates only when the main application is present and active, maintaining the integrity of your update process.

 Here are some online Visual Basic lessons and courses:

Bottom Ad [Post Page]