[英]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 中提供):
So, two questions:所以,两个问题:
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 之后,即使没有互联网,您似乎也应该能够安装操作系统更新。
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.