简体   繁体   English

UWP:当机器上未安装 AppX 安装程序时如何安装侧载应用程序

[英]UWP: how to install side-loaded app when AppX Installer is not installed on the machine

I need to install a UWP app, side-loaded, onto a machine that does not have access to the Microsoft Store.我需要将 UWP 应用程序安装到无法访问 Microsoft Store 的计算机上。

This machine doesn't even have the AppX installer app, therefore I cannot install any of those files (that come in the installation package of the sideloaded app):这台机器甚至没有 AppX 安装程序应用程序,因此我无法安装任何这些文件(在侧载应用程序的安装 package 中提供):

  • msixbundle msixbundle
  • msix msix

So, two questions:所以,两个问题:

  1. Is there a place where I can download and install this AppX installer app (obviously not from the MS Store)?有没有可以下载和安装这个 AppX 安装程序应用程序的地方(显然不是来自 MS Store)?
  2. Can I manually recreate the installation procedure, maybe unzipping the content of the.msix?我可以手动重新创建安装过程,也许解压缩 .msix 的内容吗? How can I create the correct folder hierarchy for LocalSTate etc.?如何为 LocalSTate 等创建正确的文件夹层次结构?
  1. The appx/msix installer should be included in the OS now. appx/msix 安装程序现在应该包含在操作系统中。 What version of Windows 10 (I assume) is the PC running? PC 运行的是哪个版本的 Windows 10(我假设)?

if it's an old one, can you push an OS update?如果它是旧的,您可以推送操作系统更新吗? After a quick web search it seems like you should be able to install an OS update even without internet.在快速搜索 web 之后,即使没有互联网,您似乎也应该能够安装操作系统更新。

  1. No you cannot.你不能。 Index, an appx/msix package is basically a smart ZIP which is extracted at install time into a special OS location, but there are some caveats.索引,一个 appx/msix package 基本上是一个智能 ZIP,它在安装时被提取到一个特殊的操作系统位置,但有一些警告。

You cannot manually put any files in the WindowsApps system folder, only the OS can write in that location.您不能手动将任何文件放在 WindowsApps 系统文件夹中,只有操作系统可以在该位置写入。

Even if you hack around somehow the OS and manage to add the files in the WindowsApps folder most likely the OS will not correctly integrate your UWP app because it does not know how to interpret the AppXManifest from the extracted zip (appx/msix package).即使您以某种方式破解操作系统并设法在 WindowsApps 文件夹中添加文件,操作系统也很可能无法正确集成您的 UWP 应用程序,因为它不知道如何从提取的 zip(appx/msix 包)中解释 AppXManifest。 UWP apps run inside a virtual container, configured based on the information from the AppxManifest from the package. UWP 应用程序在虚拟容器内运行,根据来自 package 的 AppxManifest 的信息进行配置。 If the OS is too old it will not know how to "read" and process that manifest, therefor your app will most likely fail to run.如果操作系统太旧,它将不知道如何“读取”和处理该清单,因此您的应用程序很可能无法运行。

You should be able to install via Powershell on all machines that can run packaged applications:您应该能够通过 Powershell 在所有可以运行打包应用程序的机器上安装:

Add-AppxPackage -Path "C:\Users\user1\Desktop\MyApp.msix"

See more parameters here . 在此处查看更多参数

Once you have confirmed that this is working, you have a number of different choices on how to run that command in a way that average users understand.一旦您确认这是有效的,对于如何以普通用户理解的方式运行该命令,您有许多不同的选择。

For example, you could create an Inno Setup Installer that runs that command like this:例如,您可以创建一个运行该命令的Inno Setup Installer,如下所示:

; Just the relevant snippet:
[Run]
Filename: "powershell.exe"; Parameters: \
  "-ExecutionPolicy Bypass -Command Add-AppxPackage '{tmp}\MyApp.msixbundle'"; \
  StatusMsg: "Installing application...."; \
  WorkingDir: {app}; Flags: runhidden

Edit: Maybe you could also try to restore the built-in applications users might have deleted?编辑:也许您也可以尝试恢复用户可能已删除的内置应用程序? In Windows 10 you can do that by running:在 Windows 10 中,您可以通过运行:

Get-AppxPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Advanced Installer中安装侧载UWP - Installing Side-Loaded UWP in Advanced Installer 无需App打包项目,在侧载UWP和Console App之间使用App Service - Using App Service between Side-loaded UWP and Console App without App packaging project UWP侧面加载的应用程序不监听python localhost服务器 - UWP side-loaded app doesn't listen to python localhost server 如何静默安装 UWP appx? - How to silent install an UWP appx? 如何更新安装的 UWP.appxbundle with.appx - How to update installed UWP .appxbundle with .appx 将UWP应用打包为APPX时控制html文件的压缩 - Control compression of html file when packaging UWP app as an APPX UWP无法使用App Installer进行安装 - UWP won't install using App Installer 无法将UWP丢弃到本地计算机。 “所需的框架CoreRuntime.1.0.appx无法安装” - Can't deplopy UWP to local machine. “The required framework CoreRuntime.1.0.appx failed to install” 如何使用MSBuild在UWP应用中将目标生成的内容部署到AppX包中 - How to deploy Content generated in a Target to AppX package in a UWP app with MSBuild 如何确定使用 App Installer 安装 Windows 10 UWP 应用程序的位置 - How to determine location from which Windows 10 UWP app was installed with App Installer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM