Add support for self-extracting .exe archives.

This commit is contained in:
Markus Reiter 2018-07-16 09:54:37 +02:00
parent c9c5d8e008
commit 82482f4787
2 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,7 @@ require "hbc/container/bzip2"
require "hbc/container/cab"
require "hbc/container/criteria"
require "hbc/container/dmg"
require "hbc/container/self_extracting_executable"
require "hbc/container/executable"
require "hbc/container/generic_unar"
require "hbc/container/gpg"
@ -32,6 +33,7 @@ module Hbc
Ttf,
Otf,
Air,
SelfExtractingExecutable,
Cab,
Dmg,
SevenZip,

View File

@ -0,0 +1,15 @@
require "hbc/container/generic_unar"
module Hbc
class Container
class SelfExtractingExecutable < GenericUnar
def self.can_extract?(path:, magic_number:)
return false unless magic_number.match?(/\AMZ/n)
SystemCommand.run("file",
args: [path],
print_stderr: false).stdout.include?("self-extracting")
end
end
end
end