cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sincos2007
Level 4

How to add event handler to script for basic MSI project

I add following to script:

prototype OnInstalling();
function OnInstalling()
begin
MessageBox("123", INFORMATION);
end;

When I run the project, I did not get message box.

Thanks
Labels (1)
0 Kudos
(3) Replies
chad_petersen
Level 9

You would have to set it up as an InstallScript Custom Action and then either schedule that Custom Action where you want it to occur in the UI or Exec sequence or tie it in to a dialog box action.

Chad
0 Kudos
sincos2007
Level 4

It seems that basic msi project not support event drive script, is this right?
0 Kudos
chad_petersen
Level 9

"Basic MSI" (I'm not sure why Flexera calls it that, but I assume to distinguish it from their "InstallScript MSI" projects) is just "MSI" as far as Microsoft is concerned. It is a bit different and you do not bother with the older InstallScript event handlers.

There is a couple of different sequences in MSI, UI and Execute, and you schedule the scripts/custom actions to run at the appropriate time in one or both sequences. Or you can have a script run during a dialog box action (DoAction)

https://msdn.microsoft.com/en-us/library/aa368322(v=vs.85).aspx

It is a bit of a change of thought process, but anything is doable, especially when you consider you can call out to a C# DTF Custom Action as Christopher Painter describes here. In other words, from within an installer it should be possible to do anything that C# allows a person to do in code. Practically anything is possible.

http://blog.deploymentengineering.com/2008/05/deployment-tools-foundation-dtf-custom.html

The easiest way to get started with DTF custom actions is to install WiX on a system with Visual Studio installed. This gives a new project type under "Windows Installer XML" of "C# Custom Action Project". These DLLs can be called equally well from InstallShield as from WiX.

That's why Chris calls it "ISWiX" - it combines some of InstallShield abilities with some of WiX abilities.

Once you get a handle on that then it is easy to accomplish anything desired.

I hope that is helpful.

Chad

0 Kudos