]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
wimcapture, wimexport: With --pack-streams, default to LZMS compression
[wimlib] / programs / imagex.c
index 32f24c3884b451147509d36722b3a302ed0e8847..fc2dd45ce48e3dcb9c644f200dc40587ce353c5f 100644 (file)
@@ -479,7 +479,9 @@ verify_image_exists_and_is_single(int image, const tchar *image_name,
 static int
 get_compression_type(const tchar *optarg)
 {
-       if (!tstrcasecmp(optarg, T("maximum")) || !tstrcasecmp(optarg, T("lzx")))
+       if (!tstrcasecmp(optarg, T("maximum")) ||
+           !tstrcasecmp(optarg, T("lzx")) ||
+           !tstrcasecmp(optarg, T("max")))
                return WIMLIB_COMPRESSION_TYPE_LZX;
        else if (!tstrcasecmp(optarg, T("fast")) || !tstrcasecmp(optarg, T("xpress")))
                return WIMLIB_COMPRESSION_TYPE_XPRESS;
@@ -1208,6 +1210,10 @@ imagex_progress_func(enum wimlib_progress_msg msg,
                imagex_printf(T("Updating \"%"TS"\" in WIM image\n"),
                              info->replace.path_in_wim);
                break;
+       case WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE:
+               imagex_printf(T("\nExtracting \"%"TS"\" as normal file (not WIMBoot pointer)\n"),
+                             info->wimboot_exclude.path_in_wim);
+               break;
        default:
                break;
        }
@@ -1816,9 +1822,19 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
 
 
        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID) {
+               /* No compression type specified.  Use the default.  */
+
                if (add_image_flags & WIMLIB_ADD_IMAGE_FLAG_WIMBOOT) {
+                       /* With --wimboot, default to XPRESS compression.  */
                        compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS;
+               } else if (write_flags & WIMLIB_WRITE_FLAG_PACK_STREAMS) {
+                       /* With --pack-streams or --solid, default to LZMS
+                        * compression.  (However, this will not affect packed
+                        * resources!)  */
+                       compression_type = WIMLIB_COMPRESSION_TYPE_LZMS;
                } else {
+                       /* Otherwise, default to LZX compression in fast mode.
+                        */
                        compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
                        if (!compress_slow && pack_ctype != WIMLIB_COMPRESSION_TYPE_LZX) {
                                struct wimlib_lzx_compressor_params params = {
@@ -2710,9 +2726,13 @@ imagex_export(int argc, tchar **argv, int cmd)
 
                if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID) {
                        /* The user did not specify a compression type; default
-                        * to that of the source WIM.  */
+                        * to that of the source WIM, unless --pack-streams or
+                        * --solid was specified.   */
 
-                       compression_type = src_info.compression_type;
+                       if (write_flags & WIMLIB_WRITE_FLAG_PACK_STREAMS)
+                               compression_type = WIMLIB_COMPRESSION_TYPE_LZMS;
+                       else
+                               compression_type = src_info.compression_type;
                }
                ret = wimlib_create_new_wim(compression_type, &dest_wim);
                if (ret)