I have program which I needs MySQL database installed on the mechine. I dont want the user to start looking for where the MySQL.exe is kept, I want immedialtely after VB.Net installation it will call the MySQL.exe. Plz how can I do that?

Dani AI

Generated

, @iamthwee’s hint is on the right track. If you want MySQL to run immediately after your app installs, launch its installer as a separate process from a post-install step. In a Visual Studio setup (MSI), the typical way is to add a Custom Action that fires after Install/Commit, and inside that action start the MySQL installer with silent switches. See the docs for creating custom actions and when they run: Windows Installer custom actions.

Minimal example using VB.NET to start the installer silently (put this in your custom action code, e.g., Install or Commit). It uses ProcessStartInfo and msiexec so you can pass standard MSI flags like /qn and logging via /l*v (ProcessStartInfo, msiexec options):

Imports System.Diagnostics

' VB.NET: launch MySQL MSI silently with elevation
Dim msiPath = IO.Path.Combine(Application.StartupPath, "mysql-installer.msi")
Dim args = "/i """ & msiPath & """ /qn /norestart /l*v ""mysql_install.log"""

Dim psi As New ProcessStartInfo("msiexec.exe", args) With {
    .UseShellExecute = True,  ' required to use Verb
    .Verb = "runas"           ' prompt for admin (needed to install MySQL)
}

Using p = Process.Start(psi)
    p.WaitForExit()
    If p.ExitCode <> 0 Then
        Throw New ApplicationException("MySQL install failed. Exit code: " & p.ExitCode)
    End If
End Using

Practical tips:

  • Add the MySQL installer file to your setup and install it to a known folder so msiPath is predictable.
  • Run the action in Commit so your app is fully installed before invoking MySQL.
  • Always check the process exit code and log output to help users troubleshoot.
  • Make sure you have rights to redistribute MySQL, and consider a bootstrapper (e.g., WiX/NSIS/Inno Setup) if you want MySQL installed before your app or need better prerequisite handling.

Recommended Answers

All 2 Replies

Member Avatar for Member #46692

Have you tried calling it as process?

How will I call it as a process?
Plz help me with steps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.