WiX 3.11.1 -- 错误 LGHT0103:系统找不到文件 [英] WiX 3.11.1 -- error LGHT0103 : The system cannot find the file

查看:29
本文介绍了WiX 3.11.1 -- 错误 LGHT0103:系统找不到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 10 专业版 1703 64 位上的 WiX 3.11.1.不使用 Visual Studio.使用简单的文本文件如下.

WiX 3.11.1 on Windows 10 Pro Version 1703 64-bit. NOT using Visual Studio. Using simple text files as follows.

这是我发现的情况的测试用例.

Here is a test case of the situation I am finding.

myapp.wxs 是这样的:

myapp.wxs is this:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

    <Product Id="*"
             Name="MyApp"
             Language="1033"
             Version="1.0.0.0"
             Manufacturer="Me"
             UpgradeCode="PUT-GUID-HERE">

        <Package InstallerVersion="301"
                 Compressed="yes"
                 InstallScope="perMachine"
                 Manufacturer="Me"
                 Description="My App"
                 Keywords=".NET,Installer,MSI" />

        <MediaTemplate EmbedCab="yes" />
        <UIRef Id="WixUI_Minimal" />
        <UIRef Id="WixUI_ErrorProgressText" />

        <!-- ****************************************** -->
        <WixVariable Id="WixUIDialogBmp"
                     Value="[CMP_Refresh_file]" />
        <!-- ****************************************** -->

        <Feature Id="MyFeature"
                 Title="MyApp Feature"
                 Description="Installs MyApp"
                 Level="1">
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="TestFolder" Name="TESTfolder" />
        </Directory>
        <Component Id="CMP_Refresh_file" Guid="*" Directory="TESTfolder">
            <File Id="FILE_RefreshPNG" Source= "Refresh.png" KeyPath="yes" />
        </Component>
    </Fragment>
</Wix>

myapp.bat 是:

myapp.bat is:

"C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe" myapp.wxs
"C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe"  myapp.wixobj -ext WixUIExtension -ext WixUtilExtension
@pause

当我运行 .bat 文件时,它找不到 CMP_Refresh_file(错误 LGHT0103:系统找不到文件).文件夹 TESTfolder 是 .wxs 文件所在文件夹的直接子文件夹.

When I run the .bat file, it cannot find the CMP_Refresh_file (error LGHT0103 : The system cannot find the file). The folder TESTfolder is a direct sub-folder of the folder in which the .wxs file exists.

替换完整文件路径可解决此问题.但这不是我想要的,因为我将拥有大量文件和文件夹.(另外,如果我把这个文件和 .wxs 文件放在同一个文件夹里,它当然会找到它.)

Substituting the full file path solves the issue. BUT that is not what I want as I will have a multitude of files and folders. (Also, if I put the file in the same folder as the .wxs file, of course, it finds it.)

我怀疑这纯粹是由于我的无知导致的语法问题.在任何情况下,我都为 WixUIDialogBmp 的值尝试了无穷无尽的语法变化(全名除外).

I suspect it is purely a syntactic issue caused by my ignorance. In any case, I have tried endless variations of syntax for the Value of WixUIDialogBmp without joy (except the full name).

帮助解决非常非常感谢.谢谢!

Help to resolve very much appreciated. Thanks!

推荐答案

查看您的 WiX 代码,我可以看到您在 MSI 目标和源文件夹路径之间感到困惑.Directory 标签用于在您运行 MSI 的机器上创建一个文件夹(您要在其中部署应用程序) - 它与您打包文件的源文件夹无关.

Looking at your WiX code I can see that you are getting confused between the MSI destination and the source folder paths. The Directory tag is to create a folder on the machine where you run the MSI (where you want to deploy your application) - it has nothing to do with the source folders from where you package your files.

将您的文件路径替换为:

Replace your filepath with:

<File Id="FILE_RefreshPNG" Source= "\TESTfolder\Refresh.png" KeyPath="yes"/>

如您所见,文件->源属性路径应参考您的WXS文件路径编写.

As you can see, the file -> source attribute path should be written with reference to your WXS file path.

如果您打算在客户端计算机上的 testfolder 下部署 refresh.png,那么您必须在 之后立即关闭 </Directory> 标记. 标签

If you are planning to deploy the refresh.png underneath the testfolder on the client machines then you got to move to closing </Directory> tag right after your <File> tag

这篇关于WiX 3.11.1 -- 错误 LGHT0103:系统找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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