gpt4 book ai didi

wix - 一个 MSI 中的两个 PathEdit 对话框(错误 2343 - 指定的路径为空)

转载 作者:行者123 更新时间:2023-12-04 19:09:04 27 4
gpt4 key购买 nike

我正在创建一个 WiX 安装程序,我希望允许用户选择安装目录的路径以及数据目录。我在我的代码中添加了两个 InstallDirDlg,并命名了一个 Custom_Dir 和另一个 Custom_DirData。

在 Custom_DirData 中,我没有使用 WIXUI_INSTALLDIR 属性,而是使用了 DATALOCATION 属性,该属性在安装开始时在 appsearch 中设置。

当我运行 msi 时,Custom_Dir 工作正常。但是,当我进入 Custom_DirData 对话框时,只要按浏览或下一步,就会弹出 2343 错误消息。

这是它在日志中所说的:

DEBUG: Error 2343:  Specified path is empty.

我可以在日志文件中看到这些属性被设置得更早:
PROPERTY CHANGE: Adding DATALOCATION property. Its value is 'C:\Remindex Local Data\'.

PROPERTY CHANGE: Adding _BrowseProperty property. Its value is 'C:\Remindex Local Data\'.

所以我不太确定它在谈论什么路径。以防万一您需要一些额外的信息,以下是 UI 代码中的三个相关对话框:
<Publish Dialog="Custom_Dir" Control="Back" Event="NewDialog" Value="Custom_Setup">1</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4"><![CDATA[(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND WixUI_InstallMode = "InstallRemote"]]></Publish>
<Publish Dialog="Custom_Dir" Control="Next" Event="NewDialog" Value="Custom_DirData" Order="5"><![CDATA[(WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1") AND WixUI_InstallMode = "InstallServer"]]></Publish>
<Publish Dialog="Custom_Dir" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="Custom_Dir" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="Custom_DirData" Control="Back" Event="NewDialog" Value="Custom_Dir">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SetTargetPath" Value="[DATALOCATION]" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Property="_BrowseProperty" Value="[DATALOCATION]" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

任何建议将不胜感激。

最佳答案

我的问题是我的 [DATALOCATION] 属性周围的括号。它应该是这样的:

<Publish Dialog="Custom_DirData" Control="Back" Event="NewDialog" Value="Custom_Dir">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SetTargetPath" Value="DATALOCATION" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="Custom_DirData" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Property="_BrowseProperty" Value="DATALOCATION" Order="1">1</Publish>
<Publish Dialog="Custom_DirData" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

关于wix - 一个 MSI 中的两个 PathEdit 对话框(错误 2343 - 指定的路径为空),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17395196/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com