PDA

View Full Version : Hiding command window in custom action



AaronM
07-14-2008, 12:27 PM
I currently have a couple of custom actions (Launch Executable) which simply run a command (SQLCMD, etc.) in my Basic MSI project. The commands could be extremely quick or last a couple of minutes, in which case the console window shows status.

Ideally, I would like the actual command window not visible to user. However, I don't want the user to think the Installer is frozen.

I was hoping to be able to do the following:
Get InstallShield to launch the commands hidden (how?). In this case, I would very much want to be able to show some text to the user in the main installation window since custom actions never show any description (or can they?)

Any thoughts? Perhaps I'm missing something very simple with custom actions or scripts. Thanks.

Christopher Painter
07-14-2008, 02:41 PM
Have you looked at LaunchAppAndWait with the LAAW_OPTION_HIDDEN flag?

http://helpnet.acresso.com/robo/projects/DevStudio9HelpLangref/LangrefLaunchAppAndWait.htm

AaronM
07-14-2008, 04:37 PM
Coming form C# background, was hoping to stay away from InstallScript in my Basic MSI project. But I guess I'll give it a shot. Does anyone have any good links on tutorials for the InstallScript syntax/language in addition to InstallShield's help?

Edit --> On second thought, InstallScript is much better and powerful than I first thought. Do most people tend to use InstallScript functionality within Basic MSI installers for custom actions?

AaronM
07-14-2008, 10:53 PM
On a related note...

Is it possible to set the current step description for the main Install Shield window (above the progress bar) when launching a custom action?

For instance, if a managed dll custom action is used that may take any length of time it would be helpful to display some related text to let user know what is happening.

Christopher Painter
07-15-2008, 09:51 AM
For unmanaged custom actions, InstallScript is a great choice. I advocate it's use for Basic MSI projects.

If you already have a dependency on the framework, then I reccomend skipping InstallScript and writing managed custom actions using DTF.

For publishing messages, look at the ActionText table and the MsiProcessMessage API. The InstallationProgress dialog has controls that subscribe to messages and progressbar that subscribes to ticks to do what you are describing.

swaroop1616
07-16-2008, 05:14 AM
Hi All,
Even i am facing the same problem. I am using the basic MSI project i just need to hide the console window, I chosed Launch executable as action type. So can any body help me how to hide the console window :confused: I am using Install Scield 2008.

Thanks,
Swaroop.

Christopher Painter
07-16-2008, 08:54 AM
Windows Installer does not natively have the ability to supress the window for an EXE Custom Action Type. The two ways of doing this are

1) If you wrote the EXE yourself, compile it as a windowless Windows Application instead of a Console application.

2) Use an intermediate custom action to shell out to the program and hide the window ( like the LaunchAppAndWait example given previously ).

swaroop1616
07-16-2008, 09:49 AM
Thanks for the reply Christopher Painter. I created a entry-point function to call LaunchAppAndWait and i created a install script custom action , the problem is the function name is not showing in the custom action wizard. I followed the procedure that is there in the fallowing example "http://helpnet.acresso.com/robo/projects/DevStudio9HelpLangref/LangrefLaunchAppAndWait_example.htm". Can you please guide me further how to get my function in the coustam action wizard.

Christopher Painter
07-16-2008, 11:46 AM
Did you export the function? ( Can you/do you want to / post your rul file? )

swaroop1616
07-16-2008, 11:58 AM
Yes i exported the function , here is the code i used

EXPORT prototype MyFunction(HWND);

function MyFunction(hMSI)

begin

end;

But i did not posted the rul file. can you tell me how to post that file.

Thanks.

RobertDickau
07-16-2008, 12:04 PM
Please try changing EXPORT to lowercase:

export prototype MyFunction(HWND);

swaroop1616
07-23-2008, 03:02 AM
Thanks RobertDickau and Christopher Painter , it worked.