Skip to content

Commit 333577c

Browse files
Fix: Fixed issue where 7z archive files could not be previewed or compressed (#17426)
Co-authored-by: Yair <[email protected]>
1 parent 1fabfae commit 333577c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Files.App/Data/Models/CompressArchiveModel.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ public async Task<bool> RunCreationAsync()
158158
};
159159

160160
compressor.CustomParameters.Add("mt", CPUThreads.ToString());
161-
//Use UTF-8 encoding.
162-
//References: 7-zip chm --> Command Line Version --> Switches
163-
//--> -m --> cu=[off | on].
164-
compressor.CustomParameters.Add("cu", "on");
161+
// Use UTF-8 encoding.
162+
// References: 7-zip chm --> Command Line Version --> Switches
163+
// --> -m --> cu=[off | on].
164+
// Don't add "cu" parameter for 7zip files, see https://github.com/files-community/Files/issues/17257
165+
if (FileFormat != ArchiveFormats.SevenZip)
166+
compressor.CustomParameters.Add("cu", "on");
165167

166168
compressor.Compressing += Compressor_Compressing;
167169
compressor.FileCompressionStarted += Compressor_FileCompressionStarted;

0 commit comments

Comments
 (0)