I have to execute msi to some temp folder through C# code. For that I am executing msi by using
msiexec.exe /a "ITG Service Pack for Windows.msi" TARGETDIR="C:\folder\" /qn command. But in that case it is showing error message like:
unhandled Exception
error number 0x80040706
Object Reference not set
I have to suppress this error message. Please suggest me some way to solve this problem.
Following is code snippet.
private void ExtractMSI(string strMSIpath, string tempfolderPath)
{
try
{
//Create the instance of the ProcessManager class.
prStart = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo pStrtInfo = new ProcessStartInfo("msiexec.exe"," /a " + "\"" +
strMSIpath + "\"" + " TARGETDIR=\"" + tempfolderPath + "\" /qn");
// Set the window style to hidden
pStrtInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
//Assign the process to StartInfo
prStart.StartInfo = pStrtInfo;
prStart.Start();
}
catch(Exception objExp)
{
throw objExp;
}
}
}
While executing prStart.Start(); popup is coming for user response. I don’t want to show these kind of popups to user.
Or is there any other way to execute msi except msiexec.exe. My purpose is to extract all files from msi to any temp folder without showing any popup message.
Or is there any API or something to know whether a particular msi can execute without any error.
Thanks in advance
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.
Problem while extracting files from msi
Started by
krishna123
, Jan 19 2006 15:18
1 reply to this topic
Posted 19 January 2006 - 17:18
There is an extensive API, but I would say it's not for the faint-hearted. Check MSDN for details. Start here
MSDN Windows Installer
MSDN Windows Installer
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.