Monday, May 11, 2015

On extracting the contents of a .msi file

Twice now I had to get the contents of a .msi file. First it was because I needed some specific drivers for a SCCM-based network interface driver upgraded (I will talk about that one in a future post). The most recent time I was trying to do a manual install of the Avocent Dsview4 plugin hoping it would then work with my Firefox web browser. This last one will take even longer until I am ready to comment on here, so do not hold your breath.

It seems one way to do the deed is to use 7zip. I tried, and did not go very far and I got frustrated. I then decided instead to use something that is already in the system. And, if my previous posts are any indicator, you would have guessed it would be something command line. And you would be quite right:

msiexec /a C:\Users\raub\Downloads\AvctViewerPlugin.msi /qn targetdir=C:\Users\raub\Downloads\pickles
Where
  • /qn: Run quietly, no windows nor dialog boxes are shown.
  • targetdir: I think that is self-explanatory. It is where you want to extract the files to.
This will create a directory called "Temp Folder" inside pickles.
PS C:\Users\raub\Downloads\pickles> ls


    Directory: C:\Users\raub\Downloads\pickles


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          5/6/2015  12:34 PM            Temp Folder
-a---          5/6/2015  12:34 PM      40960 AvctViewerPlugin.msi


PS C:\Users\raub\Downloads\pickles>
which contains all the file extracted from the .msi file.

NOTES

This is really the most important part of this entire article. The command to extract it is not as important as its idiosyncrasies:
  1. .msi file should not be in targetdir
  2. Use full/absolute paths. If you do not believe me, try relative paths, specially with targetdir, and see what happens.
  3. Do not need to be admin/root to run the above command. Remember, you are not installing anything. Also, try to make a point to only become admin if you really need it.
  4. Yes, it put a copy of the original .msi file inside pickles.

References

No comments: