UWP : SignTool Error: Access is denied. ( Resolve ! ) - c#

This is re-Question about issue "SignTool Error: Access is denied." on my visual studio.
When I compile "SideLoad" application on Visual Studio 2017. This error happened again.
This is not first time for me. Previously, I could not resolve this error. Then, I bought New DELL PC :( Yes, During some period, It worked fine without any problem. but I saw same error again, Today !
Here is some additional information.
x64, Windows 10, Os ver 1703 , Build 15063.675.
Visual Studio 2017
This is new PC. Administrator, Local user, not MSN user.
Target version : Windows 10 Creator Update ( 10.0; Build 15063 )
Min version : Windows 10 November Update ( 10.0; Build 10586 )
After build of side load applicaiton, This error show ::
1> Bg7Uwp1 -> D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1.exe
1> Processing application code
1> Computing application closure and generating interop code
1> Loading 108 modules...
1> Generating code...
1> Interop code generated.
1> Generating serialization code
1> Compiling interop code
1> Generating System.Reflection.DispatchProxy proxy code.
1> Cleaning up unreferenced code
1> Generating native code
1> Generating fixups for native code
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204: Failed to sign 'D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1_1.0.9.0_x86.appx'. SignTool Error: Access is denied.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204: SignTool Error: An error occurred while attempting to sign: D:\develop\visualstudio2\xxx\Bg7Uwp1\Bg7Uwp1\bin\x86\Release\Bg7Uwp1_1.0.9.0_x86.appx
1>
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3787,5): error APPX1204:
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Package: 0 succeeded, 2 failed ===========
========== App Bundle: 0 succeeded, 1 failed ===========
Please give me some idea. I tried everything from internet and here. but Previously, I could not resolve.. I can not buy new PC again !
Update 1
and After this trouble, I open new Uwp project and start sideload compile. it show same error ! This is same situation with previous PC ! Now, My Vs2017 can not make sideload for an
empty UWP project !!
in previous PC, I tried everything. Re-install VS2017, Re-install NuGet items. but it did not resolve at all. Only way was to buy new PC and re-install VS.
Update 2
With verbose mode of VS2017 compile output, I found , There is signtool.exe in SignAppxPackageExeFullPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe
with it, I tried to sign by myself.
Open command prompt tool with Admin
Run below command. I success to sign !??
Update 3
Next challenge is to add "Admin privilege" with "Signtool.exe" like this. but this was failed. Error was changed. "It need administrator privilege" and it make build error. not success.
Question
If I do sign manually, Is it enough ?
I signed with manual ( target file is : Bg7Uwp1_1.0.19.0_x64.appx ) "c:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe" sign /fd SHA256 /a /f Bg7Uwp1_TemporaryKey.pfx bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx
Done Adding Additional Store
Successfully signed: bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx
I copy all "Release" folder to other PC.
I copy "Bg7Uwp1_TemporaryKey.pfx" to other PC too.
On 2nd PC, I install the certification key first "Bg7Uwp1_TemporaryKey.pfx". Success.
I tried to install with clicking Bg7Uwp1_1.0.19.0_x64.appx
I can not installed : (
Either you need a new certificate installed for this app package, or you need a new app package with trusted certificates. Your system administrator or the app developer can help. A certificate chain processed, but terminated in a root certificate which isn't trusted (0x800B0109)
Find! a solution but Not perfect yet.
with above error, I read this.. This is a step to install sideload application to PC. I follow this. I can resolve the error 0x800B0109.
In File Explorer, right-click on the app package, and in the pop-up context menu select Properties.
In the Properties dialog, select the Digital Signatures tab.
In the Signature list, select the signature and then click the Details button.
In the Digital Signature Details dialog, click the View Certificate button.
In the Certificate dialog, click the Install Certificate… button.
In the Certificate Import Wizard, select Local Machine and then click Next. You will need to grant administrator privileges to continue.
Select Place all certificates in the following store and browse to the Trusted People store.
Click Next, then click Finish to complete the wizard.
after this step, I can install my Sideload to my Own PC. but To install 2nd PC has error. ( New error 0x80073CF3 ) . but I get big improvement !
Update 4 ( Not resolve still ! )
Now, TO install other PC is not impossibile. Dependencies file can not create by VS. because signtool has error.I have to install other PC. Without it, All my time would be waste.. :( please help me...
This is old dependencies files. I have to make it for my ver 19.
Update 5
I check What Vs2017 is doing in background. I used ProcessMonitor. and She execute this command. It look like no problem. I tried with Admin-MS-prompt, It success.
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64\signtool.exe" sign /fd sha256 /f "Bg7Uwp1_TemporaryKey.pfx" "D:\develop\visualstudio2\shinwatec\Bg7Uwp1\Bg7Uwp1\bin\x64\Release\Bg7Uwp1_1.0.19.0_x64.appx"
but Without Admin, I got same error with VS2017 !

I found the solution ! and fix it.
with ProcessMonitor, I found this line.
signtool.exe has "Access denied" to access %appdata%\local\Temp
I check the folder permission. There is no permission on the Temp folder. I added my own user Networkname\username .
After this. I success to fix this issue. Now my visualStudio 2017 can make sideLoad application ! Yes, I do not need to buy new PC again :)
thank you. Mr. BugFinder.

Related

Error Metadata file dll could not be found CSC when publishing

I have a Visual studio solution with several projects in it, specifically a DotNet5 asp.net app, that has several netstandard 2.0 references on it. it builds and runs fine in the debugger but continuously throws the metadata errors. It keeps specifically referencing its looking for a net5 folder in the netstandard2 project. I cannot find where its getting this from, the problematic one used to be a multitargeted project against framework 4.7, 4.8, and net5.0, but i got annoyed with the multiple dll's and just migrated it to standard2.0 and had no issues till i want to publish it.
I've tried what a few other questions referenced, cleaning, rebuilding, remove and re add references to other projects, deleted the obj and bin folders out of the solution, the removing the sou file, tried VS 2019 (16.9.0 preview 2) preview vs 2019 (16.8.3) release, different computer (pulled back down from a lan git repository) and got the same error.... also tried searching the entire solution for references to net5.0 and didn't find it outside of the expected locations like the csproj for the asp.net project and its respective pubxml. And just for fun, I temporarily retargeted the library project back to net5.0 and it still threw the same error even when the exact file and path listed did exist.
Using enters for the error below for the different columns in the error message, and removed the "sensitive" info. There is no error code provided by Visual Studio. Anyone else got any more ideas on what to try?
Error
Metadata file 'C:\Users\UserName\source\repos\Solution\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found.
Project 1
CSC
0
Edit: adding a couple other sections of the error messages:
1/2/2021 7:38:55 PM
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
And the end of the output window since full thing is a bit too long. still can't figure out where its getting the net5.0 for the one project reference
/reference:C:\Users\UserName\.nuget\packages\system.xml.xpath.xmldocument\4.0.1\ref\netstandard1.3\System.Xml.XPath.XmlDocument.dll /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Ubiety.Dns.Core.dll /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 3\bin\Release\netstandard2.0\Project 3.dll" /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll" /reference:C:\Users\UserName\source\repos\CheckNotes\Project 4\bin\Release\netstandard2.0\Project 4.dll /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll" /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Zstandard.Net.dll /debug+ /debug:portable /filealign:512 /optimize+ /out:"obj\Release\net5.0\CheckNotes Web - Core.dll" /refout:"obj\Release\net5.0\ref\CheckNotes Web - Core.dll" /target:exe /warnaserror- /utf8output /deterministic+ /langversion:9.0 /analyzerconfig:"obj\Release\net5.0\CheckNotes Web - Core.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\analyzers\build\config\AnalysisLevel_5_Default.editorconfig" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Components.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll" Controllers\AssemblyController.cs Controllers\CheckNotesController.cs Controllers\ContactsController.cs Controllers\CustomerController.cs Controllers\HomeController.cs Controllers\ImageController.cs Controllers\OperatorPagesController.cs Controllers\PalletsController.cs Controllers\SharedController.cs Controllers\StatisticsController.cs Models\ControllerClass\ctrlrAssembly.cs Models\ControllerClass\CtrlrCheckNotes.cs Models\ControllerClass\ctrlrContacts.cs Models\ControllerClass\CtrlrCustomer.cs Models\ControllerClass\CtrlrOperatorPages.cs Models\ControllerClass\CtrlrPallet.cs Models\ControllerClass\ctrlrStats.cs Models\DataClass\AppSettings.cs Models\ErrorViewModel.cs Models\renderAction.cs Program.cs Startup.cs "obj\Release\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs" "obj\Release\net5.0\CheckNotes Web - Core.AssemblyInfo.cs" "obj\Release\net5.0\CheckNotes Web - Core.RazorAssemblyInfo.cs" /warnaserror+:NU1605
CSC(0,0): Error CS0006: Metadata file 'C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found
10>Build failed. Check the Output window for more details.
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Got it to publish but I am so confused....something to do with the publish profile. If i delete that and generate a new one, works fine. as soon as i edit it using the GUI, broken....generate it again. So far seems ok to edit it manually but TBD. not sure if the "fix" will survive restarting Visual studio or not.
Edit - Scratch that, found the difference.
Remove the following line in Properties/FolderProfile.pubxml and it's fine.
<TargetFramework>net5.0</TargetFramework>

Windows 10 System.Exception: Install failed. Please contact your software vendor

I'd like to create 2 apps from the same project(VS solution), both of them has the same functional with small differences. So I just made 2 copies of my solution and I changed solution name, namespace and asigned app to different Microsoft Store app. When I try to instal secnod app on phone I get:
2>caught exception: System.Exception: Install failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CF9)
2> at Windows.Foundation.IAsyncOperationWithProgress`2.GetResults()
2> at Microsoft.VisualStudio.ImmersiveProjectServices.PlatformShim.AppxCancelableDeployOp.Microsoft.VisualStudio.ImmersiveProjectServices.PlatformShim.IAppxCancelableDeployOp.Execute()
2> at Microsoft.VisualStudio.ImmersiveProjectServices.Shared.AppxLayoutManager.RunDeployOpWithCancel(IAppxCancelableDeployOp deployOp, CancelManager cancel)
2> at Microsoft.VisualStudio.ImmersiveProjectServices.Shared.AppxLayoutManager.RegisterPackage(String location, DeployPackageName deployPackageName, CancelManager cancel)
2> at ImmersiveDeploy.Program.ExecuteTask(String[] args, Int32 argument, XDocument immersiveDeployResults, ImmersiveDeployTask task, DeployPackageName deployPackageName)
2> at ImmersiveDeploy.Program.Main(String[] args),
2>
2>*** End of logging from deployment agent ***
2>Error : DEP0001 : Unexpected Error: Install failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CF9)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Projects build report:
Status | Project [Config|platform]
-----------|---------------------------------------------------------------------------------------------------
Succeeded | BackgroundTaskRawNotification\BackgroundTaskRawNotification.csproj [Debug|x86]
Succeeded | MySolution\MyApp.csproj [Debug|x86]
Failed | MySolution\MyApp.csproj [Debug|x86]
As is mentioned in other questions, if I uninstall one of them, the second is installing but I'd like to made some changes to install both of them. Have to mention that on PC I can install both apps from Visual Studio with no errors.
I am using:
Windows 10 Pro
Visual Studio Version 14.0.24720.00 Update1
Mobile Emulator 10.0.10240.0
Any advices are appreciated.
P.s. In android we have gradle flavors that helps us to build different apps from the same Android Studio project, maybe there is something similar in Visual Studio?
The purpose of reserving multiple names for an App is that the name has meaning for different languages. E.g. an English speaking person would understand "My Great App" and a German speaking e.g. "Meine tolle App". When you assign multiple names to the same App which is identified by it's ID you do not have two Apps but just one with multiple names. That is why you're getting the error.
You could try to change these IDs manually but the easiest, fastest and safest way would be to just let Visual Studio do the work by creating a new project and copy/paste/include your files.
Anyway if your intention is to create a "Free" and a "Pro" version you should consider doing it the recommended way and use in App purchases or create a trial version.
In the package.appxmanifest file, in the Package tab change the Package Name value. Notice how changing this will also change the Package Family Name as well.
Lastly, change the Display Name from the Application tab so you can differentiate the apps when ruuning.

SQL CLR no longer deploys to SQL 2008

I have a SQL CLR project that deploys stored procs to a server. For 2 years I've always been able to just right click the project and deploy. Yesterday I have started to get errors when I try to do that. I was able to deploy a new version last week but not this week.
------ Build started: Project: '', Configuration: Debug Any CPU ------
'' -> E:\Development\Code\SqlDeployables\''\bin\Debug\''.dll
------ Deploy started: Project: '', Configuration: Debug Any CPU ------
Error: Class not registered.
Looking for object with CLSID: {475E0C1F-1E61-4197-9324-10A148C512F8}.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
I've been searching around and can't find anything on the error. There has been no updates on the sql server since I could last deploy. I have uninstalled my VS2010 updates as well as .net updates on my machine and that has not done anything. The only updates I have not uninstalled were office ones, which I would think are not the problem.
Any ideas? I've tried resetting permissions on the sql machine. Removed Stored procs manually and redeploy. I've gone back to a previous version of the project and tried to deploy. Restarted SQL Server services on machine.
Visual Studio 2010
SQL Server 2008
Thanks
Somehow your visual studio install has gotten messed up. That CLSID points to the class Microsoft.VisualStudio.Data.Schema.Package.Sql.Internal.ManagedBuildLoggerComClass in the com object C:\Windows\system32\mscoree.dll.
I would recommend trying to do a repair install on visual studio and see if that fixes your issue.
I had the same problem, and I couldn't figure out how to solve it. I think it might have something to do w/ a side-by-side install of VS2012, but I am not sure.
As a workaround I wrote my own T-SQL deploy script. The project builds all right, and it outputs dlls all right. All that is missing is the database deploy (ie, the commands that VS runs against the database to actually deploy your types and methods to the server). In the project's bin folder you may find the .sql file that VS generates; you can use this as a template. The deploy script will end up looking something like this:
USE SomeDatabase
GO
IF OBJECT_ID('dbo.[SomeFunction]') IS NOT NULL DROP FUNCTION dbo.[SomeFunction]
IF EXISTS (SELECT * FROM sys.assemblies WHERE NAME = 'SomeAssembly') DROP ASSEMBLY [SomeAssembly]
GO
CREATE ASSEMBLY [SomeAssembly] AUTHORIZATION dbo
FROM '\path\to\your\dll'
WITH PERMISSION_SET = SAFE
GO
CREATE FUNCTION [dbo].[SomeFunction] ....
EXTERNAL NAME [SomeAssembly].[SomeAssembly.UserDefinedFunctions].[SomeMethod]
GO
Then deploy your stuff manually via SSMS.

SDK path is empty in Notepad++ plugin.net

I'm trying to develop a Notepad++ plugin using a nppPlugin.netV0.6 template.
Downloaded from http://sourceforge.net/projects/sourcecookifier/files/other%20plugins/NppPlugin.NET.v0.6.zip/download
I got a build error [SDK path is empty.]
The same template is working in other system (XP also).
Can anyone give me an resolution for this issue?
The build process calls program ildasm.exe. The directory for that program may not have been added to the PATH environment variable. When I installed Visual Studio 2012 Express installer the directory was not added so I added it to the PATH and the build succeeded.
I tracked the problem down by increasing the amount of logging output written by the build process. (Via Tools => Options => Projects and Solutions => Build and run => MS Build ... verbosity.)
Not sure whether your error is identical. Before adding the directory to the PATH the errors below were generated:
1>------ Rebuild All started: Project: NppManagedPluginDemo.VS2010, Configuration: Debug Any CPU ------
1> NppManagedPluginDemo.VS2010 -> C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll
1> ILDasm: calling 'ildasm.exe' with /quoteallnames /unicode /nobar /linenum "/out:C:\Users\Adrian_2\AppData\Local\Temp\tmpAB1F\Demo.il" "C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\bin\Debug\Demo.dll"
1>C:\Adrian\VS\NppPlugin.NET.v0.5\Demo Plugin\NppManagedPluginDemo\DllExport\NppPlugin.DllExport.targets(8,5): error : The system cannot find the file specified
There are several versions of ildasm.exe in sub directories of c:\Program Files (x86)\Microsoft SDKs\Windows\ of my current computer.

Cannot install windows service

I have created a very simple window service using visual studio 2010 and .NُET 4.0.
This service has no functionality added from the default windows service project, other than an installer has been added.
If I run "installutil.exe appName.exe" on my dev box or other windows 2008 R2 machines in our domain the windows service installs without issue.
When I try to do this same thing on our customer site, it fails to install with the following error.
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\TestService\WindowsService1.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).
This solution has only 1 project and no dependencies added.
I have tried it on multiple machines in our environment and two in our customers. The machines are all windows 2008 R2, both fresh installs. One machine has just .net 2.0 and .net 4.0. The other .net 2, 3, 3.5 and 4.
I am a local admin on each of the machines.
I have also tried the 64bit installer but get the following error, so I think the 32 bit one is the one to use.
System.BadImageFormatException
Any guidance would be appreciated. Thanks.
Another reason for this error might be that you copied your program from a source which windows considers untrusted.
You can unblock the assembly by clicking "unblock" after you right-click and select properties on the file.
Need to unblock files. or at least that's what fixed mine.
To do 'bulk' unblock in Powershell
get-childitem *.* | Unblock-File
or in DOS:
FOR %a in (*.*) do (echo.>%a:Zone.Identifier)
When we copy executable from another computer, Windows mark a flag on them for protection. Right Click on executable and in properties Click Unblock. It would clear flag and service executable would Install.
This issue came about for me because I was trying to install the service from a network location. By copying the service.exe to the local machine prior to using installutil, it fixed my problem and the service installed successfully.
don't forget to vote up...
Try the SC as follows:
1. open command line
2. write the below-
sc create ServiceName BinPath= "ExePath".
report on results...
I also faced the same issue. In my case I was deploying new version of utilities , i copied new exe , installog files and then trying to uninstall the utils.
I copied back the old version , uninstal the utils , copied the new version and installed it again. Anyway it is the logical sequence I should have followed in first place.
i have this issue and it for different between of .net version of util and my service
i use util for .net 2 and my service build with .net4
In my case this error was caused by accidentally passing the directory containing the service to InstallUtil instead of passing the service exe.
Obviously human error but I found the error message quite misleading.
you can use this command in developer command prompt run administrator
installutil C:\...\MyService\bin\Debug\MyService.exe
As per #doublehelix's response above, this answer put me on track for my particular issue which related to a service issue running in Windows XP (Unblock is not an option in the security tab that I could find). In my case I was attempting to run a service from a separate drive (i.e. not on the same drive as Windows and not under program files) although the actual physical disk was the same. Moving my service into the Program Files folder solved my underlying issue. (I intended to 'comment' against #doublehelix's answer but I don't seem to be able to in my current status).
Simply right click on your service files and select properties and then check the unblock checkbox
https://brianseekford.azurewebsites.net/2011/07/13/hresult-0x80131515-when-running-installutil-to-install-a-net-service/
Unblocking files did the job here. Weird thing is that the blocked files came from a signed installer run with admin privileges. Had to unblock several files in several folders at once.
I used the following registry tweaks to add context menus to a folder or file when Shift + right-click is pressed (it doesn't show up if just right-clicked).
Credits and references to the author in each code block.
Folder tweak:
Just save it as ShiftUnblockFolder.reg and import into Registry.
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 17th 2019
; Tutorial: https://www.tenforums.com/tutorials/129101-add-unblock-file-context-menu-windows-10-a.html
[HKCR\Directory\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
"SubCommands"=""
[HKCR\Directory\shell\unblock\shell\001flyout]
"MUIVerb"="Unblock files only in this folder"
[HKCR\Directory\shell\unblock\shell\001flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' | Unblock-File"
[HKCR\Directory\shell\unblock\shell\002flyout]
"MUIVerb"="Unblock files in this folder and subfolders"
[HKCR\Directory\shell\unblock\shell\002flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' -recurse | Unblock-File"
Single file tweak:
ShiftUnblockFile.reg
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 17th 2019
; Tutorial: https://www.tenforums.com/tutorials/129101-add-unblock-file-context-menu-windows-10-a.html
[HKCR\*\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
[HKCR\*\shell\unblock\command]
#="powershell.exe Unblock-File -LiteralPath '%L'"
[HKCR\Directory\shell\unblock]
"MUIVerb"="Unblock"
"Extended"=""
"SubCommands"=""
[HKCR\Directory\shell\unblock\shell\001flyout]
"MUIVerb"="Unblock files only in this folder"
[HKCR\Directory\shell\unblock\shell\001flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' | Unblock-File"
[HKCR\Directory\shell\unblock\shell\002flyout]
"MUIVerb"="Unblock files in this folder and subfolders"
[HKCR\Directory\shell\unblock\shell\002flyout\command]
#="powershell.exe get-childitem -LiteralPath '%L' -recurse | Unblock-File"
You can try to make a Setup Project for your service and run the MSI file on that server.

Categories