本文介绍了Wix-ICE 64错误:链接外部组件组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用热量收集我需要的文件作为我的安装程序中的组件,并将它们写到一个单独的wxs文件中,效果很好.

i use heat to harvest my files i need as components in my Setup and write them to a separate wxs file, which works perfect.

生成的文件示例:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="AppData_dir_ref">
            <Directory Id="GUID" Name="C" />
            <Directory Id="GUID" Name="OLD" />
        </DirectoryRef>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="AppData_ComponentGroupId">
            <Component Id="GUID" Directory="GUID" Guid="{GUID}">
                <File Id="GUID" KeyPath="yes" Source="$(var.test)\C" />
            </Component> ...

...等等..

现在我在SetupMain中使用它们:

Now i use them in my SetupMain:

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

        <Product Id="*"
                Name="SETUP TEST 1.0"
                Language="1031"
                Version="1.0.0.0"
                Manufacturer="bla"
                UpgradeCode="ID">

            <Package Id="*"
                     Keywords="Installer"
                     InstallerVersion="300"
                     Compressed="yes"
                     Languages='1031'
                     SummaryCodepage='1252'
                     Manufacturer="bla"
                     Description="Setup"
                     Comments="bla"
                     InstallScope="perMachine"/>

            <Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />

            <Directory Id="TARGETDIR" Name="SourceDir" >
                <Directory Id="LocalAppDataFolder" >
                    <Directory Id="AppData_dir_ref" Name="Test" />

                </Directory>
            </Directory>

            <Feature Id="F.Core" Title="bla" Level="1">
                <Feature Id="F.Data">
                    <ComponentGroupRef Id="AppData_ComponentGroupId" />
                </Feature>
            </Feature>

        </Product>
    </Wix>

不幸的是,我所有组件和目录都出现ICE64错误:

Unfortunately i got ICE64 errors for all my components and directories:

ICE64错误:目录XX在用户配置文件中,但未在RemoveFile表中列出ICE64错误:组件xx enter code here安装到用户配置文件中时,必须在HKCU下注册一个注册表项作为其密钥路径,而不是文件...

ICE64 Error: The directory XX is in the user profile but is not listed in the RemoveFile tableICE64 Error: The component xx enter code hereinstalls to user profile it must register a registry key under HKCU as its key path, not a file ...

我该如何解决?我在互联网上搜索了一段时间,但找不到任何提示.这似乎很简单,基本上我忘了在主体中定义.我的目标是建立一个简单的安装程序,在安装时复制使用heat命令在文件build中定义的目录结构,并在卸载时将其删除.

How can i fix it? I searched a while in the internet but couldn´t find a hint. It seems to be something really simple and basically i forgot to define in my main. My aim is to build a simple installer which copies the directory structure defined in the file build with heat command while installing and deletes it when uninstalling.

更新1:小更新我如何使用RemoveFolder和RegistryValue标签借助以下答案来修复错误:

UPDATE 1:Small Update how i fixed the errors with the help of the answers below using RemoveFolder and RegistryValue Tags:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="AppData_dir_ref">
            <Directory Id="dir1" Name="C" />
            <Directory Id="dir2" Name="OLD" />
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="Cg.R">
            <Component Id="test" Directory="Data" Guid="...">
                <RemoveFolder Id="Data" On="uninstall" Directory="AppData_dir_ref"/>
                <RemoveFolder Id="Rf.1" On="uninstall" Directory="C"/>
                <RemoveFolder Id="Rf.2" On="uninstall" Directory="OLD"/>
                <RegistryValue Root="HKCU" Key="Software\...\..." Name="installed" Type="integer" Value="1" KeyPath="yes"/>
            </Component>
        </ComponentGroup>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="Cg.D">
            <Component Id="cmp5" Directory="dirC23" Guid="...">
                <File Id="fil2" Source="Bla\...\...\...xml" />
                <RemoveFolder Id="Rf.b" On="uninstall" Directory="dirC23"/>
                <RegistryValue Root="HKCU" Key="Software\...\..." Name="installed" Type="integer" Value="1" KeyPath="yes"/>
            </Component>

...我不知道这样做是否是最好的方法,但目前仍有效.与 heat.exe Automation 结合使用时,任何改进建议或最佳做法都值得赞赏.

...I don´t know if its the best way to do so, but its working for now. Any improvement suggestions or best practices when using it with heat.exe automation are appreciated.

最后一点是我仍然有警告:

Last point is that i still have warnings:

ICE91:文件x将被安装到每个用户目录y中,该目录不会根据ALLUSERS值而变化.即使需要按机器安装,也不会将此文件复制到每个用户配置文件.

我了解到此警告是无害的.但是无论如何,很高兴了解将来可能解决警告的原因.

I read that this warning is harmless. But anyway, it would be nice to understand the reason to maybe solve the warning sometime in the future.

推荐答案

这两个验证错误均与安装到用户配置文件或在表达式运行时安装每个用户的数据有关.简而言之,为每个用户安装磁盘上重复的文件:C:\ Users \ User1 \ MyFile.txt,C:\ Users \ User2 \ MyFile.txt等...

Both these validation errors relate to installing to the user profile, or installing per-user data as the expression goes. In short installing files that are duplicated on disk for each user: C:\Users\User1\MyFile.txt , C:\Users\User2\MyFile.txt, etc...

您需要为所有安装到每个用户文件夹路径的文件夹添加一个删除文件夹条目,以便通过MSI验证.您的情况是AppData_dir_ref.

You need to add a remove folder entry for all folders that install to a per-user folder path in order to pass MSI validation. In your case this is AppData_dir_ref.

同样,您还需要为安装到用户配置文件的组件设置 HKCU注册表项路径.因此,您无需将 C:\ Users \ User1 \ MyPath 设置为将要安装到用户配置文件的组件的密钥路径设置为 HKCU \ Software \ YourCompany \ YourProduct

Likewise you also need to set a HKCU registry key path for components that install to the user profile. So instead of setting C:\Users\User1\MyPath you set the key path to something like HKCU\Software\YourCompany\YourProduct for the component that installs to the user profile.

我没有设置Wix来测试编译,但是下面是您大致需要的模拟:

I don't have Wix set up to test compile, but here is a mock-up of roughly what you need:

   <Component Id="RemoveFolder">
      <RemoveFolder Id="MyUserProfileFolder" On="uninstall" Directory="AppData_dir_ref"/>
      Your content here...
    </Component>

     ...

   <Component Id="UserProfile">
      <RegistryValue Root="HKCU" Key="SOFTWARE\YOURCOMPANY\YOURPRODUCT" Name="Complete"
                     Value="TestValue" Type="string" KeyPath="yes"/>
      Your content here...
    </Component>

这篇关于Wix-ICE 64错误:链接外部组件组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 09:57