Add support for self-extracting .exe archives.
This commit is contained in:
parent
c9c5d8e008
commit
82482f4787
@ -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,
|
||||
|
||||
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user