num_images = wimlib_get_num_images(w);
if (argc == 2 && num_images != 1) {
imagex_error(T("\"%"TS"\" contains %d images; Please select one "
- "(or all)"), wimfile, num_images);
+ "(or all)."), wimfile, num_images);
usage(APPLY);
ret = -1;
goto out;
* choose that one; otherwise, print an error. */
num_images = wimlib_get_num_images(w);
if (num_images != 1) {
- imagex_error(T("The file \"%"TS"\" contains %d images; Please "
+ imagex_error(T("\"%"TS"\" contains %d images; Please "
"select one."), wimfile, num_images);
usage(DIR);
ret = -1;
image = 1;
num_images = wimlib_get_num_images(w);
if (num_images != 1) {
- imagex_error(T("The file \"%"TS"\" contains %d images; Please "
+ imagex_error(T("\"%"TS"\" contains %d images; Please "
"select one."), wimfile, num_images);
usage((mount_flags & WIMLIB_MOUNT_FLAG_READWRITE)
? MOUNTRW : MOUNT);
size_t cmd_file_nchars;
struct wimlib_update_command *cmds;
size_t num_cmds;
+ int num_images;
const tchar *config_file = NULL;
tchar *config_str;
if (ret)
goto out_wimlib_free;
+ num_images = wimlib_get_num_images(wim);
+ if (argc == 1 && num_images != 1) {
+ imagex_error(T("\"%"TS"\" contains %d images; Please select one."),
+ wimfile, num_images);
+ usage(UPDATE);
+ ret = -1;
+ goto out_wimlib_free;
+ }
+
/* Parse capture configuration file if specified */
if (config_file) {
size_t config_len;
}
}
+#ifdef __WIN32__
+ win32_acquire_capture_privileges();
+#endif
+
/* Execute the update commands */
ret = wimlib_update_image(wim, image, cmds, num_cmds, update_flags,
imagex_progress_func);
if (ret)
- goto out_free_cmds;
+ goto out_release_privs;
/* Overwrite the updated WIM */
ret = wimlib_overwrite(wim, write_flags, num_threads,
imagex_progress_func);
+out_release_privs:
+#ifdef __WIN32__
+ win32_release_capture_privileges();
+#endif
out_free_cmds:
free(cmds);
out_free_cmd_file_contents: