]> wimlib.net Git - wimlib/commitdiff
Remove unused files from programs/
authorEric Biggers <ebiggers3@gmail.com>
Sun, 8 Dec 2013 06:52:32 +0000 (00:52 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 8 Dec 2013 06:52:32 +0000 (00:52 -0600)
wimapply.c was redundant with examples/applywim.c and was prone to be
confused with the 'wimapply' alias for 'wimlib-imagex apply'.

install.cmd was just an example script for a specific usage that wasn't
explained anywhere.

programs/install.cmd [deleted file]
programs/wimapply.c [deleted file]

diff --git a/programs/install.cmd b/programs/install.cmd
deleted file mode 100644 (file)
index 79431cb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-wpeinit\r
-net use j: \\server\windows7\r
-j:\setup.exe /unattend:j:\autounattend.xml\r
-\r
-@ECHO OFF\r
-\r
-echo \r
-echo Unable to start setup.exe from remote server!  Try typing \r
-echo `ipconfig' to see if we have been assigned an IP address.  \r
-echo If not, this computer probably needs a network driver \r
-echo that is not present in the Windows PE image.  \r
-echo Or the connection to the server might be broken.\r
-echo \r
-\r
-pause\r
-\r
-cmd.exe\r
diff --git a/programs/wimapply.c b/programs/wimapply.c
deleted file mode 100644 (file)
index cd7edde..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * wimapply.c
- *
- * This is a "minimal" program to apply an image from a stand-alone WIM file.
- * It's intended to be statically linked to the WIM library to create a small
- * executable containing only the functions needed to apply a WIM file.
- *
- * This is not installed by default since the 'apply' subcommand of 'imagex'
- * covers all this functionality and more.
- *
- * Compile with something like:
- *     $ cd wimlib-1.2.0
- *     $ ./configure --without-fuse --disable-error-messages \
- *       --disable-assertions --disable-custom-memory-allocator
- *     $ cd programs
- *     $ gcc -O2 -fwhole-program -flto -s wimapply.c -o wimapply \
- *       ../src/*.c -I/usr/include/libxml2 -I.. -D_FILE_OFFSET_BITS=64 \
- *       -D_GNU_SOURCE -std=gnu99 -lxml2 -lcrypto -lpthread -lntfs-3g
- *     $ stat -c %s wimapply
- *     48880
- *
- * Compare this to:
- *     $ stat -c %s /usr/lib/libwim.so.1.0.0
- *     196720
- *     $ stat -c %s /usr/bin/imagex
- *     35384
- *
- * Use with:
- *     $ wimapply install.wim 5 /dev/sda2
- */
-
-#include "wimlib.h"
-#include <stdio.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-int main(int argc, char **argv)
-{
-       const char *wimfile;
-       const char *image_num;
-       const char *target;
-       int image;
-       int ret;
-       WIMStruct *w;
-       struct stat stbuf;
-       int extract_flags = WIMLIB_EXTRACT_FLAG_SEQUENTIAL;
-
-       if (argc != 4) {
-               fprintf(stderr, "Usage: wimapply WIMFILE IMAGE_NUM TARGET\n");
-               return 2;
-       }
-
-       wimfile = argv[1];
-       image_num = argv[2];
-       target = argv[3];
-
-       image = atoi(image_num);
-
-       ret = stat(target, &stbuf);
-       if (ret != 0) {
-               fprintf(stderr, "Cannot stat `%s': %s\n",
-                       target, strerror(errno));
-               return -1;
-       }
-
-       if (!S_ISDIR(stbuf.st_mode))
-               extract_flags |= WIMLIB_EXTRACT_FLAG_NTFS;
-
-       ret = wimlib_open_wim(wimfile, 0, &w, NULL);
-       if (ret != 0) {
-               fprintf(stderr, "Failed to open `%s'!\n", wimfile);
-               fprintf(stderr, "Error code: %s\n", wimlib_get_error_string(ret));
-               return ret;
-       }
-
-       ret = wimlib_extract_image(w, image, target, extract_flags, NULL);
-       if (ret != 0) {
-               fputs("Failed to apply WIM image\n", stderr);
-               fprintf(stderr, "Error code: %s\n", wimlib_get_error_string(ret));
-       }
-
-       /* Not calling wimlib_free() because the process is ending anyway. */
-
-       return ret;
-}