Search code examples
c#validationinstallshieldmanagedinstallshield-2013

How to create a custom action for a text box validation in InstallShield 2013 using managed code?


I have some C# code for validating a setting in my application. I would like to add a wizard page to change this setting. The earlier the user sees the setting the better their life will be. Is it possible to write a custom action in C# that will validate a textbox? If so, how?

The solution needs to be part of a Suite Project.

I did review the "Managed Custom Actions" sample project (and the other samples) but didn't see anything that applied to my situation. The textbox's Validation property has a drop down which includes a "browse for DLL Action." Selecting the DLL from this Managed Custom Action results in stating there are no exported actions.

I keep finding hints on the internet, InstallShield's help and the user guide. Unfortunately, most of what I'm finding are for building custom actions for events in Basic MSI projects.


Solution

  • There is currently a split between what can be done in the UI and what can be done by the Actions view in a Suite project. In this case, the UI can invoke validation actions, and those can be from C++ DLLs, but it does not directly support managed code. The Actions view support handles managed code, but does not have any events related to validation.

    So, in summary, what you request is not currently supported. You might be able to invoke managed code by writing a host in C++, but at that point you may be better off just writing the validation itself in C++.