【问题标题】:Unresolved reference to CustomAction:Cleanup in WiX未解决的对 CustomAction 的引用:WiX 中的清理
【发布时间】:2017-06-23 07:39:30
【问题描述】:

当使用 dark.exe 从 Installshield 处理 MSI 文件时,它会在从 Visual Studio 2013 构建时生成一个包含多个错误实例的文件:

Unresolved reference to symbol 'CustomAction:CleanUp'

部分wxs文件为:

          <Dialog Id="SetupCompleteSuccess" X="50" Y="50" Width="374" Height="266" Title="[ProductName] - InstallShield Wizard" NoMinimize="yes">
            <Control Id="OK" Type="PushButton" X="230" Y="243" Width="66" Height="17" Text="&amp;Finish" TabSkip="no" Default="yes" Cancel="yes">
                <Publish Event="DoAction" Value="CleanUp">ISSCRIPTRUNNING="1"</Publish>
                <Publish Event="DoAction" Value="LaunchProgramFileFromSetupCompleteSuccess">LAUNCHPROGRAM And PROGRAMFILETOLAUNCHATEND &lt;&gt; "" And NOT Installed</Publish>
                <Publish Event="EndDialog" Value="Exit">1</Publish>
                <Publish Event="DoAction" Value="ShowMsiLog">MsiLogFileLocation And (ISSHOWMSILOG="1") And NOT ISENABLEDWUSFINISHDIALOG</Publish>
            </Control>

查看带有 ORCA 的 MSI 文件,在表 CustomAction 中包含 LaunchProgramFileFromSetupCompleteSuccess 条目(不会引发错误)并且没有 Cleanup 条目,因此 dark.exe 在创建一组 CustomAction 时表现一致,如下所示:

       <CustomAction Id="ISPreventDowngrade" Error="[IS_PREVENT_DOWNGRADE_EXIT]" />
    <CustomAction Id="ISRunSetupTypeAddLocalEvent" BinaryKey="ISExpHlp.dll" DllEntry="RunSetupTypeAddLocalEvent" />
    <CustomAction Id="ISSelfRegisterCosting" BinaryKey="ISSELFREG.DLL" DllEntry="ISSelfRegisterCosting" />
    <CustomAction Id="ISSelfRegisterFiles" BinaryKey="ISSELFREG.DLL" DllEntry="ISSelfRegisterFiles" Execute="deferred" Impersonate="no" />
    <CustomAction Id="ISSelfRegisterFinalize" BinaryKey="ISSELFREG.DLL" DllEntry="ISSelfRegisterFinalize" />
    <CustomAction Id="ISUnSelfRegisterFiles" BinaryKey="ISSELFREG.DLL" DllEntry="ISUnSelfRegisterFiles" Execute="deferred" Impersonate="no" />
    <CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
    <CustomAction Id="SetAllUsersProfileNT" Property="ALLUSERSPROFILE" Value="[%SystemRoot]\Profiles\All Users" />
    <CustomAction Id="setAllUsersProfile2K" Property="ALLUSERSPROFILE" Value="[%ALLUSERSPROFILE]" />
    <CustomAction Id="setUserProfileNT" Property="USERPROFILE" Value="[%USERPROFILE]" />
    <CustomAction Id="ShowMsiLog" Directory="SystemFolder" ExeCommand="[SystemFolder]notepad.exe &quot;[MsiLogFileLocation]&quot;" Return="asyncNoWait" />
    <CustomAction Id="LaunchProgramFileFromSetupCompleteSuccess" BinaryKey="NewBinary19" DllEntry="LaunchProgram" />
    <CustomAction Id="ISPrint" BinaryKey="SetAllUsers.dll" DllEntry="PrintScrollableText" />

我应该如何处理这个问题?

【问题讨论】:

    标签: c# wix


    【解决方案1】:

    查找在哪个 dll 'Cleanup' 自定义操作中存在并添加引用

    <Binary Id="CleanupBinary" SourceFile="Your location of the CleanUp Dll" />
    <CustomAction Id="CleanUp" BinaryKey="CleanupBinary" DllEntry="Your cleanup custom action name" />
    

    【讨论】:

    • 如何识别 dll 中是否存在自定义操作?我应该查看哪些 dll?
    • 是你自己创建的安装程序。如果是这样,那么我想您可以获得自定义操作的源代码。如果它不是您创建的,请使用 ' dark -x ./YourInstaller.msi ' 这将创建 ' Binary ' 文件夹。检查该文件夹内是否有任何文件包含 ' CleanUp ' 。如果没有 CleanUp,那么很抱歉,我帮不上什么忙。
    • 有一个 Binary 文件夹,其中包含 19 个名为 NewBinaryN 的文件,其中 N 的范围从 1 到 19。文件 1-18 似乎是图像。NewBinary19 是一个 dll,但它似乎被使用启动程序。 msi文件中CustomAction表中的条目是LaunchProgramFileFromSetupCompleteSuccess 1 NewBinary19 LaunchProgram
    • 嗨西蒙,我想弄清楚安装程序是如何创建的。出于好奇,您是否尝试过使用安装程序进行安装.. 是否成功?
    • 如果它尝试使用 Wix cmd 工具 Candle 和 Light 处理文件,Candle 会生成一个 .wixobj 文件,但 light 报告与 Visual Studio 相同的问题 - 未解决对 Symbol 的引用,所以我猜是从 Visual Studio 生成未解析符号消息的原因。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多