开发者

checking the registration number entered by user

开发者 https://www.devze.com 2023-03-29 00:38 出处:网络
I was trying to use a custom dll for checking the registration number entered by user, but I run every time into “magic” behavior. In the tutorial examples http://wix.tramontana.co.hu/tutorial/event

I was trying to use a custom dll for checking the registration number entered by user, but I run every time into “magic” behavior. In the tutorial examples http://wix.tramontana.co.hu/tutorial/events-and-actions/whats-not-in-the-book the custom action is running after ‘CostFinalize’, which normally should be before file copying procedure, but it turns out that the action runs before the very first dialog box with License Agreement appears. I have tried to solve the problem by assigning an action on the event of clicking the “next” button in registration Dialog

<Pu开发者_如何学Pythonblish Dialog="MySerialCheckDlg" Control="Next" Event="DoAction"      Value="CheckingPID">1</Publish>
<Publish Dialog="MySerialCheckDlg" Control="Next" Event="SpawnDialog" Value="InvalidPidDlg">PIDACCEPTED = "0"</Publish>
...
<CustomAction Id="CheckingPID" BinaryKey="CheckPID" DllEntry="CheckPID" />

<Binary Id="CheckPID" SourceFile="serialcheck.dll" />

In dll, using MsiGetProperty (hInstall, "PIDKEY", Pid, &PidLen); does not get the PIDKEY value from msi specified in MySerialCheckDlg UI

<Control Id="CDKeyEdit" Type="Edit" X="45" Y="159" Width="220" Height="16" Property="PIDKEY" Text="[PIDTemplate]" />

And in the msi the PIDACCEPTED property is not been checked in the line

<Publish Dialog="MySerialCheckDlg" Control="Next" Event="SpawnDialog" Value="InvalidPidDlg">PIDACCEPTED = "0"</Publish>

Thus, the InvalidPidDlg does not appear, and the installation process continues further.

Can you please specify the order of WiX Action Sequence, or maybe specify any other approach which can be used in this situation.


There are two sequences: InstallExecuteSequence and InstallUISequence. If MSI runs with full UI, it executes actions from InstallUISequence; in case where no UI is shown, these actions are skipped. Actions from InstallExecuteSequence are executed during the installation process, with or without UI.

First of all, is your PIDKEY property tied to an edit control? You should something similar in the dialog where you ask users to type in PIDKEY:

<Control Id="PidKeyEdit" Type="Edit" X="45" Y="105" Width="220" Height="18" Property="PIDKEY" Text="{80}" />

Type could be either Edit or MaskedEdit. Publish elements should be associated with Next button control on the dialog:

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17"
         Default="yes" Text="Next">
    <Publish Event="DoAction" Value="CheckingPID">1</Publish>
    <Publish Event="SpawnDialog" Value="InvalidPidDlg">PIDACCEPTED = "0"</Publish>
</Control>

Run your installation with verbose logging to see how actions are executed, and how property values change:

msiexec /i your-product.msi /lv* your-product.log
0

精彩评论

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