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)
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)