开发者

WIX Installer Trim Edit Control to Ensure No White Space?

开发者 https://www.devze.com 2023-03-15 12:53 出处:网络
I have a custom WIX dialog that has an edit control on it (text box).I want to ensure that the user has typed something into it before proceeding to the next screen.

I have a custom WIX dialog that has an edit control on it (text box). I want to ensure that the user has typed something into it before proceeding to the next screen.

The code below works great if the edit control remains empty:

<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="BHSInstallDirDlg"><![CDATA[LicenseAccepted<>""]]></Publish>

However the problem I have is if they enter white space (spacebar) in the field this check will fail. Is there anyway I can trim white spaces? Or is there a different 开发者_如何学Capproach I might look at to solve this issue?


The only solution I can think of is a custom action which trims the property value and saves it. You can run it through a DoAction control event before the NewDialog event.

Since you need to save an installer property, the custom action must be able to receive the installation handle. So it can be a DLL or VBScript.

You can find a C++ DLL custom action tutorial here: http://www.codeproject.com/KB/install/msicustomaction.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消