Click here to Skip to main content
15,891,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I will be writing a C# program will install a third party .msi file from within the C# program I'm writing. I'm needing some help with monitoring the status of the installation of the third party .msi file.
Posted
Updated 3-Jan-11 8:00am
v2
Comments
JOAT-MON 3-Jan-11 12:37pm    
In addition to the questions raised by Henry Minute:
1. Are you calling the .msi from a C# program?
2. If this is a third party .msi, have you checked to see if there are command line parameters that can be passed to set those values for you?

Normally any necessary registry entries are done by the Windows Installer based on information in the .msi file.

[Edit]
After your comment:
I think it would assist others to help you if you edited your original question to make it clear if it is a third-party .msi file or one of your own. Also what is the C# program you are referring to? Do you mean that you want to write a program to check on the progress of the .msi?
[/Edit]
 
Share this answer
 
v2
Comments
thawes970 3-Jan-11 12:02pm    
I know there are some specific auto login settings that need to be changed prior to reboot that I want to make. The problem is that the entries aren't in the registry until the software is installed.
In this case you could do the following:
1. Create a System.Diagnostic.Process and set it to the file path of the msi you are going to execute.
2. Create a while loop that checks the Process.HasExited property to see if the installation is complete
3. Modify your registry entries once the HasExited == true

C#
System.Diagnostics.Process msi_installer = System.Diagnostics.Process.Start ( @"C:\path\filename.msi" );

       while ( !msi_installer.HasExited )
       {
           Application.DoEvents (); // prevent your appfrom freezing while it waits
           System.Threading.Thread.Sleep ( 300 ); // wait 300 milliseconds before checking again
       }

       // add code to modify registry entries here
 
Share this answer
 
v2
Comments
thawes970 4-Jan-11 10:21am    
Thank you for your help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900