UWP安装PowerShell的无 [英] UWP installer without powershell

查看:966
本文介绍了UWP安装PowerShell的无的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个更加用户友好的方式让我UWP应用程序的安装。我不想通过商店分发,我知道你需要设置开发设置,以使应用程序侧载。

I am looking for a more userfriendly way to make an installer for my UWP Application. I don't want to distribute through the store and I am aware that you need to set the developer setting to enable sideloading of applications.

是否有可能在C#中,模仿的PowerShell脚本部署的APPX包入系统的执行?如果是这样,怎么做这个工作的时候,你要更新的APPX包,而不是一个新的安装?

Is it possible, in C#, to mimic the execution of the PowerShell script which deploys an appx package into the system? And if so, how does this work when you want to update the appx package instead of a new install?

这似乎有点不可思议我的用户有执行用手PowerShell脚本安装应用程序。所以我想,而不是创建一个安装程序

It seems a bit weird for my users to have to execute a powershell script by hand to install an application. So I would like to create an installer instead.

编辑:阐述,我期待在C#的方式来安装一个APPX包。我不希望使用任何命令行/外部工具

to elaborate, I am looking for a way in C# to install an appx package. I don't want to use any command line / external tools

感谢

推荐答案

您可以从与Windows.Management.Deployment.PackageManager对象的 AddPackageAsync 方法。这表现为C ++和C#中的添加应用程序包样本 MSDN上。

You can install an appx package from code with the Windows.Management.Deployment.PackageManager object's AddPackageAsync method. This is demonstrated for C++ and C# in the Add app package sample on MSDN.

要更新现有的包呼软件包管理系统。的 UpdatePackageAsync

To update an existing package call PackageManager.UpdatePackageAsync

这篇关于UWP安装PowerShell的无的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆