. NET automatic execution of MSI and EXE files

Source: Internet
Author: User

MSI is an installation file that requires the system's own msiexec.exe to execute

  varTempDir =@"D:\UploadFiles\SCADASetupWix.msi"; varStart =NewProcessStartInfo ("msiexec.exe","/I \ ""+tempdir); Start. WindowStyle=Processwindowstyle.normal; Start. CreateNoWindow=true; Process.Start (Start);//. WaitForExit ()

However, under 360, a warning pops up. It is considered unsafe to install automatically. There should be a better way.

Triggering the installation in CMD will also pop up a 360 warning. And then show the Reject installation

Automatically run EXE files will also pop up a warning.

Process PRC =NewProcess (); Try{PRC. Startinfo.filename=@"C:\Users\Administrator\Desktop\SCADA\setupok.exe"; Prc. Startinfo.useshellexecute=false; Prc. Startinfo.redirectstandarderror=true; Prc. Startinfo.redirectstandardoutput=true; Prc. Startinfo.redirectstandardinput=true; Prc. Startinfo.createnowindow=false; Prc.            Start (); }            Catch(Exception ExU) {if(!PRC. hasexited) {PRC.                Close (); }                Throw NewException (exU.Message.ToString ()); }

There should be a silent installation method. Keep looking!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.