activescott / lessmsi

A tool to view and extract the contents of an Windows Installer (.msi) file.
https://lessmsi.activescott.com
MIT License
1.29k stars 150 forks source link

allow unpack msi if some cab are missing #175

Open marakew opened 2 years ago

marakew commented 2 years ago
--- a/src/LessMsi.Core/Msi/Wixtracts.cs
+++ b/src/LessMsi.Core/Msi/Wixtracts.cs
@@ -504,7 +504,7 @@ namespace LessMsi.Msi
                                Path originalCabFile = Path.Combine(msi.Parent, cabSourceName);
                                 if (!originalCabFile.Exists)
                                 {
-                                    throw ExternalCabNotFoundException.CreateFromCabPath(cabSourceName, msi.Parent.FullPathString);
+                                    continue; //throw ExternalCabNotFoundException.CreateFromCabPath(cabSourceName, msi.Parent.FullPathString);
                                 }
                                FileSystem.Copy(originalCabFile, localCabFile);
                            }
activescott commented 2 years ago

Thanks @marakew! Would you be interested in submitting a pull request for this? I'm open to accepting this if we can make it optional. This is used as a shell script for many users and ignoring such failures may cause a problem for them. I could look into it and advise how to make it optional if that helps.

Or if you're looking for someone else to take it from here (😢😉) let us know and we can see if someone else with a similar need would pick it up...

marakew commented 2 years ago

too small changes for pull request iam patch for self and all works and just share my changes

activescott commented 2 years ago

Fair enough. Thanks for sharing!