dinhngtu / OutlookCloseToMinimize

Minimizes Outlook when the Close button is clicked. For use with the "Hide when minimized" option.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SecurityException when installing .vsto

itskaizad opened this issue · comments

OS: Windows 11, 21H2. Build 22000.739.
Office version: 2021 LTSC
Installed the redistributable from Microsoft's site for Office products. The error when executing the .vsto file as per the readme is as follows:

Name: OutlookCloseToMinimize
From: file:///C:/kaizad/outlook-tools/OutlookCloseToMinimize.vsto

************** Exception Text **************
System.Security.SecurityException: Customized functionality in this application will not work because the certificate used to sign the deployment manifest for OutlookCloseToMinimize or its location is not trusted. Contact your administrator for further assistance.
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyTrustPromptKeyInternal(ClickOnceTrustPromptKeyValue promptKeyValue, DeploymentSignatureInformation signatureInformation, String productName, TrustStatus status)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInTrustEvaluator.VerifyTrustUsingPromptKey(Uri manifest, DeploymentSignatureInformation signatureInformation, String productName, TrustStatus status)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.ProcessSHA2Manifest(ActivationContext context, DeploymentSignatureInformation signatureInformation, PermissionSet permissionsRequested, Uri manifest, ManifestSignatureInformationCollection signatures, AddInInstallationStatus installState, TrustStatus sha256TrustStatus, X509Certificate2 sha256PublisherCert)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySecurity(ActivationContext context, Uri manifest, AddInInstallationStatus installState)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
The Zone of the assembly that failed was:
MyComputer

Hi,

This is an issue caused by the "mark-of-the-Web" on downloaded files that blocks the addin from being installed.

I've added some instructions in the Readme file on how to solve this issue.

Alternatively, here's a batch file that does the same thing:

powershell.exe -NoProfile -NonInteractive -Command "Unblock-File *"
start OutlookCloseToMinimize.vsto