Vpk.exe: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎VPK tool: Removed ominous "Left 4 Dead (2) VPK Creator", which is just a bunch of dll's and exe's from the bin directory. Also added/updated some info regarding file handling.)
Line 3: Line 3:
== VPK tool ==
== VPK tool ==


VPKs can be created with the [[command line]] tool <code>vpk</code>, found at <code><game>\bin\</code>. It is currently available in [[Left 4 Dead (engine branch)|Left 4 Dead]] branch and [[Alien Swarm (engine branch)|Alien Swarm]] branch games.
VPKs can be created with the [[command line]] tool <code>vpk.exe</code>, found at <code><game>\bin\</code>. It is available in all newer Source engine games since [[Left 4 Dead]]. Even though it is a command line tool, you can also create VPK files by dragging and dropping directories on <code>vpk.exe</code> in Explorer.


When you create a VPK source files like TGA, QC and VMF are discarded, as are executables.
When you create a VPK, some executable and archive files will be discarded. Files with following extensions are affected: .zip, .reg, .rar, .msi, .exe, .dll, .com, .cmd and .bat.
 
Also is possible to pack files into .vpk archive by downloading "Left 4 Dead (2) VPK Creator (VPK.EXE)" from http://www.mediafire.com/?mydymgjgjd0 . Just need to drug folder with files onto vpk.exe and wait till archive will be created in directory from what folder was druged. It's doesn't matter how much parts have original archive, it still can be replace with name "pak01_dir" in L4d 2. For extracting need to use GCFSpace also by choosing "pak01_dir.vpk".


=== Commands ===
=== Commands ===

Revision as of 06:25, 19 July 2011

VPK ("Valve Pak") files are uncompressed archives used to package content (never code). They are the successors to GCFs, and when passed to the addoninstaller tool are also used to distribute add-ons like custom campaigns.

VPK tool

VPKs can be created with the command line tool vpk.exe, found at <game>\bin\. It is available in all newer Source engine games since Left 4 Dead. Even though it is a command line tool, you can also create VPK files by dragging and dropping directories on vpk.exe in Explorer.

When you create a VPK, some executable and archive files will be discarded. Files with following extensions are affected: .zip, .reg, .rar, .msi, .exe, .dll, .com, .cmd and .bat.

Commands

<dirname>
Creates a new VPK in the directory given, containing the contents of that directory. Must be an existing location. Alternatively, drag a folder onto the tool in Explorer to trigger this command.
Icon-Bug.pngBug:If the location is outside the game's folder, the file will just be called ".vpk".  [todo tested in ?]
x <vpkfile> <filename1> <filename2> ...
Extract file(s).
a <vpkfile> <filename1> <filename2> ...
Add file(s).
a <vpkfile> @<filename>
k vpkfile <filename>
Add files listed in a response file ('a' - note the @) or a keyvalues file ('k').
Icon-Bug.pngBug:They will appear inside the VPK with their full path (C:\etc\) intact - is there a way to avoid this?  [todo tested in ?]
l <vpkfile>
L <vpkfile>
List contents of VPK. Uppercase 'L' means more detail.
-v
Verbose output.
-M
Produce a multi-chunk VPK that is split across several files and has an index. To inspect a multi-chunk VPK look at the '_dir' file.

See also