24 September, 2010
0 Comments
1 category
If you want to extract the contents of a msi package to filesystem, you can use the following C# function:
public void ExtractMsiPackage() { string parameters = string.Empty; parameters = string.Format(@"/a {0} /qb TARGETDIR=""{1}"" REINSTALLMODE=amus",
"C:\Temp\Test.msi", "C:\Temp\Extract"); Process process = Process.Start("msiexec", parameters); process.WaitForExit(); }
/a = Administrative mode
/qb = Minimal UI, UI will only display progressbar
TARGETDIR = Folder to extract the contents to
REINSTALLMODE = amus, will overwrite all existing files and registry settings
Tags: C#Setup Packages
Category: Uncategorized
This will fail is called in another MSI with a “Another program is being installed.” error. 🙁