PDA

View Full Version : Executing logic after custom dialog



kberthelot
06-24-2008, 09:49 PM
I have a custom dialog that prompts the user to enter two text values, which I'm storing in the registry. For one of the values, I need to perform a transformation on the value before storing it. I've tried creating a custom action that calls the installscript code that performs the transformation, but I can't seem to get the code to execute. I've tried placing the custom action at different places in the install sequence with no luck. At best nothing happens, at worst the install crashes. I stripped out all the logic in the function and just displayed a dialog to see whether the function was being invoked and it's not.

Is there a "best practice" for doing this sort of thing? I get the impression that creating custom actions is typically viewed as a last resort. If a custom action is indeed the right approach, what's the best way to invoke it?

heiner_violet
06-25-2008, 04:15 AM
I'm using Custom Actions in Basic-MSI projects very often - and see no problems.
Is it necessary to execute your installscript code during the install sequence? Otherwise you could try to execute the custom action immediately after the dialogs Next-Button (accessible via the behaviour tab of the dialog).

kberthelot
06-25-2008, 09:12 AM
Yeah, I tried doing that too, but apparently I'm missing something since the action never gets executed. Here's the installscript code I'm trying to execute, and I've attached images showing how the custom action and dialog are configured:



export prototype void doDialog();

function void doDialog()
begin
MessageBox("Hello", INFORMATION);
end;

kberthelot
06-25-2008, 10:09 AM
I figured it out. I was not including the handle to the installer database as an input parameter to my function.