Rather than invoking the ClickOnce installer for MTGO, it's possible instead to perform the same verification and installation using ClickOnce's InPlaceHostingManager class. This way, we can assert that the MTGO manifest is pre-trusted
using System.Deployment.Application;
using System.Windows.Forms;
Uri deploymentUri = new Uri(deployManifestUriStr);
InPlaceHostingManager iphm = new (deploymentUri, false);
iphm.GetManifestCompleted += iphm_GetManifestCompleted;
iphm.GetManifestAsync();
void iphm_GetManifestCompleted(object sender, GetManifestCompletedEventArgs e)
{
if (e.Error != null)
throw new Exception("Could not download manifest. Error: " + e.Error.Message);
// Verify and grant permissions specified in the application manifest.
iphm.AssertApplicationRequirements(true);
// Download the deployment manifest.
iphm.DownloadProgressChanged += iphm_DownloadProgressChanged;
iphm.DownloadApplicationCompleted += iphm_DownloadApplicationCompleted;
iphm.DownloadApplicationAsync();
}
Rather than invoking the ClickOnce installer for MTGO, it's possible instead to perform the same verification and installation using ClickOnce's
InPlaceHostingManager
class. This way, we can assert that the MTGO manifest is pre-trustedhttps://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/deployment/walkthrough-creating-a-custom-installer-for-a-clickonce-application?view=vs-2015&redirectedfrom=MSDN