]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
tools/windeps: update Windows dependencies Makefile
[wimlib] / programs / imagex.c
index fdd35c8072b089b19b6793da3d16a78ad60a3cb0..4abcbac2a9e7ce353d92b56350c0754fbe8e10fa 100644 (file)
@@ -149,7 +149,6 @@ enum {
        IMAGEX_COMMIT_OPTION,
        IMAGEX_COMPACT_OPTION,
        IMAGEX_COMPRESS_OPTION,
-       IMAGEX_COMPRESS_SLOW_OPTION,
        IMAGEX_CONFIG_OPTION,
        IMAGEX_DEBUG_OPTION,
        IMAGEX_DELTA_FROM_OPTION,
@@ -226,7 +225,6 @@ static const struct option capture_or_append_options[] = {
        {T("no-check"),    no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("nocheck"),     no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("compress"),    required_argument, NULL, IMAGEX_COMPRESS_OPTION},
-       {T("compress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("chunk-size"),  required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
        {T("solid"),       no_argument,      NULL, IMAGEX_SOLID_OPTION},
        {T("solid-compress"),required_argument, NULL, IMAGEX_SOLID_COMPRESS_OPTION},
@@ -278,7 +276,6 @@ static const struct option export_options[] = {
        {T("no-check"),    no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("compress"),    required_argument, NULL, IMAGEX_COMPRESS_OPTION},
        {T("recompress"),  no_argument,       NULL, IMAGEX_RECOMPRESS_OPTION},
-       {T("compress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("chunk-size"),  required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
        {T("solid"),       no_argument,       NULL, IMAGEX_SOLID_OPTION},
        {T("solid-compress"),required_argument, NULL, IMAGEX_SOLID_COMPRESS_OPTION},
@@ -324,7 +321,6 @@ static const struct option info_options[] = {
        {T("header"),       no_argument,       NULL, IMAGEX_HEADER_OPTION},
        {T("lookup-table"), no_argument,       NULL, IMAGEX_BLOBS_OPTION},
        {T("blobs"),        no_argument,       NULL, IMAGEX_BLOBS_OPTION},
-       {T("metadata"),     no_argument,       NULL, IMAGEX_METADATA_OPTION},
        {T("xml"),          no_argument,       NULL, IMAGEX_XML_OPTION},
        {T("image-property"), required_argument, NULL, IMAGEX_IMAGE_PROPERTY_OPTION},
        {NULL, 0, NULL, 0},
@@ -352,8 +348,6 @@ static const struct option optimize_options[] = {
        {T("no-check"),    no_argument,       NULL, IMAGEX_NOCHECK_OPTION},
        {T("compress"),    required_argument, NULL, IMAGEX_COMPRESS_OPTION},
        {T("recompress"),  no_argument,       NULL, IMAGEX_RECOMPRESS_OPTION},
-       {T("compress-slow"), no_argument,     NULL, IMAGEX_COMPRESS_SLOW_OPTION},
-       {T("recompress-slow"), no_argument,   NULL, IMAGEX_COMPRESS_SLOW_OPTION},
        {T("chunk-size"),  required_argument, NULL, IMAGEX_CHUNK_SIZE_OPTION},
        {T("solid"),       no_argument,       NULL, IMAGEX_SOLID_OPTION},
        {T("solid-compress"),required_argument, NULL, IMAGEX_SOLID_COMPRESS_OPTION},
@@ -592,16 +586,6 @@ set_compact_mode(const tchar *arg, int *extract_flags)
 }
 
 
-static void
-set_compress_slow(void)
-{
-#if 0
-       fprintf(stderr, "WARNING: the '--compress-slow' option is deprecated.\n"
-                       "         Use the '--compress=TYPE:LEVEL' option instead.\n");
-#endif
-       wimlib_set_default_compression_level(-1, 100);
-}
-
 struct string_set {
        tchar **strings;
        unsigned num_strings;
@@ -1848,7 +1832,8 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
        int open_flags = 0;
        int add_flags = WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE |
                        WIMLIB_ADD_FLAG_WINCONFIG |
-                       WIMLIB_ADD_FLAG_VERBOSE;
+                       WIMLIB_ADD_FLAG_VERBOSE |
+                       WIMLIB_ADD_FLAG_FILE_PATHS_UNNEEDED;
        int write_flags = 0;
        int compression_type = WIMLIB_COMPRESSION_TYPE_INVALID;
        uint32_t chunk_size = UINT32_MAX;
@@ -1905,9 +1890,6 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
                        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID)
                                goto out_err;
                        break;
-               case IMAGEX_COMPRESS_SLOW_OPTION:
-                       set_compress_slow();
-                       break;
                case IMAGEX_CHUNK_SIZE_OPTION:
                        chunk_size = parse_chunk_size(optarg);
                        if (chunk_size == UINT32_MAX)
@@ -2646,6 +2628,7 @@ print_blobs(WIMStruct *wim)
        wimlib_iterate_lookup_table(wim, 0, print_resource, NULL);
 }
 
+#ifndef __WIN32__
 static void
 default_print_security_descriptor(const uint8_t *sd, size_t size)
 {
@@ -2653,6 +2636,7 @@ default_print_security_descriptor(const uint8_t *sd, size_t size)
        print_byte_field(sd, size);
        tputchar(T('\n'));
 }
+#endif
 
 static void
 print_dentry_detailed(const struct wimlib_dir_entry *dentry)
@@ -2867,10 +2851,6 @@ imagex_export(int argc, tchar **argv, int cmd)
                        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID)
                                goto out_err;
                        break;
-               case IMAGEX_COMPRESS_SLOW_OPTION:
-                       set_compress_slow();
-                       write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
-                       break;
                case IMAGEX_RECOMPRESS_OPTION:
                        write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
                        break;
@@ -3361,10 +3341,6 @@ imagex_info(int argc, tchar **argv, int cmd)
                        xml_out_file = optarg;
                        short_header = false;
                        break;
-               case IMAGEX_METADATA_OPTION:
-                       imagex_error(T("The --metadata option has been removed. "
-                                      "Use 'wimdir --detail' instead."));
-                       goto out_err;
                case IMAGEX_IMAGE_PROPERTY_OPTION:
                        ret = append_image_property_argument(&image_properties);
                        if (ret)
@@ -3781,10 +3757,6 @@ imagex_optimize(int argc, tchar **argv, int cmd)
                        if (compression_type == WIMLIB_COMPRESSION_TYPE_INVALID)
                                goto out_err;
                        break;
-               case IMAGEX_COMPRESS_SLOW_OPTION:
-                       set_compress_slow();
-                       write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
-                       break;
                case IMAGEX_RECOMPRESS_OPTION:
                        write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS;
                        break;
@@ -4601,16 +4573,17 @@ usage_all(FILE *fp)
        recommend_man_page(CMD_NONE, fp);
 }
 
+#ifdef __WIN32__
+extern int wmain(int argc, wchar_t **argv);
+#define main wmain
+#endif
+
 /* Entry point for wimlib's ImageX implementation.  On UNIX the command
  * arguments will just be 'char' strings (ideally UTF-8 encoded, but could be
  * something else), while on Windows the command arguments will be UTF-16LE
  * encoded 'wchar_t' strings. */
 int
-#ifdef __WIN32__
-wmain(int argc, wchar_t **argv, wchar_t **envp)
-#else
-main(int argc, char **argv)
-#endif
+main(int argc, tchar **argv)
 {
        int ret;
        int init_flags = 0;