1 .TH WIMLIB-IMAGEX "1" "December 2013" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
3 @IMAGEX_PROGNAME@-update \- Update a WIM image
5 \fB@IMAGEX_PROGNAME@ update\fR \fIWIMFILE\fR [\fIIMAGE\fR] [\fIOPTION\fR...] [< \fICMDFILE\fR]
7 \fB@IMAGEX_PROGNAME@ update\fR modifies the specified \fIIMAGE\fR in the Windows
8 Imaging (WIM) file \fIWIMFILE\fR by adding, deleting, or renaming files or
10 This command is also available as simply \fBwimupdate\fR if the appropriate
11 hard link or batch file has been installed.
13 \fIIMAGE\fR specifies the image in \fIWIMFILE\fR to update. It may be a 1-based
14 index of an image in the WIM or the name of an image in the WIM. Use the
15 \fB@IMAGEX_PROGNAME@ info\fR (1) command to list the images a WIM file contains.
16 \fIIMAGE\fR may be omitted if \fIWIMFILE\fR contains only one image.
18 The modifications to perform on the WIM image are specified as a sequence of
19 commands, one per line, read in a text file from standard input. It is
20 recommended that standard input be redirected from a file (\fICMDFILE\fR), as
21 shown above, rather than typing in commands interactively. Alternatively, to
22 specify a command directly on the command line, see the \fB--command\fR option.
23 .SH AVAILABLE COMMANDS
24 This section documents the commands that may appear in the \fICMDFILE\fR
26 .SS \fBadd\fR [\fIOPTION\fR...] \fISOURCE\fR \fIDESTINATION\fR
27 Add a file or directory tree to the WIM image. \fISOURCE\fR must specify the
28 path to a file or directory on your filesystem. \fIDESTINATION\fR must specify
29 the path inside the WIM image at which to add the file or directory tree. If
30 \fIDESTINATION\fR already exists in the WIM image, then an overlay is attempted
31 if it is a directory; this feature can be used to add multiple files to an
32 existing directory in the WIM image in one command. If \fIDESTINATION\fR does
33 not exist in the WIM image, then any prerequisite directories are created as
34 needed to add the \fISOURCE\fR at that location.
36 The \fBadd\fR command supports a subset of the options accepted by
37 \fB@IMAGEX_PROGNAME@-capture\fR; namely, \fB--verbose\fR, \fB--dereference\fR,
38 \fB--unix-data\fR, \fB--no-acls\fR, and \fB--strict-acls\fR. See
39 \fB@IMAGEX_PROGNAME@-capture\fR (1) for explanations of these options.
40 .SS \fBdelete\fR [\fIOPTION\fR...] \fIPATH\fR
41 Delete a file or directory tree from the WIM image. \fIPATH\fR must specify the
42 path inside the WIM image of the file or directory tree to delete.
44 The available options for the \fBdelete\fR command are:
47 Do not issue an error if the path to delete does not exist.
50 Delete the file or directory tree recursively; if not specified, an error is
51 issued if the path to delete is a directory.
52 .SS \fBrename\fR \fIOLD_PATH\fR \fINEW_PATH\fR
53 Rename a file or directory tree inside the WIM image. \fIOLD_PATH\fR must
54 specify the old path of the file or directory tree inside the WIM image, and
55 \fINEW_PATH\fR must specify the new path for the file or directory tree. This
56 command follows the semantics of the POSIX \fBrename\fR (3) function; in
57 particular, a pre-existing file at \fINEW_PATH\fR will be deleted if present,
58 except in certain cases such as attempting to rename a directory to a
59 non-directory, which is not allowed.
61 There are no options available for the \fBrename\fR command.
63 The following options are accepted on the command line by \fB@IMAGEX_PROGNAME@
67 Use \fB--verbose\fR for all \fBadd\fR commands.
70 Use \fB--dereference\fR for all \fBadd\fR commands.
73 Use \fB--unix-data\fR for all \fBadd\fR commands.
76 Use \fB--no-acls\fR for all \fBadd\fR commands.
79 Use \fB--strict-acls\fR for all \fBadd\fR commands.
81 \fB--config\fR=\fIFILE\fR
82 Set the capture configuration file for all \fBadd\fR commands. See the
83 description of this option in \fB@IMAGEX_PROGNAME@-capture\fR (1).
86 Use \fB--force\fR for all \fBdelete\fR commands.
89 Use \fB--recursive\fR for all \fBdelete\fR commands.
92 When reading \fIWIMFILE\fR, verify its integrity if the integrity table is
93 present; in addition, include an integrity table in the updated WIM. If this
94 option is not specified, an integrity table will be included in the updated WIM
95 if and only if one was present before.
97 \fB--threads\fR=\fINUM_THREADS\fR
98 Number of threads to use for compressing newly added files. Default: autodetect
99 (number of processors).
102 Rebuild the entire WIM rather than appending the updated data to the end of it.
103 Rebuilding the WIM is slower, but will save a little bit of space that would
104 otherwise be left as a hole in the WIM. Also see
105 \fB@IMAGEX_PROGNAME@-optimize\fR (1).
107 \fB--command\fR=\fISTRING\fR
108 Instead of reading update commands from standard input, read a single update
109 command directly from the string \fISTRING\fR specified on the command line.
110 This option cannot be provided more than one time and cannot be used to specify
111 more than one update command. Note that the \fISTRING\fR, as well as any
112 paths containing spaces within the \fISTRING\fR must be appropriately quoted.
113 If running from cmd.exe on Windows, you should use double quotes for the outer
114 quotes and single quotes for the inner quotes. Example:
119 @IMAGEX_PROGNAME@ update boot.wim 1 \\
122 --command="add 'C:\\My Dir' '\\My Dir'"
128 \fB@IMAGEX_PROGNAME@ update\fR is partly redundant with \fB@IMAGEX_PROGNAME@
129 mountrw\fR, since if a WIM image can be mounted read-write, then there
130 theoretically is no need for \fB@IMAGEX_PROGNAME@ update\fR. The main advantage
131 of \fB@IMAGEX_PROGNAME@ update\fR is that it works on both UNIX-like systems and
132 Windows, whereas \fB@IMAGEX_PROGNAME@ mountrw\fR is only available on UNIX-like
133 systems, and even then it only works on those with a compatible FUSE
136 Symbolic links inside a WIM image are not dereferenced when being interpreted.
137 So, for example, if you have a WIM image that contains a symbolic link
138 "/Documents and Settings" -> "/Users" where "/Users" is a directory, then a
139 subdirectory named "Public" in this directory must be specified as
140 "/Users/Public" rather than "/Documents and Settings/Public".
142 All paths to files or directories within the WIM image must be specified
143 relative to the root of the image. However, the leading slash is optional, and
144 both forward slashes and backslashes are accepted. In addition, on Windows, the
145 paths are treated case-insensitively, while on UNIX-like systems, the paths are
146 treated case-sensitively.
148 The command file (\fICMDFILE\fR) is parsed by \fB@IMAGEX_PROGNAME@ update\fR
149 itself and not by the system shell. Therefore, its syntax is limited. However,
150 comment lines beginning with '#' are allowed, and it is also possible to quote
151 arguments with whitespace inside them.
153 On UNIX-like systems, you cannot use \fB@IMAGEX_PROGNAME@ update\fR to add files
154 to an image directly from a NTFS volume using libntfs-3g, even though
155 \fB@IMAGEX_PROGNAME@ capture\fR supports capturing a full image this way.
157 It is safe to abort an \fB@IMAGEX_PROGNAME@ update\fR command partway through;
158 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
159 optimize\fR to remove any data that was appended to the physical WIM file but
160 not yet incorporated into the structure of the WIM, unless \fB--rebuild\fR was
161 specified, in which case you should delete the temporary file left over.
163 All the examples below show the update command file to be created as well as the
164 \fB@IMAGEX_PROGNAME@ update\fR command to run to perform the updates.
166 Delete two files from a WIM image:
169 \fIupdate_commands.txt\fR:
174 delete /sources/setup.exe
180 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
183 Add some files and directories to a WIM image. Note that the first path of each
184 \fBadd\fR command specifies the files to add, while the second path of each
185 \fBadd\fR command specify the locations at which to to add them inside the WIM
189 \fIupdate_commands.txt\fR:
194 add somefile /dir/file
200 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
203 Rename a file inside a WIM image.
206 \fIupdate_commands.txt\fR:
210 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
216 $ @IMAGEX_PROGNAME@ update boot.wim 2 < update_commands.txt
219 Using additional features, such as comments, options, and overlays, and
220 including an integrity table in the updated WIM:
223 \fIupdate_commands.txt\fR:
228 # This file specifies some changes to make to a WIM image.
231 # Add a new directory containing files I want in the image.
232 # The quotes are necessary because the directory name
234 add "My Directory" "/My Directory"
236 # Add the contents of "Another Directory" to the
237 # "/My Directory" we just created in the WIM image. Since
238 # the destination path already exists, this performs an
240 add "Another Directory" "/My Directory"
242 # Rename some file for some reason.
243 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
245 # Delete an unwanted directory.
246 delete --recursive /Users/Me/Documents/Junk
252 $ @IMAGEX_PROGNAME@ update boot.wim 2 --check < update_commands.txt
256 .BR @IMAGEX_PROGNAME@ (1)
257 .BR @IMAGEX_PROGNAME@-capture (1)
258 .BR @IMAGEX_PROGNAME@-info (1)
259 .BR @IMAGEX_PROGNAME@-mountrw (1)
260 .BR @IMAGEX_PROGNAME@-optimize (1)