Dhru 'soni
Dhru 'soni

Reputation: 1058

Silent Installation in wpf

It is work correctly but, it's asking Do you allow following program from an unknow publisher to make changes to this computer. Yes or No I don't want this directly when i click on install button it will install on my system.

private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            //Install software
            Process p = new Process();
            p.StartInfo.FileName = "msiexec.exe";
          //  p.StartInfo.FileName = txtname.Text;
            p.StartInfo.Arguments = string.Format("/qb /i \"{0}\" ALLUSERS=1", @"C:\Users\d.soni\Desktop\setup.msi");
            //process.StartInfo.Arguments = string.Format("/qb /i \"{0}\" ALLUSERS=1", @"E:\Setup.msi");
            p.Start();
            p.WaitForExit();

        }

Upvotes: 0

Views: 235

Answers (1)

Nawed Nabi Zada
Nawed Nabi Zada

Reputation: 2875

It is a normal Windows behavior. When trying to install something on a computer and you are logged in as administrator it will prompt with the the YES / NO message box. In case you are not logged in as administrator it will prompt with a login dialog box which will ask you to enter an administrator credentials.

Upvotes: 1

Related Questions