MSI doesn't run from within C#

前端 未结 3 1290
南笙
南笙 2021-01-12 10:24

I am trying to run an MSI file from C# using the Proces.Start method. The MSI file is fine, because I can run that normally, but when I try to run the MSI file within some C

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 10:38

    msi files cannot run on their own. If you double click on them, Windows will start

    msiexec /i PathToYour.msi

    Did you try to do that explicitly?

    Example: (Courtesy @Webleeuw)

    Process p = new Process();
    p.StartInfo.FileName = "msiexec";
    p.StartInfo.Arguments = "/i PathToYour.msi";
    p.Start();
    

提交回复
热议问题