Cannot Sideload Win10 UWP Application Without Developer Mode/Developer License

徘徊边缘 提交于 2019-12-11 06:38:48

问题


I'm developing a Line of Business application to be installed on multiple PC's, but I cannot get the Sideload to finish successfully.

I receive the following error from the Add-AppDevPackage script:

"Could not acquire a developer license"

If I set Developer Mode, my problems go away. But... That is an not option for the app's software deployment.

My setup: Visual Studio 2017, Win10 v. 1903 on the Development machine, Win10 v. 1809 on the Target machines

Per Microsoft's documentation: https://docs.microsoft.com/en-us/windows/application-management/sideload-apps-in-windows-10

  1. Set the Target machine for Sideload
  2. Created the test cert via Visual Studio
  3. Added the test cert to Package app manifest in Visual Studio
  4. Compiled the UWP app in Release
  5. Manually installed the Test Cert to the Target machine's Trusted Root Certification Authorities folder
  6. Ran the Add-AppDevPackage script on the Target machine

This was no help: Install developed Application without developer mode

I have no interest in putting software on the Microsoft Store for Business as outlined here: Install UWP without developer-mode and sideloading

This says I need yet another app??? (AppInstaller) to make sideloading work: How to created a UWP app with a certificate that can be sideloaded

I could modify the Powershell script to eliminate the Developer License check, but it seems like I shouldn't have to brute force the sideload.

The answer here is to hack the Poweshell script as I mentioned earlier, but does not explain why the Developer Check is out there in the first place: UWP's 'Add-DevAppPackage' Powershell script checks for a developer licence. This is an issue for Sideloading?


回答1:


Not a fan of having to do this to code that should be "turn key", but this allows sideloading without the Developer License check error and install fail.

Modify Add-AppDevPackage.ps1:

#
# Checks whether the machine is missing a valid developer license.
#
function CheckIfNeedDeveloperLicense
{
    $Result = $true
    try
    {
        $Result = (Get-WindowsDeveloperLicense | Where-Object { $_.IsValid } | Measure-Object).Count -eq 0
    }
    catch {}

    return $false #$Result
}


来源:https://stackoverflow.com/questions/57597193/cannot-sideload-win10-uwp-application-without-developer-mode-developer-license

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!