1WIMUPDATE(1) User Commands WIMUPDATE(1)
2
3
4
6 wimupdate - Update a WIM image
7
9 wimupdate WIMFILE [IMAGE] [OPTION...] [< CMDFILE]
10
12 wimupdate, or equivalently wimlib-imagex update, modifies the specified
13 IMAGE in the Windows Imaging (WIM) archive WIMFILE by adding, deleting,
14 or renaming files or directories in it.
15
16 IMAGE specifies the image in WIMFILE to update. It may be the 1-based
17 index of an image or the name of an image. It may be omitted if WIM‐
18 FILE contains only one image. You can use wiminfo(1) to list the im‐
19 ages contained in WIMFILE.
20
21 The modifications to perform on the WIM image are specified as a se‐
22 quence of commands, one per line, read in a text file (UTF-8 or
23 UTF-16LE encoded; plain ASCII is also fine) from standard input. It is
24 recommended that standard input be redirected from a file (CMDFILE), as
25 shown above, rather than typing in commands interactively. Alterna‐
26 tively, to specify a command directly on the command line, see the
27 --command option.
28
30 This section documents the commands that may appear in the CMDFILE de‐
31 scribed above.
32
33 add [OPTION...] SOURCE DESTINATION
34 Add a file or directory tree to the WIM image. SOURCE must specify the
35 path to a file or directory on your filesystem. DESTINATION must spec‐
36 ify the path inside the WIM image at which to add the file or directory
37 tree.
38
39 If DESTINATION names an existing directory in the WIM image, then
40 SOURCE must also name a directory. This causes the contents of the
41 SOURCE directory to be added to the DESTINATION directory.
42
43 If DESTINATION names an existing nondirectory file in the WIM image,
44 then SOURCE must also name a nondirectory file. By default, this
45 causes the DESTINATION file to be replaced with the SOURCE file. Or,
46 with --no-replace specified, this generates an error.
47
48 If DESTINATION does not exist in the WIM image, then any prerequisite
49 directories are created as needed to add the SOURCE at that location.
50
51 The add command supports a subset of the options accepted by wimcap‐
52 ture; namely, --dereference, --unix-data, --no-acls, and --strict-acls.
53 See wimcapture(1) for explanations of these options.
54
55 In addition, the add command supports the --no-replace option, which
56 causes the add command to refuse to overwrite existing nondirectory
57 files in the WIM image.
58
59 delete [OPTION...] PATH
60 Delete a file or directory tree from the WIM image. PATH must specify
61 the path inside the WIM image of the file or directory tree to delete.
62
63 The available options for the delete command are:
64
65 --force
66 Do not issue an error if the path to delete does not exist.
67
68 --recursive
69 Delete the file or directory tree recursively; if not specified,
70 an error is issued if the path to delete is a directory.
71
72 rename OLD_PATH NEW_PATH
73 Rename a file or directory tree inside the WIM image. OLD_PATH must
74 specify the old path of the file or directory tree inside the WIM im‐
75 age, and NEW_PATH must specify the new path for the file or directory
76 tree. This command follows the semantics of the POSIX rename (3) func‐
77 tion; in particular, a pre-existing file at NEW_PATH will be deleted if
78 present, except in certain cases such as attempting to rename a direc‐
79 tory to a non-directory, which is not allowed.
80
81 There are no options available for the rename command.
82
84 The following options are accepted on the command line by wimupdate it‐
85 self:
86
87 --dereference
88 Use --dereference for all add commands.
89
90 --unix-data
91 Use --unix-data for all add commands.
92
93 --no-acls
94 Use --no-acls for all add commands.
95
96 --strict-acls
97 Use --strict-acls for all add commands.
98
99 --no-replace
100 Use --no-replace for all add commands.
101
102 --config=FILE
103 Set the capture configuration file for all add commands. See the
104 description of this option to wimcapture(1).
105
106 --force
107 Use --force for all delete commands.
108
109 --recursive
110 Use --recursive for all delete commands.
111
112 --check
113 Before updating the WIM, verify its integrity if it contains ex‐
114 tra integrity information. Also include extra integrity informa‐
115 tion in the updated WIM even if it was not present before.
116
117 --include-integrity
118 Include extra integrity information in the updated WIM, i.e. like
119 --check but don't also verify the WIM beforehand.
120
121 --threads=NUM_THREADS
122 Number of threads to use for compressing newly added files. De‐
123 fault: autodetect (number of processors).
124
125 --rebuild
126 Rebuild the entire WIM rather than appending the updated data to
127 the end of it. Rebuilding the WIM is slower, but will save a
128 little bit of space that would otherwise be left as a hole in the
129 WIM file.
130
131 See wimoptimize(1) for a more customizable way of rebuilding (and
132 optionally recompressing) a WIM file. If running wimoptimize af‐
133 ter wimupdate, there is no need to specify --rebuild to wimup‐
134 date.
135
136 --command=STRING
137 Instead of reading update commands from standard input, read a
138 single update command directly from the string STRING specified
139 on the command line. This option cannot be provided more than
140 one time and cannot be used to specify more than one update com‐
141 mand. Note that the STRING, as well as any paths containing spa‐
142 ces within the STRING must be appropriately quoted. If running
143 from cmd.exe on Windows, you should use double quotes for the
144 outer quotes and single quotes for the inner quotes. Example:
145
146 wimupdate boot.wim 1 --command="add 'C:\My Dir' '\My Dir'"
147
148 This option is provided for convenience only. Do not execute
149 wimupdate multiple consecutive times, each time passing the
150 --command option! This is inefficient. Instead, generate an up‐
151 date command file and provide it (on standard input) to a single
152 invocation of wimupdate, as explained in this document.
153
154 --wimboot-config=FILE
155 If this option is specified, no commands shall be read from stan‐
156 dard input, and instead the following command shall be executed:
157
158 add FILE /Windows/System32/WimBootCompress.ini
159
160 This sets FILE as the WIMBoot configuration file for the image.
161 The [PrepopulateList] section of this file specifies path globs
162 that shall not be extracted as WIMBoot pointer files (perhaps due
163 to being needed early in the boot process). See the documenta‐
164 tion for the --wimboot option of wimapply(1) for more informa‐
165 tion.
166
167 --unsafe-compact
168 Compact the WIM archive in-place and append any new data, elimi‐
169 nating "holes". This is efficient, but in general this option
170 should not be used because a failed or interrupted compaction
171 will corrupt the WIM archive. For more information, see the doc‐
172 umentation for this option in wimoptimize(1).
173
174 --ref="GLOB"
175 File glob of WIM(s) on which the delta WIM is based. Updating
176 split WIMs is not allowed, but updating delta WIMs is allowed.
177 When updating a delta WIM, the WIM(s) on which the delta WIM is
178 based should be specified using this option. (It isn't a hard
179 requirement, but it's needed for data deduplication to work fully
180 and for the TOTALBYTES statistic to be correctly updated.)
181
183 wimupdate can be viewed as redundant with wimmountrw, since a WIM image
184 can also be updated by mounting it read-write. However, wimupdate
185 works on all platforms including Windows, whereas wimmountrw only works
186 on Linux.
187
188 Symbolic links inside a WIM image are not dereferenced when being in‐
189 terpreted. So, for example, if you have a WIM image that contains a
190 symbolic link "/Documents and Settings" -> "/Users" where "/Users" is a
191 directory, then a subdirectory named "Public" in this directory must be
192 specified as "/Users/Public" rather than "/Documents and Settings/Pub‐
193 lic".
194
195 All paths to files or directories within the WIM image must be speci‐
196 fied relative to the root of the image. However, the leading slash is
197 optional, and both forward slashes and backslashes are accepted. In
198 addition, on Windows, the paths are by default treated case-insensi‐
199 tively, while on UNIX-like systems, the paths are by default treated
200 case-sensitively. The default case sensitivity may be changed by set‐
201 ting the WIMLIB_IMAGEX_IGNORE_CASE environmental variable to 0 or 1.
202
203 The command file (CMDFILE) is parsed by wimupdate itself and not by the
204 system shell. Therefore, its syntax is limited. However, comment
205 lines beginning with '#' are allowed, and it is also possible to quote
206 arguments with whitespace inside them.
207
208 On UNIX-like systems, you cannot use wimupdate to add files to an image
209 directly from an NTFS volume using libntfs-3g, even though wimcapture
210 supports capturing a full image this way.
211
212 Except when using --unsafe-compact, it is safe to abort a wimupdate
213 command partway through; however, after doing this, it is recommended
214 to run wimoptimize to remove any data that was appended to the physical
215 WIM file but not yet incorporated into the structure of the WIM, unless
216 --rebuild was specified, in which case you should delete the temporary
217 file left over.
218
220 All the examples below show the update command file to be created as
221 well as the wimupdate command to run to perform the updates.
222
223 Delete two files from a WIM image:
224
225 update_commands.txt:
226
227 delete /setup.exe
228 delete /sources/setup.exe
229
230 $ wimupdate boot.wim 2 < update_commands.txt
231
232 Add some files and directories to a WIM image. Note that the first
233 path of each add command specifies the files to add, while the second
234 path of each add command specify the locations at which to add them in‐
235 side the WIM image:
236
237 update_commands.txt:
238
239 add somedir /dir
240 add somefile /dir/file
241
242 $ wimupdate boot.wim 2 < update_commands.txt
243
244 Rename a file inside a WIM image.
245
246 update_commands.txt:
247
248 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
249
250 $ wimupdate boot.wim 2 < update_commands.txt
251
252 Using additional features, such as comments, options, and overlays, and
253 including extra integrity information in the updated WIM:
254
255 update_commands.txt:
256
257 #
258 # This file specifies some changes to make to a WIM image.
259 #
260
261 # Add a new directory containing files I want in the image.
262 # The quotes are necessary because the directory name
263 # contains a space.
264 add "My Directory" "/My Directory"
265
266 # Add the contents of "Another Directory" to the
267 # "/My Directory" we just created in the WIM image. Since
268 # the destination path already exists, this performs an
269 # overlay.
270 add "Another Directory" "/My Directory"
271
272 # Rename some file for some reason.
273 rename /dir_in_wim/oldfile.txt /dir_in_wim/newfile.txt
274
275 # Delete an unwanted directory.
276 delete --recursive /Users/Me/Documents/Junk
277
278 $ wimupdate boot.wim 2 --check < update_commands.txt
279
281 wimlib-imagex(1) wimcapture(1) wiminfo(1) wimmountrw(1) wimoptimize(1)
282
283
284
285wimlib 1.14.3 September 2023 WIMUPDATE(1)