]> wimlib.net Git - wimlib/blob - doc/man1/wimlib-imagex-update.1
win32_apply.c: fix extraction of empty reparse points
[wimlib] / doc / man1 / wimlib-imagex-update.1
1 .TH WIMLIB-IMAGEX "1" "May 2015" "wimlib 1.8.1" "User Commands"
2 .SH NAME
3 wimlib-imagex-update \- Update a WIM image
4 .SH SYNOPSIS
5 \fBwimlib-imagex update\fR \fIWIMFILE\fR [\fIIMAGE\fR] [\fIOPTION\fR...] [< \fICMDFILE\fR]
6 .SH DESCRIPTION
7 \fBwimlib-imagex update\fR modifies the specified \fIIMAGE\fR in the Windows
8 Imaging (WIM) file \fIWIMFILE\fR by adding, deleting, or renaming files or
9 directories in it.
10 This command is also available as simply \fBwimupdate\fR if the appropriate
11 hard link or batch file has been installed.
12 .PP
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 \fBwimlib-imagex 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.
17 .PP
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
25 described above.
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.
30 .PP
31 If \fIDESTINATION\fR names an existing directory in the WIM image, then
32 \fISOURCE\fR must also name a directory.  This causes the contents of the
33 \fISOURCE\fR directory to be added to the \fIDESTINATION\fR directory.
34 .PP
35 If \fIDESTINATION\fR names an existing nondirectory file in the WIM image, then
36 \fISOURCE\fR must also name a nondirectory file.  By default, this causes the
37 \fIDESTINATION\fR file to be replaced with the \fISOURCE\fR file.  Or, with
38 \fB--no-replace\fR specified, this generates an error.
39 .PP
40 If \fIDESTINATION\fR does not exist in the WIM image, then any prerequisite
41 directories are created as needed to add the \fISOURCE\fR at that location.
42 .PP
43 The \fBadd\fR command supports a subset of the options accepted by
44 \fBwimlib-imagex capture\fR; namely, \fB--dereference\fR,
45 \fB--unix-data\fR, \fB--no-acls\fR, and \fB--strict-acls\fR.  See
46 \fBwimlib-imagex-capture\fR (1) for explanations of these options.
47 .PP
48 In addition, the \fBadd\fR command supports the \fB--no-replace\fR option, which
49 causes the \fBadd\fR command to refuse to overwrite existing nondirectory files
50 in the WIM image.
51 .SS \fBdelete\fR [\fIOPTION\fR...] \fIPATH\fR
52 Delete a file or directory tree from the WIM image.  \fIPATH\fR must specify the
53 path inside the WIM image of the file or directory tree to delete.
54 .PP
55 The available options for the \fBdelete\fR command are:
56 .TP 6
57 \fB--force\fR
58 Do not issue an error if the path to delete does not exist.
59 .TP
60 \fB--recursive\fR
61 Delete the file or directory tree recursively; if not specified, an error is
62 issued if the path to delete is a directory.
63 .SS \fBrename\fR \fIOLD_PATH\fR \fINEW_PATH\fR
64 Rename a file or directory tree inside the WIM image.  \fIOLD_PATH\fR must
65 specify the old path of the file or directory tree inside the WIM image, and
66 \fINEW_PATH\fR must specify the new path for the file or directory tree.  This
67 command follows the semantics of the POSIX \fBrename\fR (3) function; in
68 particular, a pre-existing file at \fINEW_PATH\fR will be deleted if present,
69 except in certain cases such as attempting to rename a directory to a
70 non-directory, which is not allowed.
71 .PP
72 There are no options available for the \fBrename\fR command.
73 .SH OPTIONS
74 The following options are accepted on the command line by \fBwimlib-imagex
75 update\fR itself:
76 .TP 6
77 \fB--dereference\fR
78 Use \fB--dereference\fR for all \fBadd\fR commands.
79 .TP
80 \fB--unix-data\fR
81 Use \fB--unix-data\fR for all \fBadd\fR commands.
82 .TP
83 \fB--no-acls\fR
84 Use \fB--no-acls\fR for all \fBadd\fR commands.
85 .TP
86 \fB--strict-acls\fR
87 Use \fB--strict-acls\fR for all \fBadd\fR commands.
88 .TP
89 \fB--no-replace\fR
90 Use \fB--no-replace\fR for all \fBadd\fR commands.
91 .TP
92 \fB--config\fR=\fIFILE\fR
93 Set the capture configuration file for all \fBadd\fR commands.  See the
94 description of this option in \fBwimlib-imagex-capture\fR (1).
95 .TP
96 \fB--force\fR
97 Use \fB--force\fR for all \fBdelete\fR commands.
98 .TP
99 \fB--recursive\fR
100 Use \fB--recursive\fR for all \fBdelete\fR commands.
101 .TP
102 \fB--check\fR
103 When reading \fIWIMFILE\fR, verify its integrity if the integrity table is
104 present; in addition, include an integrity table in the updated WIM.  If this
105 option is not specified, an integrity table will be included in the updated WIM
106 if and only if one was present before.
107 .TP
108 \fB--threads\fR=\fINUM_THREADS\fR
109 Number of threads to use for compressing newly added files.  Default: autodetect
110 (number of processors).
111 .TP
112 \fB--rebuild\fR
113 Rebuild the entire WIM rather than appending the updated data to the end of it.
114 Rebuilding the WIM is slower, but will save a little bit of space that would
115 otherwise be left as a hole in the WIM file.
116 .IP
117 See \fBwimlib-imagex-optimize\fR (1) for a more customizable way of
118 rebuilding (and optionally recompressing) a WIM file.  If running
119 \fBwimlib-imagex optimize\fR after \fBwimlib-imagex update\fR, there is
120 no need to specify \fB--rebuild\fR to \fBwimlib-imagex update\fR.
121 .TP
122 \fB--command\fR=\fISTRING\fR
123 Instead of reading update commands from standard input, read a single update
124 command directly from the string \fISTRING\fR specified on the command line.
125 This option cannot be provided more than one time and cannot be used to specify
126 more than one update command.  Note that the \fISTRING\fR, as well as any
127 paths containing spaces within the \fISTRING\fR must be appropriately quoted.
128 If running from cmd.exe on Windows, you should use double quotes for the outer
129 quotes and single quotes for the inner quotes.  Example:
130 .RS
131 .RS
132 .PP
133 .nf
134 wimlib-imagex update boot.wim 1 \\
135 .br
136 .RS
137 --command="add 'C:\\My Dir' '\\My Dir'"
138 .RE
139 .RE
140 .RE
141 .fi
142 .IP
143 This option is provided for convenience only.  Do not execute
144 \fBwimlib-imagex update\fR multiple consecutive times, each time passing the
145 \fB--command\fR option!  This is inefficient.  Instead, generate an update
146 command file and provide it (on standard input) to a single invocation of
147 \fBwimlib-imagex update\fR, as explained in this document.
148 .TP
149 \fB--wimboot-config\fR=\fIFILE\fR
150 If this option is specified, no commands shall be read from standard input, and
151 instead the following command shall be executed:
152 .IP
153 .nf
154 .RS
155 .RS
156 \fBadd\fR \fIFILE\fR /Windows/System32/WimBootCompress.ini
157 .RE
158 .RE
159 .fi
160 .IP
161 This sets \fIFILE\fR as the WIMBoot configuration file for the image.  The
162 [PrepopulateList] section of this file specifies path globs that shall not be
163 extracted as WIMBoot pointer files (perhaps due to being needed early in the
164 boot process).  See the documentation for the \fB--wimboot\fR option of
165 \fBwimlib-imagex apply\fR (1) for more information.
166 .SH NOTES
167 \fBwimlib-imagex update\fR is partly redundant with \fBwimlib-imagex
168 mountrw\fR, since if a WIM image can be mounted read-write, then there
169 theoretically is no need for \fBwimlib-imagex update\fR.  The main advantage
170 of \fBwimlib-imagex update\fR is that it works on both UNIX-like systems and
171 Windows, whereas \fBwimlib-imagex mountrw\fR is only available on UNIX-like
172 systems, and even then it only works on those with a compatible FUSE
173 implementation.
174 .PP
175 Symbolic links inside a WIM image are not dereferenced when being interpreted.
176 So, for example, if you have a WIM image that contains a symbolic link
177 "/Documents and Settings" -> "/Users" where "/Users" is a directory, then a
178 subdirectory named "Public" in this directory must be specified as
179 "/Users/Public" rather than "/Documents and Settings/Public".
180 .PP
181 All paths to files or directories within the WIM image must be specified
182 relative to the root of the image.  However, the leading slash is optional, and
183 both forward slashes and backslashes are accepted.  In addition, on Windows, the
184 paths are by default treated case-insensitively, while on UNIX-like systems, the
185 paths are by default treated case-sensitively.  The default case sensitivity may
186 be changed by setting the \fBWIMLIB_IMAGEX_IGNORE_CASE\fR environmental
187 variable to 0 or 1.
188 .PP
189 The command file (\fICMDFILE\fR) is parsed by \fBwimlib-imagex update\fR
190 itself and not by the system shell.  Therefore, its syntax is limited.  However,
191 comment lines beginning with '#' are allowed, and it is also possible to quote
192 arguments with whitespace inside them.
193 .PP
194 On UNIX-like systems, you cannot use \fBwimlib-imagex update\fR to add files
195 to an image directly from an NTFS volume using libntfs-3g, even though
196 \fBwimlib-imagex capture\fR supports capturing a full image this way.
197 .PP
198 It is safe to abort an \fBwimlib-imagex update\fR command partway through;
199 however, after doing this, it is recommended to run \fBwimlib-imagex
200 optimize\fR to remove any data that was appended to the physical WIM file but
201 not yet incorporated into the structure of the WIM, unless \fB--rebuild\fR was
202 specified, in which case you should delete the temporary file left over.
203 .SH EXAMPLES
204 All the examples below show the update command file to be created as well as the
205 \fBwimlib-imagex update\fR command to run to perform the updates.
206 .PP
207 Delete two files from a WIM image:
208 .PP
209 .RS
210 \fIupdate_commands.txt\fR:
211 .RS
212 .PP
213 .nf
214 delete /setup.exe
215 delete /sources/setup.exe
216 .fi
217 .RE
218 .RE
219 .PP
220 .RS
221 $ wimlib-imagex update boot.wim 2 < update_commands.txt
222 .RE
223 .PP
224 Add some files and directories to a WIM image.  Note that the first path of each
225 \fBadd\fR command specifies the files to add, while the second path of each
226 \fBadd\fR command specify the locations at which to to add them inside the WIM
227 image:
228 .PP
229 .RS
230 \fIupdate_commands.txt\fR:
231 .RS
232 .PP
233 .nf
234 add somedir     /dir
235 add somefile    /dir/file
236 .fi
237 .RE
238 .RE
239 .PP
240 .RS
241 $ wimlib-imagex update boot.wim 2 < update_commands.txt
242 .RE
243 .PP
244 Rename a file inside a WIM image.
245 .PP
246 .RS
247 \fIupdate_commands.txt\fR:
248 .RS
249 .PP
250 .nf
251 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
252 .fi
253 .RE
254 .RE
255 .PP
256 .RS
257 $ wimlib-imagex update boot.wim 2 < update_commands.txt
258 .RE
259 .PP
260 Using additional features, such as comments, options, and overlays, and
261 including an integrity table in the updated WIM:
262 .PP
263 .RS
264 \fIupdate_commands.txt\fR:
265 .RS
266 .PP
267 .nf
268 #
269 # This file specifies some changes to make to a WIM image.
270 #
271
272 # Add a new directory containing files I want in the image.
273 # The quotes are necessary because the directory name
274 # contains a space.
275 add "My Directory" "/My Directory"
276
277 # Add the contents of "Another Directory" to the
278 # "/My Directory" we just created in the WIM image.  Since
279 # the destination path already exists, this performs an
280 # overlay.
281 add "Another Directory" "/My Directory"
282
283 # Rename some file for some reason.
284 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
285
286 # Delete an unwanted directory.
287 delete --recursive /Users/Me/Documents/Junk
288 .fi
289 .RE
290 .RE
291 .PP
292 .RS
293 $ wimlib-imagex update boot.wim 2 --check < update_commands.txt
294 .RE
295 .PP
296 .SH SEE ALSO
297 .BR wimlib-imagex (1)
298 .BR wimlib-imagex-capture (1)
299 .BR wimlib-imagex-info (1)
300 .BR wimlib-imagex-mountrw (1)
301 .BR wimlib-imagex-optimize (1)