cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

EzDefineDialog error - Help!

I have a Basic MSI project and I'm trying to launch a custom dialog from a CA. I need to do this in a deferred action, so I can't use a MSI dialog. I keep getting errors, however. I'm using the EzDefineDialog function. I've tried:

nResult = EzDefineDialog ("MyDialog", ISUSER, "MyDialog", 0);
which returns -1. During the installation, I don't even see the _isuser.dll anywhere in the SUPPORTDIR, but _isres.dll is in there.

I've also tried:

nResult = EzDefineDialog ("MyDialog", "", "MyDialog", 0);

and
nResult = EzDefineDialog ("MyDialog", ISRES, "MyDialog", 0);

which both return DLG_ERR.

The only time I've gotten anything to work is by trying to assign a Resource ID in the Dialog table to my dialog. I set the ISResourceID field to 12001 and try
nResult = EzDefineDialog ("MyDialog", "", "", 12001);
This works in that a dialog appears, but it is one of the built-in dialogs. I've tried other numbers in the 12XXX range and they are for existing dialogs. When I try a number that doesn't appear to already be set, i.e. 12345, I get the DLG_ERR again.

How am I supposed to get this to work? I feel like I've tried everything. I created a new project to test it out, same results. Please help!
Labels (1)
0 Kudos
(2) Replies
filwfqfe
Level 3

do the dialog which id is 12345 exist in your project?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

It is possible the InstallScript engine is unable to determine what language resources to use in a deferred custom action; the language specific resource files contain any dialogs that can be called. Normally it makes this determination based on an MSI property, but a very limited set of properties is available to deferred custom actions. If the correct resource files cannot be loaded, no dialogs contained in those resources can be used.

In general, no UI should be displayed by any actions that run from the installation execute sequence. Errors should be sent through to the user with the MsiProcessMessage API to ensure silent installations will work correctly. Any other dialogs should be moved to the UI sequence.

Also, using InstallScript dialogs from Basic MSI projects is normally not recommended as the InstallScript dialog model is not well suited for a pure MSI installs. For example, without specifically writing code to handle silent MSI installations, InstallScript dialogs will end up being displayed if the action they are called from runs in an MSI install. In addition, dialog sequencing between MSI and InstallScript dialogs in an MSI install is not possible.
0 Kudos