InstallShield基本MSI系统搜索不能运行xml文件



我试图在升级时将XML文件中的值重新读取到我的Installshield Basic MSI项目中,因为它总是坚持用默认值覆盖通过XML文件更改修改的XML文件。当我进入"系统搜索"屏幕时,我通过系统搜索向导添加一个新的XML文件值。然后输入exe文件的文件名。配置文件(下面的内容),我指定安装文件的完整路径,我输入"/configuration/appSettings/add[@key="UiServiceIpAddress"]"作为XPath。我让它搜索属性"value"的值,并告诉它将值存储在一个有效的属性中。

当我运行这个msi时,它似乎不做任何事情。在查看我的MSI日志(下面的输出)时,我可以看到AppSearch正在运行,但它甚至没有提到我的xml AppSearch。在谷歌上搜索了一下之后,我想出了如何在我的MSI上运行验证。有一个与它相关的错误,读"无效的文件名;表:签名,列文件名,密钥:NewSignature1"。文件名对我来说是有效的。所以我被难住了。

Msi日志输出:

Action start 13:21:48: AppSearch.
AppSearch: Property: IEXPLORE, Signature: IEXPLORE_REG.C8C0673E_50E5_4AC4_817B_C0E4C4466990
MSI (c) (80:B0) [13:21:48:597]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (c) (80:B0) [13:21:48:597]: WIN64DUALFOLDERS: 'C:Program Files (x86)' will substitute 17 characters in 'C:Program FilesInternet ExplorerIEXPLORE.EXE' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
MSI (c) (80:B0) [13:21:48:597]: PROPERTY CHANGE: Adding IEXPLORE property. Its value is 'C:Program Files (x86)Internet ExplorerIEXPLORE.EXE'.
AppSearch: Property: DOTNETVERSION40FULL, Signature: DotNet40Full
MSI (c) (80:B0) [13:21:48:597]: Note: 1: 2262 2: Signature 3: -2147287038 
MSI (c) (80:B0) [13:21:48:597]: PROPERTY CHANGE: Adding DOTNETVERSION40FULL property. Its value is '#1'.
Action ended 13:21:48: AppSearch. Return value 1.
XML文件:

<?xml version="1.0"?>
<configuration>
    <appSettings>
        <add value="127.0.0.1" key="UiServiceIpAddress"></add>
    </appSettings>
</configuration>

我怀疑您正在使用AppSearch来搜索XML值,并使用上面给出的XPATH表示法将它们分配给属性。

您的MSI的ICE验证显示appsettings.xml文件的文件名格式不正确。我认为您所需要做的就是为文件名提供短名称(8.3)格式。

示例:FileName=appSettings.xml

FileName columnValue = APPSET~1.XML|appsettings.xml

Phil是正确的,他说MSI本身不支持XML文件搜索,而InstallShield已经添加了一个自定义操作来为我们管理这个。

搜索'ISXmlAppSearch',它将显示结果。

下面是来自我的一个安装程序的日志文件的结果,它没有找到xml文件。

Action start 14:09:17: ISXmlAppSearch.
InstallShield 14:09:18: Searching for the contents of the XML Element using the Element '//brand'.
InstallShield 14:09:18: The location of the XML file, stored in the Property 'SYSTEMSETTINGS1', is currently a NULL value.  It appears that the AppSearch did not find the file.
InstallShield 14:09:18: Searching for the contents of the XML Element using the Element '//maincomputer'.
InstallShield 14:09:18: The location of the XML file, stored in the Property 'SYSTEMSETTINGS', is currently a NULL value.  It appears that the AppSearch did not find the file.
MSI (s) (F0:1C) [14:09:18:199]: Doing action: LaunchConditions
Action ended 14:09:18: ISXmlAppSearch. Return value 1.

这是另一个显示结果的,这样你就知道会发生什么了:

Action start 9:28:24: ISXmlAppSearch.
MSI (s) (D0!0C) [09:28:24:539]: PROPERTY CHANGE: Adding ISMEDFX property. Its value is 'ac'.
InstallShield 9:28:24: Searching for the contents of the XML Element using the Element '//brand'.
InstallShield 9:28:24: Success! The ISXmlAppSearch action set the value of the associated property to the following value: 'ac'.
MSI (s) (D0!0C) [09:28:24:539]: PROPERTY CHANGE: Modifying MAINCOMPUTER property. Its current value is 'YES'. Its new value: 'yes'.
InstallShield 9:28:24: Searching for the contents of the XML Element using the Element '//maincomputer'.
InstallShield 9:28:24: Success! The ISXmlAppSearch action set the value of the associated property to the following value: 'yes'.
MSI (s) (D0!0C) [09:28:24:539]: PROPERTY CHANGE: Adding STORAGELOCATIONROOT property. Its value is 'p:program files (x86)amazing charts'.
InstallShield 9:28:24: Searching for the contents of the XML Element using the Element '//storagelocationroot'.
InstallShield 9:28:24: Success! The ISXmlAppSearch action set the value of the associated property to the following value: 'p:program files (x86)amazing charts'.
MSI (s) (D0:D8) [09:28:24:555]: Skipping action: MedFxSet (condition is false)
MSI (s) (D0:D8) [09:28:24:555]: Doing action: LaunchConditions
Action ended 9:28:24: ISXmlAppSearch. Return value 1.
  • 为了使用InstallShield向导进行设置,我创建了一个新的XML类型系统搜索。

    • 我指定了文件名,在我的例子中是SYSTEM~1.XML|systemsettings.xml。注意:如果您在这里指定短名称,向导会给出无效的文件名错误,您必须使用直接编辑来确保您有一个有效的文件名。

    • 我将'Look In'值设置为'在以前的搜索中找到的路径:',但你可以指定任何你想要的,只要它是一个真正的路径。我认为这是在成本初始化之前完成的,所以你的INSTALLDIR属性可能不存在,这就是为什么我对安装目录进行AppSearch并使用先前搜索的选项。

    • 我指定了XPath到XML元素。我记得对此感到沮丧,最后我需要指定的只是我的特定元素,特别是如果它在xml文件中是唯一的。例如://brand而不是parentelement/brand

    • 我选择了"查找"选项到"元素的内容",然后将值存储在我以后可以使用的属性中。

要手动修改文件名,请打开直接编辑器。导航到签名表找到条目并修改FileName值

Windows Installer的AppSearch中没有任何东西可以从Xml文件中提取值。有两种解释:

  1. InstallShield已经添加了Windows Installer之外的功能,所以他们可能会添加一个内部自定义动作来做这件事,这将显示在你的日志的其他地方。

  2. 文档不知怎么地把它与IniLocator功能混淆了,IniLocator功能将从标准INI文件(不是Xml文件)中提取值。

另一个答案指出,1。是原因。在日志中搜索ISXmlAppSearch。

最新更新