I'm writing a function that will run an msi file by taking in the applications path as a parameter. Right now the function is returning an error code stating that the application's path is not a valid Win32 application. This function works for .exe files, but not .msi files. How can I refactor it to work for .msi files?
func Run(application string) {
cmd := exec.Command(application)
err := cmd.Run()
if err != nil {
log.Fatalf("cmd.Run() failed with %s
", err)
}
}