cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AaronM
Level 6

Hiding command window in custom action

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.
Labels (1)
0 Kudos
(11) Replies
Christopher_Pai
Level 16

Have you looked at LaunchAppAndWait with the LAAW_OPTION_HIDDEN flag?

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

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?
0 Kudos
AaronM
Level 6

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.
0 Kudos
Christopher_Pai
Level 16

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.
0 Kudos
swaroop1616
Level 3

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.
0 Kudos
Christopher_Pai
Level 16

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 ).
0 Kudos
swaroop1616
Level 3

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.
0 Kudos
Christopher_Pai
Level 16

Did you export the function? ( Can you/do you want to / post your rul file? )
0 Kudos
swaroop1616
Level 3

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.
0 Kudos
RobertDickau
Flexera Alumni

Please try changing EXPORT to lowercase:

export prototype MyFunction(HWND);
0 Kudos
swaroop1616
Level 3

Thanks RobertDickau and Christopher Painter , it worked.
0 Kudos