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