Action Text in Visual Studio C# Custom Actions

R

Ron Andersen

I have C# custom actions and merge modules created in Visual Studio to
install some components of the application I am working on. The merge
modules are used with an Install Shield 9 project. When my C# custom
actions run, the progress dialog doesn't display any text as to what
is happening. I have explored several options as follows.

Normally, you can enter the action text in the ActionText table by
giving the name of the custom action and then your desired description
and template. Since Visual Studio uses GUIDs in the custom action name
and those GUIDs change upon every build of the merge module, it is not
practical to enter the action text in the Install Shield project.

The next logical place to do something is inside the custom action
itself using the Windows Installer APIs. There is an API called
MsiProcessMessage that indicates it can be used to update the action
text. There is even a C# wrapper class posted on CodeProject.com
(http://www.codeproject.com/csharp/msiinterop.asp) that provides a C#
interface to the common Windows Installer APIs. The catch, however,
is that you need to have an MSIHANDLE to the current instance of the
Windows Installer database for the install that is being run. The
help idicates that the MSIOpenDatabase API will return an MSIHANDLE,
however, it is not to the instance that is loaded into memory at
install time so changes don't effect the progress dialog displayed.

Using MsiProcessMessage would be ideal as it appears that I would be
permitted to change the action text as various parts of my custom
action run.

Does anybody know how I can obtain a handle to the installers instance
of the MSIHANDLE from a Visual Studio C# Custom Action, or even some
other way to update the action text.

Thank you for your help.

--Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top