-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overwrite Extraction with Original Folder Structure #212
Open
mega5800
wants to merge
8
commits into
activescott:master
Choose a base branch
from
mega5800:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5139634
Added the ability to remove duplicate files using the xo parameter
mega5800 4de775f
Added test methods and expected results files for overwrite extractioโฆ
mega5800 66b4c88
Improved the logic for deleting duplicate files
mega5800 6cf6a27
Moved ExtractionMode file from CLI project to Core project
mega5800 3d688ae
updated extraction logic to match new duplicate files design
mega5800 b4bc8a1
Updated test files to match the new order of the new duplicate files โฆ
mega5800 84859b3
Amended the code according to Codecy comment about optional param
mega5800 4f75ad5
change default extraction name to "Default" instead of "None" for betโฆ
mega5800 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,10 @@ | |
// Scott Willeke ([email protected]) | ||
// | ||
#region Using directives | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using LessMsi.Msi; | ||
|
||
#endregion | ||
|
||
namespace LessMsi.Cli | ||
|
@@ -63,6 +61,7 @@ public static int Main(string[] args) | |
var subcommands = new Dictionary<string, LessMsiCommand> { | ||
{"o", new OpenGuiCommand()}, | ||
{"x", extractCommand}, | ||
{"xo", extractCommand}, | ||
{"xfo", extractCommand}, | ||
{"xfr", extractCommand}, | ||
{"/x", extractCommand}, | ||
|
@@ -107,7 +106,7 @@ public static int Main(string[] args) | |
/// <param name="msiFileName">The path of the specified MSI file.</param> | ||
/// <param name="outDirName">The directory to extract to. If empty it will use the current directory.</param> | ||
/// <param name="filesToExtract">The files to be extracted from the msi. If empty all files will be extracted.</param> | ||
/// /// <param name="extractionMode">Enum value for files extraction without folder structure</param> | ||
/// <param name="extractionMode">Enum value for files extraction without folder structure</param> | ||
public static void DoExtraction(string msiFileName, string outDirName, List<string> filesToExtract, ExtractionMode extractionMode) | ||
{ | ||
msiFileName = EnsureAbsolutePath(msiFileName); | ||
|
@@ -127,7 +126,7 @@ public static void DoExtraction(string msiFileName, string outDirName, List<stri | |
if (isExtractionModeFlat(extractionMode)) | ||
{ | ||
string tempOutDirName = $"{outDirName}{TempFolderSuffix}"; | ||
Wixtracts.ExtractFiles(msiFile, tempOutDirName, filesToExtract.ToArray(), PrintProgress); | ||
Wixtracts.ExtractFiles(msiFile, tempOutDirName, filesToExtract.ToArray(), PrintProgress, extractionMode); | ||
|
||
var fileNameCountingDict = new Dictionary<string, int>(); | ||
|
||
|
@@ -138,7 +137,7 @@ public static void DoExtraction(string msiFileName, string outDirName, List<stri | |
} | ||
else | ||
{ | ||
Wixtracts.ExtractFiles(msiFile, outDirName, filesToExtract.ToArray(), PrintProgress); | ||
Wixtracts.ExtractFiles(msiFile, outDirName, filesToExtract.ToArray(), PrintProgress, extractionMode); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
๏ปฟnamespace LessMsi.Cli | ||
๏ปฟnamespace LessMsi.Msi | ||
{ | ||
public enum ExtractionMode | ||
{ | ||
/// <summary> | ||
/// Default value indicating that no extraction should be performed. | ||
/// Default value indicating that a regular extraction should be performed. | ||
/// </summary> | ||
None, | ||
Default, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE: Changing this would be a breaking change to anyone using the library. I don't think that's a problem since this is the LessMsi.Cli library and to my knowledge only people depend on the Lessmsi.Core library. I am okay making this change, just want to point it out. |
||
/// <summary> | ||
/// Value indicating that a file extraction preserving directories should be performed. | ||
/// </summary> | ||
|
@@ -17,6 +17,11 @@ public enum ExtractionMode | |
/// <summary> | ||
/// Value indicating that a file extraction overwriting identical files should be performed. | ||
/// </summary> | ||
OverwriteFlatExtraction | ||
OverwriteFlatExtraction, | ||
/// <summary> | ||
/// Value indicating that a file extraction overwriting identical files should be performed. | ||
/// While preserving the directories structures | ||
/// </summary> | ||
OverwriteExtraction | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see mega5800#1 for a simplification here.