I am having touble when I call external utilites with in my installations. Usually a blank dialog box pops up when the CA is running. I am new to install development (less than a years experience) and I am wondering what the best practice is to suppress these or to call them so that they don't come up.
I have tried to use external c# apps that call the utilities and the only utility that this works for is microsoft visual studio .net's gacutil.exe.
I have also tried to use VBScript's run command (using the hide shell parameter), but it doesn't seem like it allows the utility to fully run.
What is the best way to correctly call custom utilities without having those annoying popups that make the installs look unprofessional???
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

Pop-up dialogs when calling CA's
Started by
daktmacfan
, Jun 06 2006 04:03
4 replies to this topic
Posted 06 June 2006 - 08:13
How do you launch those programs? Windows Installer doesn't display such dialogs automatically. But if you are using batch files you may see a command prompt window. Or maybe this is something in your machine configuration (virus scanner, terminal services, ...)
Stefan Krüger
InstallSite.org twitter facebook
Posted 06 June 2006 - 13:20
For my C# console applications that I am using to launch my utilities I do the following:
CODE |
join = args[1] + " " + args[2] + " " + args[3]; ProcessStartInfo ps = new ProcessStartInfo("elToolboxInstaller.exe", join); ps.WorkingDirectory = targetDirectory; ps.UseShellExecute = false; ps.CreateNoWindow = true; Process proc = new Process(); proc.StartInfo = ps; proc.Start(); proc.WaitForExit(); |
A command prompt for the above console application flashes on the screen, not the one for the ToolboxInstaller.exe utility.
for my VBScript I use the following:
CODE |
Const NOT_VISIBLE = 0 Const WAIT_ON_RETURN = True dim Argument Argument = strStudioPath + "\ToolboxUtility2005.exe" + " " + chr(34) + "-Install" + chr(34) + " " + chr(34) + "-Net" + chr(34) + " " + chr(34) + strStudioPath + "\SomeAssembly.2.dll" + chr(34) Set objShell = CreateObject("Wscript.Shell") objShell.Run "%COMSPEC% /C Argument", NOT_VISIBLE, WAIT_ON_RETURN |
With the VBScript above this is the script that doesn't appear to allow the utility to run fully. If I use the objShell.Exec command instead of run, the utility runs correctly, but a console dialog box flashes on the screen.
Stefan, what is the proper way that I should be calling my utilities. Maybe just calling them directly which I don't that, that works either. But if it did it makes it hard to run the same CA an unknown amount of times. How do you ususally call custom actions that are utilities? Does it make a difference if they are installed and run from the target system or should they be run and stored in the binary table?
Posted 06 June 2006 - 16:54
I finally found away around these console dialog boxes popping from the following link:
Creating Windows Forms - MSDN
Basically make a WinForm project and then hide the form from showing while running the program. Need to remember to manually exit the or you will be sitting there for 10 min like me trying to figure out why it’s taking so long to finish.
Creating Windows Forms - MSDN
Basically make a WinForm project and then hide the form from showing while running the program. Need to remember to manually exit the or you will be sitting there for 10 min like me trying to figure out why it’s taking so long to finish.

- 1 - Create a new WinForms project in C#/VB.NET and then add a new class to the project.
- 2 - Make sure the following code is in the class file or some derviation of this (C#):
CODE |
// C# // All methods must be contained in a class. // This class is added to the namespace containing the Form1 class. class MainApplication { public static int Main(string[] args) { // Instantiate a new instance of Form1. Form1 f1 = new Form1(); // Display a messagebox. This shows the application // is running, yet there is nothing shown to the user. // This is the point at which you customize your form. System.Windows.Forms.MessageBox.Show("The application is running now, but no forms have been shown."); // Customize the form. f1.Text = "Running Form"; //put code here // Show the instance of the form modally. f1.ShowDialog(); //Form1.Close(); Return 0; } } |
- 3 - Should be good to go now...
Hopefully this helps others who have been trying to solve this same problem like me!
Posted 07 June 2006 - 08:44
In general you can call an EXE directaly as a custom action, no need to wrap it with a VBScript.
Stefan Krüger
InstallSite.org twitter facebook