cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kvasko
Pilgrim

Custom Action Error crashes installer

I am having some trouble with prompting the user with a simple custom action "Error" message.

I created the error and left everything with the default settings.

In my Dialog box I created a "DoAction" event and called the custom action when the user presses the "OK" button. I then put a condition on the error based on what path the user picks. If the user picks an invalid drive the error is displayed and it stays on the current dialog (the dialog that generate the error) if they pick a valid drive the error does not show up and the installer continues.

My condition is working because if the user pick a valid selection it doesn't error as it should. The problem is when the user selects an invalid option, the error message displays as expected but then I get a "MSIEXEC.exe application error" The instruction at "0x0013a008" referenced memory at "0x013a008". The memory could not be "written". Ok and cancel.

I tried changing the event order on the "OK" to have the DoAction before the return and I also tried it after the return but still have the same problem.
[CODE]
Event Arguement Condition
[FEATURENAME] [SELECT_DISK]Path
SetTargetPAth [_BrowseProperty]
DoAction InstallDriveError NOT (SELECTED_DISK="C:\") OR NOT (SELECTED_DISK="D:\")
EndDialog Return (SELECTED_DISK="C:\") OR (SELECTED_DISK="D:\")
[/CODE]
Labels (1)
0 Kudos
2 Replies
Ajay_Ladsaria
Pilgrim

Re: Custom Action Error crashes installer

It looks like you were going for mutually exclusive conditions on the DoAction and EndDialog control events. However, your conditions are not mutually exclusive.

Incorrect:
NOT (SELECTED_DISK="C:\") OR NOT (SELECTED_DISK="D:\")

Correct:
NOT (SELECTED_DISK="C:\" OR SELECTED_DISK="D:\")

Also Correct:
SELECTED_DISK<>"C:\" AND SELECTED_DISK<>"D:\"

Perhaps changing the condition to be mutually exclusive will fix the problem?
0 Kudos
kvasko
Pilgrim

Re: Custom Action Error crashes installer

Ajay Ladsaria wrote:
It looks like you were going for mutually exclusive conditions on the DoAction and EndDialog control events. However, your conditions are not mutually exclusive.

Incorrect:
NOT (SELECTED_DISK="C:\") OR NOT (SELECTED_DISK="D:\")

Correct:
NOT (SELECTED_DISK="C:\" OR SELECTED_DISK="D:\")

Also Correct:
SELECTED_DISK<>"C:\" AND SELECTED_DISK<>"D:\"

Perhaps changing the condition to be mutually exclusive will fix the problem?


You are correct. But that did not resolve the problem.

Apparently the error dialog box is designed to close the installer, which is not what I wanted it to do.

What I ended up doing is making an InstallScript and using the "MessageBox" function to prompt the user.

function InvalidDriveMessage(hMSI)

begin
MessageBox ( 'Your selection was invalid. You must select drive C:\\ or D:\\' , INFORMATION );
end;

This worked as I expected.
0 Kudos