title: The operation was canceled by the user. (Exception from HRESULT: 0x800704C7)
body: <p>I get this error while trying to add a printer driver.</p>
  
  <blockquote>
    <p>The operation was canceled by the user. (Exception from HRESULT: 0x800704C7)</p>
  </blockquote>
  
  <p>Am i doing something wrong here?</p>
  
  <pre><code>Public Function AddDriver(ByVal DriverName As String, ByVal InfFile As String) As Boolean
      Try
          Dim PRNADMIN As New PRNADMINLib.PrintMaster
  
          Dim Drv As New PRNADMINLib.Driver
          Drv.ModelName = DriverName
          Drv.InfFile = InfFile
          PRNADMIN.DriverAdd(Drv)
          Return True
      Catch ex As Exception
          MessageBox.Show(ex.Message, frmMain.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
          Return False
      End Try
  End Function
  </code></pre>
  
  <p>Here comes the c# version</p>
  
  <pre><code>public bool AddDriver(string DriverName, string InfFile)
  {
      try {
      PRNADMINLib.PrintMaster PRNADMIN = new PRNADMINLib.PrintMaster();
  
      PRNADMINLib.Driver Drv = new PRNADMINLib.Driver();
      Drv.ModelName = DriverName;
      Drv.InfFile = InfFile;
      PRNADMIN.DriverAdd(Drv);
      return true;
  } catch (Exception ex) {
      MessageBox.Show(ex.Message, frmMain.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
      return false;
  }
  }
  </code></pre>
  
  <p><strong>UPDATE:</strong> </p>
  
  <ol>
  <li><p>The application requests administration rights in app.manifest (requestedExecutionLevel level="requireAdministrator")</p>
  
  <p></p></li>
  <li><p>I get the same error with UAC On or even OFF.</p></li>
  <li><p>The driver is not digitally signed</p></li>
  <li><p>If i install the driver manually i get the windows security warning, with "Don't install this driver software" as the default option (And unfortunately, do not get that Message while running the code above).</p></li>
  </ol>