File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -323,13 +323,40 @@ private void SetCompressionProperties()
323323 values . Add ( pv ) ;
324324 foreach ( var pair in CustomParameters )
325325 {
326- names . Add ( Marshal . StringToBSTR ( pair . Key ) ) ;
326+ if ( pair . Key == "mt" )
327+ {
328+ if ( _compressionMethod == CompressionMethod . Lzma2 ||
329+ _compressionMethod == CompressionMethod . Lzma ||
330+ _compressionMethod == CompressionMethod . BZip2 )
331+ {
332+ names . Add ( Marshal . StringToBSTR ( pair . Key ) ) ;
333+ }
334+ }
335+ else
336+ names . Add ( Marshal . StringToBSTR ( pair . Key ) ) ;
337+
327338 pv = new PropVariant ( ) ;
339+
328340 if ( pair . Key == "fb" || pair . Key == "pass" || pair . Key == "d" )
329341 {
330342 pv . VarType = VarEnum . VT_UI4 ;
331343 pv . UInt32Value = Convert . ToUInt32 ( pair . Value , CultureInfo . InvariantCulture ) ;
332344 }
345+ else if ( pair . Key == "mt" && ( _compressionMethod == CompressionMethod . Lzma2 ||
346+ _compressionMethod == CompressionMethod . Lzma ||
347+ _compressionMethod == CompressionMethod . BZip2 ) )
348+ {
349+ if ( pair . Value == "on" || pair . Value == "off" )
350+ {
351+ pv . VarType = VarEnum . VT_BSTR ;
352+ pv . Value = Marshal . StringToBSTR ( pair . Value ) ;
353+ }
354+ else
355+ {
356+ pv . VarType = VarEnum . VT_UI4 ;
357+ pv . UInt32Value = Convert . ToUInt32 ( pair . Value , CultureInfo . InvariantCulture ) ;
358+ }
359+ }
333360 else
334361 {
335362 pv . VarType = VarEnum . VT_BSTR ;
You can’t perform that action at this time.
0 commit comments