remove chp.exe. Fixes #630

Big Thanks @nikagl
This commit is contained in:
clinton-hall 2014-12-04 13:12:32 +10:30
commit 1e309b5891
4 changed files with 25 additions and 9 deletions

Binary file not shown.

View file

@ -0,0 +1 @@
start /wait wscript "%~dp0\invisible.vbs" %*

View file

@ -0,0 +1,20 @@
set args = WScript.Arguments
num = args.Count
if num = 0 then
WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
WScript.Quit 1
end if
sargs = ""
if num > 1 then
sargs = " "
for k = 1 to num - 1
anArg = args.Item(k)
sargs = sargs & anArg & " "
next
end if
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, True

View file

@ -10,18 +10,13 @@ def extract(filePath, outputDestination):
success = 0 success = 0
# Using Windows # Using Windows
if platform.system() == 'Windows': if platform.system() == 'Windows':
chplocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'chp.exe')
if not os.path.exists(nzbtomedia.SEVENZIP): if not os.path.exists(nzbtomedia.SEVENZIP):
nzbtomedia.logger.error("EXTRACTOR: Could not find 7-zip, Exiting") nzbtomedia.logger.error("EXTRACTOR: Could not find 7-zip, Exiting")
return False return False
else: invislocation = os.path.join(nzbtomedia.PROGRAM_DIR, 'nzbtomedia', 'extractor', 'bin', 'invisible.cmd')
if not os.path.exists(chplocation): cmd_7zip = [invislocation, nzbtomedia.SEVENZIP, "x", "-y"]
cmd_7zip = [nzbtomedia.SEVENZIP, "x", "-y"] ext_7zip = [".rar", ".zip", ".tar.gz", "tgz", ".tar.bz2", ".tbz", ".tar.lzma", ".tlz", ".7z", ".xz"]
else: EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip)
cmd_7zip = [chplocation, nzbtomedia.SEVENZIP, "x", "-y"]
ext_7zip = [".rar", ".zip", ".tar.gz", "tgz", ".tar.bz2", ".tbz", ".tar.lzma", ".tlz", ".7z", ".xz"]
EXTRACT_COMMANDS = dict.fromkeys(ext_7zip, cmd_7zip)
# Using unix # Using unix
else: else:
required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"] required_cmds = ["unrar", "unzip", "tar", "unxz", "unlzma", "7zr", "bunzip2"]