Left 4 Dead 2

Left 4 Dead 2

47 arvostelua
VPK Un-/Packing shell extension
Tekijältä мяFunreal
A guide that quickly teaches you how to pack and unpack vpk's by right clicking folders and vpk files
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Foreword
When creating mods, you must pack them into a vpk file. This is done by dragging a folder onto the vpk.exe. This is a super pain when you quickly want to pack it without having to drag the file across your ultrawide screen.

So, if you follow this little guide perfectly you will be able to right click a folder and pack it into a vpk file right there. You will even be able to pack multiple folders at once.


Registry edit file
Create a text file with a name of your choice, that ends in ".reg" For example "L4D2_VPK.reg.
Edit the file contents to contain the following text:
Note: the top part is information, the part that actually matters is at the bottom of the code block.
Read it anyways, it contains important information


Windows Registry Editor Version 5.00 ; Important notice: ; Do not forget to choose your own Hard drive! ; I used D, but you may have steam installed on C. ; Vpk.exe is not always the same, there are two versions. You can not use VPK1 in VPK2 games and vice versa, so you might need two entries ; Games whith version 1 VPK: ; Alien Swarm, Dota 2, Left 4 Dead, Left 4 Dead 2, Portal 2, Portal Stories: Mel, Source Filmmaker ; Games whith version 2 VPK: ; Counter-Strike: Global Offensive, Counter-Strike: Source, Day of Defeat: Source, Half-Life: Source, Half-Life 2, Half-Life 2: Deathmatch, Portal, Team Fortress 2 ; If you want more than one entry, you have to change the registry key names. ; This works by simple editing the "toVPK" part in the "[HKEY_CLASSES_ROOT\Directory\shell\toVPK]" and "...toVPK\command]" lines. ; Just name them "toVPK1", "toVPK2", "toVPK3" or "toVPK_TF2", "toVPK_L4D2" "toVPK_Hl2". ; But once you selected a name, you should not change it once you ran this reg file. Because then you will have the old AND the new entry. ;------------------------------------------------------------------------- ; VPK PACKING BELOW
[HKEY_CLASSES_ROOT\Directory\shell\toVPK2]
@="Pack VPK for L4D (Max 290MB)" ;Text shown when right clicking a folder
"Icon"="D:\\Programme\\Steam\\steamapps\\common\\Left 4 Dead 2\\bin\\addoninstaller.exe" ;Icon used

[HKEY_CLASSES_ROOT\Directory\shell\toVPK2\command]
@="D:\\Programme\\Steam\\SteamApps\\common\\left 4 dead 2\\bin\\vpk.exe \"%1\"" ;opening vpk.exe. Only change direction to your vpk.exe

; Enable the option for clicking inside the whitespace of a folder
[HKEY_CLASSES_ROOT\Directory\Background\shell\toVPK2]
@="Pack VPK for L4D (Max 290MB)";Text shown when right clicking a folder
"Icon"="D:\\Programme\\Steam\\steamapps\\common\\Left 4 Dead 2\\bin\\addoninstaller.exe";Icon used

[HKEY_CLASSES_ROOT\Directory\Background\shell\toVPK2\command]
@="D:\\Programme\\Steam\\SteamApps\\common\\left 4 dead 2\\bin\\vpk.exe \"%v\"" ;opening vpk.exe. Only change direction to your vpk.exe

; VPK UNPACKING BELOW
;Name in the Right-Click-Menu
[HKEY_CURRENT_USER/Software/Classes/SystemFileAssociations/.vpk/shell/Unpack]
@="Unpack"

;vpk.exe location
[HKEY_CURRENT_USER/Software/Classes/SystemFileAssociations/.vpk/shell/Unpack/command]
@="D:\\Programme\\Steam\\steamapps\\common\\Left 4 Dead 2/bin/vpk.exe/" "%1\""

;Icon used.
[HKEY_CURRENT_USER/Software/Classes/SystemFileAssociations/.vpk/shell/Unpack]
"Icon"="D:\\Programme\\Steam\\steamapps\\common\\Left 4 Dead 2\\bin\\SDKLauncher.exe,0"

Once you made that file, double click it to install it into your registry. Then you will be done.
You might have to log out and log in again to apply the changes.

IF it doesn't work for you, try swapping all single \ with double \\ in the Hkey brackets.
Some people may need this, some apparently don't.
Uninstall
To uninstall, press the Windows key to open the Start menu and type out "Regedit".
Usually "Reg" would be enough to see the Registry editor to pop up in the search.

Its icon looks like a bunch of cubes.


Copy paste the following text into the text box on top:
HKEY_CLASSES_ROOT\Directory\shell\toVPK2
The toVPK2 part will be different if you chose to edit the .reg file.

Delete the entire ToVPK2 folder


do the exact same with
HKEY_CLASSES_ROOT\Directory\Background\shell\toVPK2
and
HKEY_CLASSES_ROOT\SystemFileAssociations\.vpk

To apply these changes, most people tell you to reboot your pc, but that is nonsense.
Open any folder, literally any. Doesn't matter.
Open the task manager, right click Windows Explorer and restart it.
25 kommenttia
lazz 12.9.2023 klo 9.34 
Thank you. In the process it saves a minute or 1.5 minutes, not much, but nice :)
мяFunreal  [tekijä] 3.3.2023 klo 3.09 
@Alyx Maybe read the code. it literally tells you
мяFunreal  [tekijä] 3.3.2023 klo 3.07 
To delete the unpack, the key will be set in Computer/HKEY_CLASSES_ROOT/SystemFileAssociations/.vpk/shell/Unpack
Could you please teach how to remove it manually in the registry? I follow the path but I don't find "systemfileassociations"
Azu 2.3.2023 klo 18.19 
would this be possible with portal 2?
мяFunreal  [tekijä] 22.4.2021 klo 20.21 
manually delete the registry keys
gish 22.4.2021 klo 15.22 
Do you know how to uninstall it? I don't really want it anymore, since i don't do a lot of modding for Left 4 Dead anymore.
Cleileen41496 19.9.2020 klo 6.24 
Unpack doesn't works for me too !!
ßαsταrÐ 15.9.2020 klo 7.54 
Nice guide. Helpful not just for L4D2 but the whole Source catalog, and gives me a better picture of what registry editor is for / capable of. I'll remember that when I'm modding other games.
Barnie Sandlers 5.2.2020 klo 8.20 
So the Unpack portion of the code isn't working for me. It's just asking me what program I wanna open the .vpk file with.