0

I am using Visual Basic to download an MSI file on Github, therefore I am using the Download File method. When I go to open the MSI file using the Process Start method I get an error, "The installation package could not be opened. Contact the application vendor to verify that this a valid Windows Installer package."

My.Computer.Network.DownloadFile("https://github.com/user/repo/raw/master/file.msi", "C:\Users\Users\user\Desktop\test\file.msi")
Process.Start("C:\Users\user\Desktop\test\file.msi")

The expected result is for Visual Basic to download the MSI file from Github, and then run the MSI file. The actual result is an error saying, "The installation package could not be opened. Contact the application vendor to verify that this a valid Windows Installer package."

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
  • 1
    Well, if the file won't run when you try it manually then the download is corrupted. Does it run manually? Maybe there is a different message then? Did you try downloading a different MSI? Downloaded files are tagged to indicate that they were downloaded. Right click the file and check in properties. Will check back later. – Stein Åsmul May 11 '19 at 02:37
  • @SteinÅsmul, the MSI file the code is trying to download on a manual download executes and performs like it is supposed to. Also, I downloaded another MSI file and it worked properly with the code. Would having a cert make a difference? – David Rohweder May 11 '19 at 03:24
  • 1
    Did you try [this procedure on the signed MSI](https://stackoverflow.com/questions/56041021/visual-studio-generated-msi-vs-gpo-this-advertised-application-will-not-be-inst#comment98725566_56041021). [Here is a screen shot](https://blogs.msdn.microsoft.com/delay/p/unblockingdownloadedfile/). Downloaded files will have [an alternate data stream in it](https://stackoverflow.com/a/48835413/129130) (section 2). – Stein Åsmul May 11 '19 at 10:51
  • Is the file actually there after you download it? Are you trying to start it before the download completes? Can you see it on the desktop? Can you manually run that MSI from disk after the download from outside your app? Those are the first basic troubleshooting steps, but I don't see any of them described in your question. – Ken White Jun 12 '19 at 22:54
  • I changed the download process by using Web Request instead of download file I assumed the problem stemmed from Github and how it downloads files. To answer your question the file was an empty shell (I could see it and it had 0 KB) and when I removed the process and I started it manually it was the same problem. – David Rohweder Jun 13 '19 at 19:35

0 Answers0