首页 > 解决方案 > UWP 应用安装程序文件中存在的本地文件的 URI

问题描述

我想为我的 UWP 应用程序编写一个 appinstaller 文件,以便自动安装依赖项。出于某种原因,客户不希望应用程序在互联网上,并希望通过公司笔式驱动器分发应用程序(远程工作位置:无网络)

如何为存在的本地文件的相对路径提及 uri。我看到的示例是我尝试使用 Uri="file:///installer.appinstaller" 的 Web URI

<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
    xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
    Version="0.0.7.0"
    Uri="file:///installer.appinstaller" >


    <MainPackage
        Name="...."
        Publisher="CN=zzz, O=zzz Ltd., C=FL"
        Version="1.0.7.0"
        ProcessorArchitecture="x86"
        Uri="file:///App_1.0.7.0_x86_Debug.appx"/>

    <Dependencies>
    <Package Name="Microsoft.NET.CoreFramework.Debug.2.2" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="2.2.27909.0" ProcessorArchitecture="x86" Uri="file:///Dependencies/x86/Microsoft.NET.CoreFramework.Debug.2.2.appx"/>    
</Dependencies>
</AppInstaller> 

标签: uwpwindows-installeruriappinstaller

解决方案


根据我得到的回复,文件可以是机器上的本地文件,但指定的路径不能是相对路径,需要是文件的完整路径。


推荐阅读