]> wimlib.net Git - wimlib/commitdiff
vss: note that it's only supported on Vista and later
authorEric Biggers <ebiggers3@gmail.com>
Sat, 2 Jan 2016 16:28:32 +0000 (10:28 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 2 Jan 2016 16:30:10 +0000 (10:30 -0600)
doc/man1/wimlib-imagex-capture.1
include/wimlib.h
src/win32_vss.c

index 05197006d0083fa069c02f75df67a09a138ef4f8..6198d52b1c6f06c171121d4f710149f4a5431d27 100644 (file)
@@ -579,13 +579,13 @@ See the documentation for this option in \fBwimlib-imagex-optimize\fR (1).
 .TP
 \fB--snapshot\fR
 EXPERIMENTAL: create a temporary filesystem snapshot of the source directory and
-capture the files from it.  Currently, this option is only supported on Windows,
-where it uses the Volume Shadow Copy Service (VSS).  Using this option, you can
-create a consistent backup of the system volume of a running Windows system
-without running into problems with locked files.  For the VSS snapshot to be
-successfully created, \fBwimlib-imagex\fR must be run as an Administrator, and
-it cannot be run in WoW64 mode (i.e. if Windows is 64-bit, then
-\fBwimlib-imagex\fR must be 64-bit as well).
+capture the files from it.  Currently, this option is only supported on Windows
+(Vista and later), where it uses the Volume Shadow Copy Service (VSS).  Using
+this option, you can create a consistent backup of the system volume of a
+running Windows system without running into problems with locked files.  For the
+VSS snapshot to be successfully created, \fBwimlib-imagex\fR must be run as an
+Administrator, and it cannot be run in WoW64 mode (i.e. if Windows is 64-bit,
+then \fBwimlib-imagex\fR must be 64-bit as well).
 .SH NOTES
 \fBwimlib-imagex append\fR does not support appending an image to a split WIM.
 .PP
index 2e5ba3c6fc2bb2d9a3a60ba43cb91793eb3cc209..f2e9f22940b2b5303cac1341dbc5fe007b325dc8 100644 (file)
@@ -1750,12 +1750,13 @@ typedef int (*wimlib_iterate_lookup_table_callback_t)(const struct wimlib_resour
 /**
  * EXPERIMENTAL, since wimlib v1.9.0: create a temporary filesystem snapshot of
  * the source directory and add the files from it.  Currently, this option is
- * only supported on Windows, where it uses the Volume Shadow Copy Service
- * (VSS).  Using this option, you can create a consistent backup of the system
- * volume of a running Windows system without running into problems with locked
- * files.  For the VSS snapshot to be successfully created, your application
- * must be run as an Administrator, and it cannot be run in WoW64 mode (i.e. if
- * Windows is 64-bit, then your application must be 64-bit as well).
+ * only supported on Windows (Vista and later), where it uses the Volume Shadow
+ * Copy Service (VSS).  Using this option, you can create a consistent backup of
+ * the system volume of a running Windows system without running into problems
+ * with locked files.  For the VSS snapshot to be successfully created, your
+ * application must be run as an Administrator, and it cannot be run in WoW64
+ * mode (i.e. if Windows is 64-bit, then your application must be 64-bit as
+ * well).
  */
 #define WIMLIB_ADD_FLAG_SNAPSHOT               0x00008000
 
index 914cd9127267a69b215ea0895b8f28e51b4ce82b..46af4bb14967235eb781ff7bd75fedebbc94ff84 100644 (file)
@@ -293,7 +293,7 @@ vss_global_init(void)
        if (vss_initialized)
                return true;
        ERROR("The Volume Shadow Copy Service (VSS) API could not be "
-             "initialized. Probably it isn't supported on this computer.");
+             "initialized.");
        return false;
 }
 
@@ -408,6 +408,12 @@ request_vss_snapshot(IVssBackupComponents *vss, wchar_t *volume,
        return true;
 }
 
+static bool
+is_pre_vista(void)
+{
+       return (GetVersion() & 0xFF) < 6;
+}
+
 static bool
 is_wow64(void)
 {
@@ -503,7 +509,10 @@ vss_create_snapshot(const wchar_t *source, UNICODE_STRING *vss_path_ret,
 
 vss_err:
        ret = WIMLIB_ERR_SNAPSHOT_FAILURE;
-       if (is_wow64()) {
+       if (is_pre_vista() && !vss_initialized) {
+               ERROR("Snapshot mode is only supported on Windows Vista "
+                     "and later!");
+       } else if (is_wow64()) {
                ERROR("64-bit Windows doesn't allow 32-bit applications to "
                      "create VSS snapshots.\n"
                      "        Run the 64-bit version of this application "