PDA

View Full Version : Quickly unzip Ext, Mod, & Pak from Windows file menu



valeros
May 31st, 2020, 05:45
Very annoying to have to rename and unzip extension, module, and ruleset files. So if you want an option in your Windows file menu (i.e., when you right-click on the file) to do it automatically, then you can do the following:
https://i.imgur.com/mX0KUvz.jpg


Create a file named "extractFG.ps1" in C: with this for the contents:


$extensionFilename = [io.path]::GetFileName($args)
$zipFile = [io.path]::GetFilenameWithoutExtension($extensionFilename) + ".zip"
Copy-Item $extensionFilename -Destination $zipFile
Get-ChildItem -File $zipFile | foreach {Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory($_.fullname, [io.path]::combine($_.directory, $_.basename));}
Remove-Item $zipFile



Then create a file named "regAdd.reg" with this for the contents:


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\SystemFileAssociations\.ext\shel l\subtitle]
@="Unzip FG Ext"

[HKEY_CLASSES_ROOT\SystemFileAssociations\.ext\shel l\subtitle\command]
@="powershell C:\\extractFG.ps1 \"%1\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.mod\shel l\subtitle]
@="Unzip FG Mod"

[HKEY_CLASSES_ROOT\SystemFileAssociations\.mod\shel l\subtitle\command]
@="powershell C:\\extractFG.ps1 \"%1\""

[HKEY_CLASSES_ROOT\SystemFileAssociations\.pak\shel l\subtitle]
@="Unzip FG Pak"

[HKEY_CLASSES_ROOT\SystemFileAssociations\.pak\shel l\subtitle\command]
@="powershell C:\\extractFG.ps1 \"%1\""



Double-click on the "regAdd.reg" file to have it add the required registry entries. Then you should have it in your Windows menu

This does not delete the original file, so the Ext, Mod, or Pak file will still be there (but if you want it to be removed, just add another "Remove-Item" line to the powershell script)

damned
May 31st, 2020, 06:02
Hi Valeros

Nice. It shoudl be possible to also add some entries in teh Send To option to Send to Mod, Send to EXT, Send to PAK

I use 7zip which recognises the files as Zip so I dont need to rename.

Ampersandrew
June 5th, 2020, 23:53
Ditto, when you install 7zip it adds to the right click menu and as damned says it recognizes the files as zip without renaming them.