From cf0fd67acbde1a9f77b65d4bd4cb66174bd9706b Mon Sep 17 00:00:00 2001 From: Bioruebe Date: Thu, 9 Jun 2016 02:46:57 +0200 Subject: [PATCH] Further improvements to updater, permission check and UI Added permission check and auto-elevation to plugin installation routine Added HideStatusBox option Added back is5comp as plugin, closes #18 Added /plugins command line switch Fixed .mht, .msi detection Fixed some untranslated terms in MethodSelect GUI Fixed possible file not found bug in updater Changed MethodSelect logic Further custom definition improvements --- English.ini | Bin 47984 -> 49126 bytes UniExtract.au3 | 653 +++++++++++++++++++----------------------- UniExtractUpdater.au3 | 9 +- changelog.txt | 4 +- changelog_minor.txt | 9 +- def/arc.ini | 15 + def/flv.ini | 12 + def/lit.ini | 15 + def/registry.ini | 27 ++ def/uu.ini | 12 + lang/German.ini | Bin 55010 -> 56324 bytes todo.txt | 12 +- 12 files changed, 401 insertions(+), 367 deletions(-) create mode 100644 def/arc.ini create mode 100644 def/flv.ini create mode 100644 def/lit.ini create mode 100644 def/registry.ini create mode 100644 def/uu.ini diff --git a/English.ini b/English.ini index 4f7c63c10dd98bbda522134618c8d9ba76a55484..e0400c2c72e85044b101000d9de165742e8f150f 100644 GIT binary patch delta 765 zcmb7CO-mb56g{{Q60oSLZ6(k=1_M=z;G%RP3SveoXwo#Px+_m-)S)^FlQCA1xM{m^ zd%=|-|DXs%7yS#RzX8Y6o?AtW+rQ zctmPKV~r?2Gldvi_O{7P^X%HMYwUV2rw6%}fK$6wnv-Kj$k@@piUbe#Edc~lCMPo>MLvP<3+{}W_ibR>_aagm? zFbd2}qc0?`&ujvD<~;JZoqJ)nbfYXHZ$+K~-&@RlyMdO~Z2A;88eo%mF`82On32}` z!$VE=F>51sYCb)pO>ll6(&RA5aOqf;OpC@b@^qQqgQaDwvBMeN4Q^X^H9VOOheq$m zTAe(Q;_+bh*4KYjaYD#Bw|g^s_W3QQe~Qi+l^e_>viaZfIyd_6G@pDp`ZgxtKM$s! yQ+ydqcqNsK$I>3@mD<;SnaQV9b*|P}63OIJu8(H(cQZe*k63h)NnU<=)_VWritePrefs Func SavePref($name, $value) IniWrite($prefs, "UniExtract Preferences", $name, $value) Cout("Saving: " & $name & " = " & $value) -EndFunc ;==>SavePref +EndFunc ; Load single preference Func LoadPref($name, ByRef $value, $int = True) @@ -862,6 +869,8 @@ Func filecompare($filetype_curr) EndSelect ; Not extractable filetypes + If StringInStr($filetype_curr, "CDF V2 document") Then Return + If (StringInStr($filetype_curr, "text", 0) And (StringInStr($filetype_curr, "CRLF", 0) Or _ StringInStr($filetype_curr, "long lines", 0) Or StringInStr($filetype_curr, "ASCII", 0)) Or _ StringInStr($filetype_curr, "batch file") Or StringInStr($filetype_curr, "XML") Or _ @@ -988,13 +997,13 @@ Func tridcompare($filetype_curr) Case StringInStr($filetype_curr, "LZX Amiga compressed archive", 0) extract("lzx", 'LZX ' & t('TERM_COMPRESSED')) - Case StringInStr($filetype_curr, "Microsoft Internet Explorer Web Archive", 0) + Case StringInStr($filetype_curr, "Microsoft Internet Explorer Web Archive") Or StringInStr($filetype_curr, "MIME HTML archive format") extract("mht", 'MHTML ' & t('TERM_ARCHIVE')) Case StringInStr($filetype_curr, "Microsoft Windows Installer merge module", 0) extract("msm", 'Windows Installer (MSM) ' & t('TERM_MERGE_MODULE')) - Case StringInStr($filetype_curr, "(.MSI) Microsoft Windows Installer", 0) + Case StringInStr($filetype_curr, "Microsoft Windows Installer", 0) extract("msi", 'Windows Installer (MSI) ' & t('TERM_PACKAGE')) Case StringInStr($filetype_curr, "Microsoft Windows Installer patch", 0) @@ -1152,14 +1161,19 @@ EndFunc ; Compare file type with definitions stored in def/registry.ini Func UserDefCompare(ByRef $aDefinitions, $filetype_curr, $sSection) - If UBound($aDefinitions) == 0 Then - $aDefinitions = IniReadSection($defdir & "registry.ini", $sSection) - If @error Then Return Cout("Could not load custom " & $sSection & " definitions") - Cout("Loading " & $sSection & " definitions") - EndIf + For $dir In $aDefDirs + If UBound($aDefinitions) == 0 Then + $aDefinitions = IniReadSection($dir & "registry.ini", $sSection) + If @error Then + Cout("Could not load custom " & $sSection & " definitions from " & $dir) + ContinueLoop + EndIf + Cout("Loaded " & $sSection & " definitions from " & $dir) + EndIf - For $i = 1 To $aDefinitions[0][0] - If (StringInStr($filetype_curr, $aDefinitions[$i][1])) Then extract($aDefinitions[$i][0]) + For $i = 1 To $aDefinitions[0][0] + If (StringInStr($filetype_curr, $aDefinitions[$i][1])) Then extract($aDefinitions[$i][0]) + Next Next EndFunc @@ -1788,13 +1802,18 @@ EndFunc ; If detection fails, try to determine file type by extension Func CheckExt() - Local $aDefinitions = IniReadSection($defdir & "registry.ini", "Extensions") - If @error Then Return SetError(1, 0, 0) + For $dir In $aDefDirs + Local $aDefinitions = IniReadSection($defdir & "registry.ini", "Extensions") + If @error Then + Cout("Could not load definition registry from " & $dir) + ContinueLoop + EndIf - For $i = 0 To $aDefinitions[0][0] - $aReturn = StringSplit($aDefinitions[$i][0], ",") - For $j = 1 To $aReturn[0] - If StringCompare($fileext, StringStripWS($aReturn[$j], 8)) == 0 Then extract($aDefinitions[$i][1]) + For $i = 0 To $aDefinitions[0][0] + $aReturn = StringSplit($aDefinitions[$i][0], ",") + For $j = 1 To $aReturn[0] + If StringCompare($fileext, StringStripWS($aReturn[$j], 8)) == 0 Then extract($aDefinitions[$i][1]) + Next Next Next #cs @@ -1802,9 +1821,6 @@ Func CheckExt() Case "1", "lib" extract("is3arc", 'InstallShield 3.x ' & t('TERM_ARCHIVE')) - Case "7z" - extract("7z", '7-Zip ' & t('TERM_ARCHIVE')) - Case "ace" extract("ace", 'ACE ' & t('TERM_ARCHIVE')) @@ -1863,15 +1879,6 @@ Func CheckExt() Case "lzx" extract("lzx", 'LZX ' & t('TERM_COMPRESSED')) - Case "mht" - extract("mht", 'MHTML ' & t('TERM_ARCHIVE')) - - Case "mp3" - extract("audio", t('TERM_AUDIO') & ' ' & t('TERM_FILE')) - - Case "msi" - extract("msi", 'Windows Installer (MSI) ' & t('TERM_PACKAGE')) - Case "msm" extract("msm", 'Windows Installer (MSM) ' & t('TERM_MERGE_MODULE')) @@ -1923,9 +1930,6 @@ Func CheckExt() Case "zoo" extract("zoo", 'ZOO ' & t('TERM_ARCHIVE')) - Case "wolf" - extract("arc_conv", "Wolf RPG Editor " & t('TERM_GAME') & t('TERM_ARCHIVE')) - Case "rgss", "rgss2a" extract("arc_conv", "RPG Maker " & t('TERM_GAME') & t('TERM_ARCHIVE')) @@ -1982,10 +1986,8 @@ EndFunc ; Extract from known archive format Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess = False, $returnFail = False) $success = $RESULT_UNKNOWN - If $arcdisp <> "" Then - Cout("Starting " & $arctype & " extraction") - _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $arcdisp) - EndIf + Cout("Starting " & $arctype & " extraction") + _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & ($arcdisp == 0? "." & $fileext & " " & t('TERM_FILE'): $arcdisp)) ; Create subdirectory If StringRight($outdir, 1) = '\' Then $outdir = StringTrimRight($outdir, 1) @@ -2006,7 +2008,7 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess Switch $arctype Case "7z" Local $sPassword = _FindArchivePassword($cmd & $7z & ' l -p -slt "' & $file & '"', $cmd & $7z & ' t -p"%PASSWORD%" "' & $file & '"', "Encrypted = +", "Wrong password?", 0, "Everything is Ok") - _Run($cmd & $7z & ' x ' & ($sPassword == 0? '"': '-p"' & $sPassword & '" "') & $file & '"', $outdir) + _Run($cmd & $7z & ' x ' & ($sPassword == 0? '"': '-p"' & $sPassword & '" "') & $file & '"', $outdir, @SW_HIDE, True, True, True) If @extended Then terminate('password', $file, $arcdisp) ; Extract inner CPIO for RPMs @@ -2301,134 +2303,134 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess ; TODO: {syswow64}, {sys}, {cf32} - move files to outdir as dlls might be needed by the program? Case "is3arc" - $choice = MethodSelect($arctype, $arcdisp) + $aReturn = ['InstallShield 3.x ' & t('TERM_ARCHIVE'), t('METHOD_EXTRACTION_RADIO', 'STIX'), t('METHOD_EXTRACTION_RADIO', 'unshield')] + $choice = MethodSelect($aReturn, $arcdisp) ; Extract using i3comp ; Removed due to license problems with .dll files ;if $choice == 'i3comp' then ; runwait($cmd & $is3arc & ' "' & $file & '" *.* -d -i' & $output, $outdir) - ; Extract using unshield - If $choice == 'unshield' Then - _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) - - ; Extract using STIX - ElseIf $choice == 'STIX' Then + If $choice == 1 Then ; Unshield _Run($cmd & $stix & ' ' & FileGetShortName($file) & ' ' & FileGetShortName($outdir), $filedir) + Else ; STIX + _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) EndIf Case "iscab" - - $choice = "is6comp" - If FileExists($bindir & $iscab) Then $choice = MethodSelect($arctype, $arcdisp) - - If $choice == "is6comp" Then - ; List contents of archive - $return = FetchStdout($cmd & $is6cab & ' l "' & $file & '"', $filedir, @SW_HIDE) - $return = _StringBetween(StringRight($return, 22), " ", " file(s) total") - If Not @error Then $return = Number(StringStripWS($return[0], 8)) - ;MsgBox(1,"",$return) - - ; If successful, extract contents of InstallShield cabs file-by-file - If $return > 0 Then - RunWait($cmd & $is6cab & ' x "' & $file & '"', $outdir, @SW_MINIMIZE) - Else - ; Otherwise, attempt to extract with unshield - _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) - EndIf - - ElseIf $choice == "iscab" Then - RunWait($cmd & $iscab & ' "' & $file & '" -i"files.ini" -lx', $outdir, @SW_HIDE) - ;MsgBox(1,"",$cmd & $iscab & ' "' & $file & '" -i"files.ini" -x') - RunWait($cmd & $iscab & ' "' & $file & '" -i"files.ini" -x', $outdir, @SW_MINIMIZE) - FileDelete($outdir & "\files.ini") - EndIf + Local $aReturn = ['InstallShield Cabinet ' & t('TERM_ARCHIVE'), t('METHOD_EXTRACTION_RADIO', 'is6comp'), t('METHOD_EXTRACTION_RADIO', 'is5comp'), t('METHOD_EXTRACTION_RADIO', 'iscab')] + $choice = MethodSelect($aReturn, $arcdisp) + + Switch $choice + Case 1 + ; List contents of archive + $return = FetchStdout($cmd & $is6cab & ' l "' & $file & '"', $filedir, @SW_HIDE) + $return = _StringBetween(StringRight($return, 22), " ", " file(s) total") + If Not @error Then $return = Number(StringStripWS($return[0], 8)) + + ; If successful, extract contents of InstallShield cabs file-by-file + If $return > 0 Then + RunWait($cmd & $is6cab & ' x "' & $file & '"', $outdir, @SW_MINIMIZE) + Else + ; Otherwise, attempt to extract with unshield + _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) + EndIf + Case 2 + HasPlugin($is5cab) + RunWait($cmd & $is5cab & ' x "' & $file & '"', $outdir, @SW_MINIMIZE) + Case 3 + HasPlugin($iscab) + RunWait($cmd & $iscab & ' "' & $file & '" -i"files.ini" -lx', $outdir, @SW_HIDE) + RunWait($cmd & $iscab & ' "' & $file & '" -i"files.ini" -x', $outdir, @SW_MINIMIZE) + FileDelete($outdir & "\files.ini") + EndSwitch Case "isexe" exescan($file, 'ext', 0) If StringInStr($filetype, "3.x", 0) Then ; Extract 3.x SFX installer using stix _Run($cmd & $stix & ' ' & FileGetShortName($file) & ' ' & FileGetShortName($outdir), $filedir) - Else - $choice = MethodSelect($arctype, $arcdisp) + Local $aReturn = ["InstallShield " & t('TERM_INSTALLER'), t('METHOD_EXTRACTION_RADIO', 'isxunpack'), t('METHOD_EXTRACTION_RADIO', 'unshield'), t('METHOD_SWITCH_RADIO', 'InstallShield /b'), t('METHOD_NOTIS_RADIO')] + $choice = MethodSelect($aReturn, $arcdisp) ; User-specified false positive; return for additional analysis - If $choice == 'not InstallShield' Then - $isfailed = True - Return False - + Switch $choice ; Extract using isxunpack - ElseIf $choice == 'isxunpack' Then - FileMove($file, $outdir) - Run($cmd & $isxunp & ' "' & $outdir & '\' & $filename & '.' & $fileext & '"', $outdir) - WinWait(@ComSpec) - WinActivate(@ComSpec) - Send("{ENTER}") - ProcessWaitClose($isxunp) - FileMove($outdir & '\' & $filename & '.' & $fileext, $filedir) + Case 1 + FileMove($file, $outdir) + Run($cmd & $isxunp & ' "' & $outdir & '\' & $filename & '.' & $fileext & '"', $outdir) + WinWait(@ComSpec) + WinActivate(@ComSpec) + Send("{ENTER}") + ProcessWaitClose($isxunp) + FileMove($outdir & '\' & $filename & '.' & $fileext, $filedir) ; Try to extract using unshield - ElseIf $choice == 'unshield' Then - _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) + Case 2 + _Run($cmd & $unshield & ' -d "' & $outdir & '" x "' & $file & '"', $outdir) ; Try to extract MSI using cache switch - ElseIf $choice == 'InstallShield /b' Then - ; Run installer and wait for temp files to be copied - _CreateTrayMessageBox(t('INIT_WAIT')) - - If $Log Then - _Run(Warn_Execute('"' & $file & '" /b"' & $tempoutdir & '" /v"/l "' & $logdir & 'teelog.txt""'), $filedir, @SW_SHOW, False) - Else - RunWait(Warn_Execute('"' & $file & '" /b"' & $tempoutdir & '"'), $filedir) - EndIf + Case 3 + ; Run installer and wait for temp files to be copied + _CreateTrayMessageBox(t('INIT_WAIT')) - ; TODO: Rewrite - ; Wait for matching windows for up to 30 seconds (60 * .5) - Opt("WinTitleMatchMode", 4) - Local $success - For $i = 1 To 60 - If Not WinExists("classname=MsiDialogCloseClass") Then - Sleep(500) + If $Log Then + _Run(Warn_Execute('"' & $file & '" /b"' & $tempoutdir & '" /v"/l "' & $logdir & 'teelog.txt""'), $filedir, @SW_SHOW, False) Else - ; Search temp directory for MSI support and copy to tempoutdir - $msihandle = FileFindFirstFile($tempoutdir & "\*.msi") - If Not @error Then - While 1 - $msiname = FileFindNextFile($msihandle) - If @error Then ExitLoop - $tsearch = FileSearch(@TempDir & "\" & $msiname) - If Not @error Then - $isdir = StringLeft($tsearch[1], StringInStr($tsearch[1], '\', 0, -1) - 1) - $ishandle = FileFindFirstFile($isdir & "\*") - $fname = FileFindNextFile($ishandle) - Do - If $fname <> $msiname Then - FileCopy($isdir & "\" & $fname, $tempoutdir) - EndIf + RunWait(Warn_Execute('"' & $file & '" /b"' & $tempoutdir & '"'), $filedir) + EndIf + + ; TODO: Rewrite + ; Wait for matching windows for up to 30 seconds (60 * .5) + Opt("WinTitleMatchMode", 4) + Local $success + For $i = 1 To 60 + If Not WinExists("classname=MsiDialogCloseClass") Then + Sleep(500) + Else + ; Search temp directory for MSI support and copy to tempoutdir + $msihandle = FileFindFirstFile($tempoutdir & "\*.msi") + If Not @error Then + While 1 + $msiname = FileFindNextFile($msihandle) + If @error Then ExitLoop + $tsearch = FileSearch(@TempDir & "\" & $msiname) + If Not @error Then + $isdir = StringLeft($tsearch[1], StringInStr($tsearch[1], '\', 0, -1) - 1) + $ishandle = FileFindFirstFile($isdir & "\*") $fname = FileFindNextFile($ishandle) - Until @error - FileClose($ishandle) - EndIf - WEnd - FileClose($msihandle) + Do + If $fname <> $msiname Then + FileCopy($isdir & "\" & $fname, $tempoutdir) + EndIf + $fname = FileFindNextFile($ishandle) + Until @error + FileClose($ishandle) + EndIf + WEnd + FileClose($msihandle) + EndIf + + ; Move files to outdir + _DeleteTrayMessageBox() + Prompt(64, 'INIT_COMPLETE', 0) + MoveFiles($tempoutdir, $outdir, False, "", True) + $success = True + ExitLoop EndIf + Next - ; Move files to outdir + ; Not a supported installer + If Not $success Then _DeleteTrayMessageBox() - Prompt(64, 'INIT_COMPLETE', 0) - MoveFiles($tempoutdir, $outdir, False, "", True) - $success = True - ExitLoop + Prompt(16, 'INIT_COMPLETE', 0) EndIf - Next - - ; Not a supported installer - If Not $success Then - _DeleteTrayMessageBox() - Prompt(16, 'INIT_COMPLETE', 0) - EndIf - EndIf + ; Not InstallShield + Case 4 + $isfailed = True + Return False + EndSwitch EndIf Case "isz" @@ -2452,54 +2454,51 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess _Run($cmd & $lzx & ' -x "' & $file & '"', $outdir) Case "mht" - $choice = MethodSelect($arctype, $arcdisp) + Local $aReturn = ['MHTML ' & t('TERM_ARCHIVE'), t('METHOD_EXTRACTION_RADIO', 'ExtractMHT'), t('METHOD_EXTRACTION_RADIO', 'MhtUnPack')] + $choice = MethodSelect($aReturn, $arcdisp) ; Extract using ExtractMHT - If $choice == 'ExtractMHT' Then + If $choice == 1 Then _Run($mht & ' "' & $file & '" "' & $outdir & '"', $outdir, @SW_MINIMIZE, False) - ElseIf $choice == 'MhtUnPack' Then + Else extract('qbms', $arcdisp, $mht_plug) EndIf Case "msi" - $choice = MethodSelect($arctype, $arcdisp) + Local $aReturn = ['MSI ' & t('TERM_INSTALLER'), t('METHOD_EXTRACTION_RADIO', 'jsMSI Unpacker'), t('METHOD_EXTRACTION_RADIO', 'MsiX'), t('METHOD_EXTRACTION_RADIO', 'MSI TC Packer'), t('METHOD_ADMIN_RADIO', 'MSI')] + $choice = MethodSelect($aReturn, $arcdisp) + + Switch $choice + Case 1 ; jsMSI Unpacker + _Run($msi_jsmsix & ' "' & $file & '"|"' & $outdir & '"', $filedir, @SW_SHOW, False) + _FileRead($outdir & "\MSI Unpack.log", True) + + Case 2 ; MsiX + Local $appendargs = $appendext? '/ext': '' + _Run($cmd & $msi_msix & ' "' & $file & '" /out "' & $outdir & '" ' & $appendargs, $filedir) + + Case 3 ; MSI Total Commander plugin + extract('qbms', $arcdisp, $msi_plug, True) + + ; Extract files from extracted CABs + $cabfiles = FileSearch($tempoutdir) + For $i = 1 To $cabfiles[0] + filescan($cabfiles[$i], 0) + If StringInStr($filetype, "Microsoft Cabinet Archive", 0) Then + _Run($cmd & $7z & ' x "' & $cabfiles[$i] & '"', $outdir) + FileDelete($cabfiles[$i]) + EndIf + Next - ; Extract using administrative install - If $choice == 'MSI' Then - RunWait(Warn_Execute('msiexec.exe /a "' & $file & '" /qb TARGETDIR="' & $outdir & '"'), $filedir, @SW_SHOW) - - ; Extract with MsiX - ElseIf $choice == 'MsiX' Then - Local $appendargs = '' - If $appendext Then $appendargs = '/ext' - _Run($cmd & $msi_msix & ' "' & $file & '" /out "' & $outdir & '" ' & $appendargs, $filedir) - - ; Extract with jsMSI Unpacker - ElseIf $choice == "jsMSI Unpacker" Then - _Run($msi_jsmsix & ' "' & $file & '"|"' & $outdir & '"', $filedir, @SW_SHOW, False) - _FileRead($outdir & "\MSI Unpack.log", True) - - ; Extract with MSI Total Commander plugin - ElseIf $choice == 'MSI TC Packer' Then - ;dircreate($tempoutdir) - extract('qbms', $arcdisp, $msi_plug, True) - - ; Extract files from extracted CABs - $cabfiles = FileSearch($tempoutdir) - For $i = 1 To $cabfiles[0] - filescan($cabfiles[$i], 0) - If StringInStr($filetype, "Microsoft Cabinet Archive", 0) Then - _Run($cmd & $7z & ' x "' & $cabfiles[$i] & '"', $outdir) - FileDelete($cabfiles[$i]) - EndIf - Next + ; Append missing file extensions + If $appendext Then AppendExtensions($tempoutdir) - ; Append missing file extensions - If $appendext Then AppendExtensions($tempoutdir) + ; Move files to output directory and remove tempdir + MoveFiles($tempoutdir, $outdir, False, "", True) - ; Move files to output directory and remove tempdir - MoveFiles($tempoutdir, $outdir, False, "", True) - EndIf + Case 4 ; Administrative install + RunWait(Warn_Execute('msiexec.exe /a "' & $file & '" /qb TARGETDIR="' & $outdir & '"'), $filedir, @SW_SHOW) + EndSwitch Case "msm" Local $appendargs = '' @@ -2507,22 +2506,18 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess _Run($cmd & $msi_msix & ' "' & $file & '" /out "' & $outdir & '" ' & $appendargs, $filedir) Case "msp" - $choice = MethodSelect($arctype, $arcdisp) + Local $aReturn = ['MSP ' & t('TERM_PACKAGE'), t('METHOD_EXTRACTION_RADIO', 'MSI TC Packer'), t('METHOD_EXTRACTION_RADIO', 'MsiX'), t('METHOD_EXTRACTION_RADIO', '7-Zip')] + $choice = MethodSelect($aReturn, $arcdisp) - ; Extract using TC MSI DirCreate($tempoutdir) - If $choice == 'MSI TC Packer' Then - extract('qbms', $arcdisp, $msi_plug, True) - - ; Extract with MsiX - ElseIf $choice == 'MsiX' Then - Run($cmd & $msi_msix & ' "' & $file & '" /out "' & $tempoutdir & '"', $filedir) - - ; Extract using 7-Zip - ElseIf $choice == '7-Zip' Then - _Run($cmd & $7z & ' x "' & $file & '"', $outdir) - - EndIf + Switch $choice + Case 1 ; TC MSI + extract('qbms', $arcdisp, $msi_plug, True) + Case 2 ; MsiX + Run($cmd & $msi_msix & ' "' & $file & '" /out "' & $tempoutdir & '"', $filedir) + Case 3 ; 7-Zip + _Run($cmd & $7z & ' x "' & $file & '"', $outdir) + EndSwitch ; Regardless of method, extract files from extracted CABs $cabfiles = FileSearch($tempoutdir) @@ -2796,69 +2791,67 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess RunWait(Warn_Execute($file & ' /extract:"' & $outdir & '" /quiet'), $outdir) Case "wise" + Local $aReturn = ['Wise ' & t('TERM_INSTALLER'), t('METHOD_UNPACKER_RADIO', 'E_Wise'), t('METHOD_UNPACKER_RADIO', 'WUN'), t('METHOD_SWITCH_RADIO', 'Wise Installer /x'), t('METHOD_EXTRACTION_RADIO', 'Wise MSI'), t('METHOD_EXTRACTION_RADIO', 'Unzip')] $choice = MethodSelect($arctype, $arcdisp) - ; Extract with E_WISE - If $choice == 'E_Wise' Then - _Run($cmd & $wise_ewise & ' "' & $file & '" "' & $outdir & '"', $filedir) - If DirGetSize($outdir) > $initdirsize Then - RunWait($cmd & '00000000.BAT', $outdir, @SW_HIDE) - FileDelete($outdir & '\00000000.BAT') - EndIf + Switch $choice + ; Extract with E_WISE + Case 1 + _Run($cmd & $wise_ewise & ' "' & $file & '" "' & $outdir & '"', $filedir) + If DirGetSize($outdir) > $initdirsize Then + RunWait($cmd & '00000000.BAT', $outdir, @SW_HIDE) + FileDelete($outdir & '\00000000.BAT') + EndIf ; Extract with WUN - ElseIf $choice == 'WUN' Then - RunWait($cmd & $wise_wun & ' "' & $filename & '" "' & $tempoutdir & '"', $filedir) - Local $removetemp = 1 - LoadPref("removetemp", $removetemp) - If $removetemp Then - FileDelete($tempoutdir & "\INST0*") - FileDelete($tempoutdir & "\WISE0*") - Else - FileMove($tempoutdir & "\INST0*", $outdir) - FileMove($tempoutdir & "\WISE0*", $outdir) - EndIf - MoveFiles($tempoutdir, $outdir, False, "", True) + Case 2 + RunWait($cmd & $wise_wun & ' "' & $filename & '" "' & $tempoutdir & '"', $filedir) + Local $removetemp = 1 + LoadPref("removetemp", $removetemp) + If $removetemp Then + FileDelete($tempoutdir & "\INST0*") + FileDelete($tempoutdir & "\WISE0*") + Else + FileMove($tempoutdir & "\INST0*", $outdir) + FileMove($tempoutdir & "\WISE0*", $outdir) + EndIf + MoveFiles($tempoutdir, $outdir, False, "", True) ; Extract using the /x switch - ElseIf $choice == 'Wise Installer /x' Then - RunWait(Warn_Execute($file & ' /x ' & $outdir), $filedir) + Case 3 + RunWait(Warn_Execute($file & ' /x ' & $outdir), $filedir) ; Attempt to extract MSI - ElseIf $choice == 'Wise MSI' Then - - ; Prompt to continue - _DeleteTrayMessageBox() - Prompt(48 + 4, 'WISE_MSI_PROMPT', 1) - - ; First, check for any files that are already in extraction dir - _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $arcdisp) - $oldfiles = ReturnFiles(@CommonFilesDir & "\Wise Installation Wizard") - - ; Run installer - Opt("WinTitleMatchMode", 3) - $pid = Run(Warn_Execute($file & ' /?'), $filedir) - While 1 - Sleep(10) - If WinExists("Windows Installer") Then - WinSetState("Windows Installer", '', @SW_HIDE) - ExitLoop - Else - If Not ProcessExists($pid) Then ExitLoop - EndIf - WEnd + Case 4 + ; Prompt to continue + _DeleteTrayMessageBox() + Prompt(48 + 4, 'WISE_MSI_PROMPT', 1) + + ; First, check for any files that are already in extraction dir + _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $arcdisp) + $oldfiles = ReturnFiles(@CommonFilesDir & "\Wise Installation Wizard") + + ; Run installer + Opt("WinTitleMatchMode", 3) + $pid = Run(Warn_Execute($file & ' /?'), $filedir) + While 1 + Sleep(10) + If WinExists("Windows Installer") Then + WinSetState("Windows Installer", '', @SW_HIDE) + ExitLoop + Else + If Not ProcessExists($pid) Then ExitLoop + EndIf + WEnd - ; Move new files - MoveFiles(@CommonFilesDir & "\Wise Installation Wizard", $outdir, 0, $oldfiles, True) - WinClose("Windows Installer") + ; Move new files + MoveFiles(@CommonFilesDir & "\Wise Installation Wizard", $outdir, 0, $oldfiles, True) + WinClose("Windows Installer") ; Extract using unzip, falling back to 7-Zip - ElseIf $choice == 'Unzip' Then - $return = RunWait($cmd & $zip & ' -x "' & $file & '"', $outdir) - If $return <> 0 Then - _Run($cmd & $7z & ' x "' & $file & '"', $outdir) - EndIf - EndIf + Case 5 + If RunWait($cmd & $zip & ' -x "' & $file & '"', $outdir) <> 0 Then _Run($cmd & $7z & ' x "' & $file & '"', $outdir) + EndSwitch ; Append missing file extensions If $appendext Then AppendExtensions($outdir) @@ -2879,7 +2872,7 @@ Func extract($arctype, $arcdisp = 0, $additionalParameters = "", $returnSuccess Case "zip" Local $sPassword = _FindArchivePassword($cmd & $7z & ' l -p -slt "' & $file & '"', $cmd & $7z & ' t -p"%PASSWORD%" "' & $file & '"', "Encrypted = +", "Wrong password?", 0, "Everything is Ok") - _Run($cmd & $7z & ' x ' & ($sPassword == 0? '"': '-p"' & $sPassword & '" "') & $file & '"', $outdir) + _Run($cmd & $7z & ' x ' & ($sPassword == 0? '"': '-p"' & $sPassword & '" "') & $file & '"', $outdir, @SW_HIDE, True, True, True) If @extended Then terminate('password', $file, $arcdisp) If $success <> $RESULT_SUCCESS Then _Run($cmd & $zip & ' -x "' & $file & '"', $outdir, @SW_MINIMIZE, False) @@ -2984,8 +2977,11 @@ EndFunc Func pluginExtract($sPlugin) Cout("Starting custom " & $sPlugin & " extraction") - Local $ret = $defdir & $sPlugin & ".ini" - If Not FileExists($ret) Then terminate('missingdef', $ret, '') + Local $ret = $userDefDir & $sPlugin & ".ini" + If Not FileExists($ret) Then + $ret = $defdir & $sPlugin & ".ini" + If Not FileExists($ret) Then terminate('missingdef', $ret, '') + EndIf Local Const $ret2 = "Extract" Local $sBinary = IniRead($ret, $ret2, "executable", $sPlugin) @@ -3106,7 +3102,7 @@ EndFunc ; Check write permissions for specified file or folder Func CanAccess($sPath) Local $bIsTemp = False - If Not FileExists($sPath) Then Return SetError(1) + If Not FileExists($sPath) Then Return SetError(1, 0, False) Cout("Checking permissions for path " & $sPath) If StringInStr(FileGetAttrib($sPath), "D") Then @@ -3142,8 +3138,7 @@ Func HasTranslation($language) EndFunc ; Check if enough free space is available -Func HasFreeSpace() - $sPath = $outdir +Func HasFreeSpace($sPath = $outdir) While Not StringInStr(FileGetAttrib($sPath), "D") $pos = StringInStr($sPath, "\", 0, -1) If $pos < 1 Then ExitLoop @@ -3424,128 +3419,58 @@ Func terminate($status, $fname, $ID) EndFunc ; Function to prompt user for choice of extraction method -Func MethodSelect($format, $splashdisp) - ; Set info base on format +Func MethodSelect($aData, $arcdisp) _DeleteTrayMessageBox() - Local $base_height = 130 - Local $base_radio = 100 - If $format == 'wise' Then - $select_type = 'Wise Installer' - Dim $method[5][2], $select[5] - $method[0][0] = 'E_Wise' - $method[0][1] = 'METHOD_UNPACKER_RADIO' - $method[1][0] = 'WUN' - $method[1][1] = 'METHOD_UNPACKER_RADIO' - $method[2][0] = 'Wise Installer /x' - $method[2][1] = 'METHOD_SWITCH_RADIO' - $method[3][0] = 'Wise MSI' - $method[3][1] = 'METHOD_EXTRACTION_RADIO' - $method[4][0] = 'Unzip' - $method[4][1] = 'METHOD_EXTRACTION_RADIO' - ;$base_height += 45 - ElseIf $format == 'msi' Then - $select_type = 'MSI Installer' - Dim $method[4][2], $select[4] - $method[0][0] = 'jsMSI Unpacker' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'MsiX' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - $method[2][0] = 'MSI TC Packer' - $method[2][1] = 'METHOD_EXTRACTION_RADIO' - $method[3][0] = 'MSI' - $method[3][1] = 'METHOD_ADMIN_RADIO' - ;$base_height += 15 - ;$base_radio += 15 - ElseIf $format == 'msp' Then - $select_type = 'MSP Package' - Dim $method[3][2], $select[3] - $method[0][0] = 'MSI TC Packer' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'MsiX' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - $method[2][0] = '7-Zip' - $method[2][1] = 'METHOD_EXTRACTION_RADIO' - ElseIf $format == 'mht' Then - $select_type = 'MHTML Archive' - Dim $method[2][2], $select[2] - $method[0][0] = 'ExtractMHT' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'MhtUnPack' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - ElseIf $format == 'is3arc' Then - $select_type = 'InstallShield 3.x Archive' - Dim $method[2][2], $select[2] - $method[0][0] = 'STIX' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'unshield' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - ElseIf $format == 'isexe' Then - $select_type = 'InstallShield Installer' - Dim $method[4][2], $select[4] - $method[0][0] = 'isxunpack' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'unshield' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - $method[2][0] = 'InstallShield /b' - $method[2][1] = 'METHOD_SWITCH_RADIO' - $method[3][0] = 'not InstallShield' - $method[3][1] = 'METHOD_NOTIS_RADIO' - ElseIf $format == 'iscab' Then - $select_type = 'InstallShield Cabinet' - Dim $method[2][2], $select[2] - $method[0][0] = 'iscab' - $method[0][1] = 'METHOD_EXTRACTION_RADIO' - $method[1][0] = 'is6comp' - $method[1][1] = 'METHOD_EXTRACTION_RADIO' - EndIf + Local $base_height = 130, $base_radio = 100 + Local $size = UBound($aData) - 1 + Local $select[$size] ; Auto choose first extraction method in silent mode If $silentmode Then Cout("Extractor selected automatically - run again in normal mode if not extracted correctly") - _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $splashdisp) - Return $method[0][0] + _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $arcdisp) + Return 1 EndIf ; Create GUI and set header information Opt("GUIOnEventMode", 0) - Local $guimethod = GUICreate($title, 330, $base_height + (UBound($method) * 20)) + Local $guimethod = GUICreate($title, 330, $base_height + ($size * 20)) _GuiSetColor() - $header = GUICtrlCreateLabel(t('METHOD_HEADER', $select_type), 5, 5, 320, 20) - GUICtrlCreateLabel(t('METHOD_TEXT_LABEL', $select_type), 5, 25, 320, 65, $SS_LEFT) + $header = GUICtrlCreateLabel(t('METHOD_HEADER', $aData[0]), 5, 5, 320, 20) + GUICtrlSetFont(-1, -1, 1200) + GUICtrlCreateLabel(t('METHOD_TEXT_LABEL', $aData[0]), 5, 25, 320, 65, $SS_LEFT) ; Create radio selection options - GUICtrlCreateGroup(t('METHOD_RADIO_LABEL'), 5, $base_radio, 215, 25 + (UBound($method) * 20)) - For $i = 0 To UBound($method) - 1 - $select[$i] = GUICtrlCreateRadio(t($method[$i][1], $method[$i][0]), 10, $base_radio + 20 + ($i * 20), 205, 20) + GUICtrlCreateGroup(t('METHOD_RADIO_LABEL'), 5, $base_radio, 215, 25 + ($size * 20)) + For $i = 0 To $size - 1 + $select[$i] = GUICtrlCreateRadio($aData[$i + 1], 10, $base_radio + 20 + ($i * 20), 205, 20) Next GUICtrlCreateGroup("", -99, -99, 1, 1) ; Create buttons - $ok = GUICtrlCreateButton(t('OK_BUT'), 235, $base_radio - 10 + (UBound($method) * 10), 80, 20) - $cancel = GUICtrlCreateButton(t('CANCEL_BUT'), 235, $base_radio - 10 + (UBound($method) * 10) + 30, 80, 20) + Local $idOk = GUICtrlCreateButton(t('OK_BUT'), 235, $base_radio - 10 + ($size * 10), 80, 20) + Local $idCancel = GUICtrlCreateButton(t('CANCEL_BUT'), 235, $base_radio - 10 + ($size * 10) + 30, 80, 20) ; Set properties - GUICtrlSetFont($header, -1, 1200) GUICtrlSetState($select[0], $GUI_CHECKED) - GUICtrlSetState($ok, $GUI_DEFBUTTON) - - ; Display GUI and wait for action + GUICtrlSetState($idOk, $GUI_DEFBUTTON) GUISetState(@SW_SHOW) + While 1 $nMsg = GUIGetMsg() Switch $nMsg ; Set extract command - Case $ok - For $i = 0 To UBound($method) - 1 + Case $idOk + For $i = 0 To $size - 1 If GUICtrlRead($select[$i]) == $GUI_CHECKED Then GUIDelete($guimethod) Opt("GUIOnEventMode", 1) - _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $splashdisp) - Return $method[$i][0] + _CreateTrayMessageBox(t('EXTRACTING') & @CRLF & $arcdisp) + Return $i + 1 EndIf Next ; Exit if Cancel clicked or window closed - Case $GUI_EVENT_CLOSE, $cancel + Case $GUI_EVENT_CLOSE, $idCancel If $createdir Then DirRemove($outdir, 0) terminate("silent", '', '') EndSwitch @@ -4206,23 +4131,26 @@ Func CheckUpdate($silent = False, $bCheckInterval = False) Cout("Checking for update") ; Save date of last check for update - SavePref('lastupdate', @YEAR & "/" & @MON & "/" & @MDAY) + $lastupdate = @YEAR & "/" & @MON & "/" & @MDAY + SavePref('lastupdate', $lastupdate) ; Universal Extractor - $return = _StringGetLine(_INetGetSource($updateURL & "?get=version&id=" & $ID), -1) + $return = _INetGetSource($updateURL & "?get=uniextract&version=" & $version & "&id=" & $ID) + If @error Then $silent? 0: MsgBox($iTopmost + 48, $title, t('UPDATECHECK_FAILED')) + + $aReturn = StringSplit($return, @CRLF) If @error Then $silent? 0: MsgBox($iTopmost + 48, $title, t('UPDATECHECK_FAILED')) + $return = $aReturn[1] + Cout("Local: " & $version) Cout("Server: " & $return) If StringLen($return) > 0 And $return <> $version Then Cout("Update available") $found = True - $sInfo = _INetGetSource($updateURL & "?get=info&id=" & $ID) - If Prompt(48 + 4, 'UPDATE_PROMPT', CreateArray($version, $return, @CRLF & $sInfo & @CRLF), 0) Then - $UEURL = _INetGetSource($updateURL & "?get=uniextract&version=" & $version & "&id=" & $ID) - If @error Or $UEURL = "" Then Return $silent? 0: MsgBox($iTopmost + 48, $title, t('UPDATE_FAILED')) - $return = Download($UEURL) + If Prompt(48 + 4, 'UPDATE_PROMPT', CreateArray($version, $return, $aReturn[0] > 2? $aReturn[2]: ""), 0) Then + $return = Download($aReturn[$aReturn[0]]) If $return == 0 Then Return ShellExecute($updater, Quote($return)) Exit @@ -4266,6 +4194,7 @@ Func _AfterUpdate() FileDelete($bindir & "faad.exe") FileDelete($bindir & "x86\flac.exe") FileDelete($bindir & "x64\flac.exe") + FileDelete($langdir & "Chinese.ini") ; Move files FileMove($bindir & "x86\sqlite3.dll", @ScriptDir) @@ -4697,13 +4626,13 @@ Func GUI_Prefs() Global $unicodecheckopt = GUICtrlCreateCheckbox(t('PREFS_CHECK_UNICODE_LABEL'), 10, 185, -1, 20) Global $appendextopt = GUICtrlCreateCheckbox(t('PREFS_APPEND_EXT_LABEL'), 10, 205, -1, 20) Global $NoBoxOpt = GUICtrlCreateCheckbox(t('PREFS_HIDE_STATUS_LABEL'), 10, 225, -1, 20) - Global $OpenOutDirOpt = GUICtrlCreateCheckbox(t('PREFS_OPEN_FOLDER_LABEL'), 10, 245, -1, 20) - Global $FeedbackPromptOpt = GUICtrlCreateCheckbox(t('PREFS_FEEDBACK_PROMPT_LABEL'), 10, 265, -1, 20) - Global $StoreGUIPositionOpt = GUICtrlCreateCheckbox(t('PREFS_WINDOW_POSITION_LABEL'), 10, 285, -1, 20) - Global $CheckGameOpt = GUICtrlCreateCheckbox(t('PREFS_CHECK_GAME_LABEL'), 10, 305, -1, 20) - Global $LogOpt = GUICtrlCreateCheckbox(t('PREFS_LOG_LABEL'), 10, 325, -1, 20) - Global $VideoTrackOpt = GUICtrlCreateCheckbox(t('PREFS_VIDEOTRACK_LABEL'), 10, 345, -1, 20) -;~ Global $TopmostOpt = GUICtrlCreateCheckbox(t('PREFS_TOPMOST_LABEL'), 10, 365, -1, 20) + Global $GameModeOpt = GUICtrlCreateCheckbox(t('PREFS_HIDE_STATUS_FULLSCREEN_LABEL'), 10, 245, -1, 20) + Global $OpenOutDirOpt = GUICtrlCreateCheckbox(t('PREFS_OPEN_FOLDER_LABEL'), 10, 265, -1, 20) + Global $FeedbackPromptOpt = GUICtrlCreateCheckbox(t('PREFS_FEEDBACK_PROMPT_LABEL'), 10, 285, -1, 20) + Global $StoreGUIPositionOpt = GUICtrlCreateCheckbox(t('PREFS_WINDOW_POSITION_LABEL'), 10, 305, -1, 20) + Global $CheckGameOpt = GUICtrlCreateCheckbox(t('PREFS_CHECK_GAME_LABEL'), 10, 325, -1, 20) + Global $LogOpt = GUICtrlCreateCheckbox(t('PREFS_LOG_LABEL'), 10, 345, -1, 20) + Global $VideoTrackOpt = GUICtrlCreateCheckbox(t('PREFS_VIDEOTRACK_LABEL'), 10, 365, -1, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) ; Source file options @@ -4722,6 +4651,7 @@ Func GUI_Prefs() GUICtrlSetTip($freeSpaceCheckOpt, t('PREFS_CHECK_FREE_SPACE_TOOLTIP')) GUICtrlSetTip($unicodecheckopt, t('PREFS_CHECK_UNICODE_TOOLTIP')) GUICtrlSetTip($appendextopt, t('PREFS_APPEND_EXT_TOOLTIP')) + GUICtrlSetTip($GameModeOpt, t('PREFS_HIDE_STATUS_FULLSCREEN_TOOLTIP')) GUICtrlSetTip($FeedbackPromptOpt, t('PREFS_FEEDBACK_PROMPT_TOOLTIP')) GUICtrlSetTip($CheckGameOpt, t('PREFS_CHECK_GAME_TOOLTIP')) GUICtrlSetTip($VideoTrackOpt, t('PREFS_VIDEOTRACK_TOOLTIP')) @@ -4735,6 +4665,7 @@ Func GUI_Prefs() If $checkUnicode Then GUICtrlSetState($unicodecheckopt, $GUI_CHECKED) If $appendext Then GUICtrlSetState($appendextopt, $GUI_CHECKED) If $NoBox Then GUICtrlSetState($NoBoxOpt, $GUI_CHECKED) + If $bHideStatusBoxIfFullscreen Then GUICtrlSetState($GameModeOpt, $GUI_CHECKED) If $OpenOutDir Then GUICtrlSetState($OpenOutDirOpt, $GUI_CHECKED) If $FB_ask Then GUICtrlSetState($FeedbackPromptOpt, $GUI_CHECKED) If $StoreGUIPosition Then GUICtrlSetState($StoreGUIPositionOpt, $GUI_CHECKED) @@ -4799,6 +4730,7 @@ Func GUI_Prefs_OK() $checkUnicode = Number(GUICtrlRead($unicodecheckopt) == $GUI_CHECKED) $freeSpaceCheck = Number(GUICtrlRead($freeSpaceCheckOpt) == $GUI_CHECKED) $appendext = Number(GUICtrlRead($appendextopt) == $GUI_CHECKED) + $bHideStatusBoxIfFullscreen = Number(GUICtrlRead($GameModeOpt) == $GUI_CHECKED) $OpenOutDir = Number(GUICtrlRead($OpenOutDirOpt) == $GUI_CHECKED) $FB_ask = Number(GUICtrlRead($FeedbackPromptOpt) == $GUI_CHECKED) $Log = Number(GUICtrlRead($LogOpt) == $GUI_CHECKED) @@ -5510,6 +5442,7 @@ Func GUI_FirstStart() If @error Then MsgBox(16, $name, "No language file was found. Please redownload " & $name & ".") SavePref("ID", "") + GUI_Website_Github() Exit 99 EndIf Global $FS_Texts[UBound($FS_Sections)] = [ _ @@ -5590,7 +5523,7 @@ EndFunc ;==>GUI_FirstStart_Exit Func GUI_Plugins() ; Define plugins ; executable|name|description|filetypes|url|filemask|extractionfilter|outdir|password - Local $aPluginInfo[11][9] = [ _ + Local $aPluginInfo[12][9] = [ _ [$arc_conv, 'arc_conv', t('PLUGIN_ARC_CONV'), 'nsa, rgss2a, rgssad, wolf, xp3, ypf', 'http://honyaku-subs.ru/forums/viewtopic.php?f=17&t=470', 'arc_conv_r*.7z', 'arc_conv.exe', '', 'I Agree'], _ [$thinstall, 'h4sh3m Virtual Apps Dependency Extractor', t('PLUGIN_THINSTALL'), 'exe (Thinstall)', 'http://hashem20.persiangig.com/crack%20tools/Extractor.rar', 'Extractor.rar', '', '', 'h4sh3m'], _ [$iscab, 'iscab', t('PLUGIN_ISCAB'), 'cab', False, 'iscab.exe;ISTools.dll', '', '', 0], _ @@ -5601,12 +5534,12 @@ Func GUI_Plugins() [$mpq, 'MPQ Plugin', t('PLUGIN_MPQ'), 'mpq', 'http://www.zezula.net/download/wcx_mpq.zip', 'wcx_mpq.zip', 'mpq.wcx|mpq.wcx64', '', 0], _ [$ci, 'CreateInstall Extractor', t('PLUGIN_CI', CreateArray("ci-extractor.exe", "gea.dll", "gentee.dll")), 'exe (CreateInstall)', 'http://www.createinstall.com/download-free-trial.html', 'ci-extractor.exe;gea.dll;gentee.dll', '', '', 0], _ [$dgca, 'DGCA', t('PLUGIN_DGCA'), 'dgca', 'http://www.emit.jp/dgca/dgca_v110.zip', 'dgca_v*.zip', 'dgcac.exe', '', 0], _ - [$bootimg, 'bootimg', t('PLUGIN_BOOTIMG'), 'boot.img', 'http://forum.xda-developers.com/redmi-1s/general/guide-unpack-repack-kernel-t2908458', 'unpack_repack_kernel_redmi1s.zip', 'bootimg.exe', '', 0] _ + [$bootimg, 'bootimg', t('PLUGIN_BOOTIMG'), 'boot.img', 'http://forum.xda-developers.com/redmi-1s/general/guide-unpack-repack-kernel-t2908458', 'unpack_repack_kernel_redmi1s.zip', 'bootimg.exe', '', 0], _ + [$is5cab, 'is5comp', t('PLUGIN_IS5COMP'), 'cab (InstallShield)', 'ftp://ftp.elf.stuba.sk/pub/pc/pack/i5comp21.rar', 'i5comp21.rar', 'I5comp.exe|ZD50149.DLL|ZD51145.DLL', '', 0] _ ] Local Const $sSupportedFileTypes = t('PLUGIN_SUPPORTED_FILETYPES') Local $current = -1, $sWorkingdir = @WorkingDir, $aReturn[0] FileChangeDir(@UserProfileDir) -;~ _ArrayDisplay($aPluginInfo) $GUI_Plugins = GUICreate($name, 410, 167, -1, -1, -1, -1, $guimain) _GuiSetColor() @@ -5658,6 +5591,14 @@ Func GUI_Plugins() Cout("Plugin file selected: " & $return) If $aPluginInfo[$current][7] = "" Then $aPluginInfo[$current][7] = $bindir + ; Check permissions + If Not CanAccess($aPluginInfo[$current][7]) Then + If IsAdmin() Then MsgBox($iTopmost + 64, $title, t('ACCESS_DENIED')) + MsgBox($iTopmost + 64, $title, t('ELEVATION_REQUIRED')) + ShellExecute($updater, "/pluginst") + terminate("silent", '', '') + EndIf + ; Determine filetype $ret = StringRight($return, 3) If $ret = ".7z" Or $ret = "rar" Or $ret = "zip" Then ; Unpack archive diff --git a/UniExtractUpdater.au3 b/UniExtractUpdater.au3 index ac0580e..1b76ffc 100644 --- a/UniExtractUpdater.au3 +++ b/UniExtractUpdater.au3 @@ -17,24 +17,25 @@ ; Script Start - Add your code below here Const $sTitle = "Universal Extractor Updater" -Const $sUniExtract = "UniExtract.exe" +Const $sUniExtract = @ScriptDir & "\UniExtract.exe" If Not FileExists($sUniExtract) Then Exit MsgBox(16, $sTitle, "Universal Extractor main executable not found in current directory.") If $cmdline[0] < 1 Then Exit ShellExecute($sUniExtract, "/update") -If Not FileExists($cmdline[1]) Then Exit MsgBox(16, $sTitle, "Invalid update package passed to updater.") $OSArch = @OSArch = 'X64'? 'x64': 'x86' If $cmdline[0] == 2 Then _UpdateFFMPEG() +ElseIf $cmdline[1] == "/pluginst" Then + Exit ShellExecute($sUniExtract, "/plugins") Else - _UpdateUniExtract() + If Not FileExists($cmdline[1]) Then Exit MsgBox(16, $sTitle, "Invalid update package passed to updater.") + _UpdateUniExtract() EndIf Func _UpdateUniExtract() If Not ProcessWaitClose($sUniExtract, 10) Then Exit MsgBox(16, $sTitle, "Failed to close Universal Extractor. Please terminate the process manually and try again.") $sCmd = @ScriptDir & '\bin\' & $OSArch & '\7z.exe x -y -xr!UniExtract.ini -o"' & @ScriptDir & '" "' & $cmdline[1] & '"' - ;~ MsgBox(262144, 'Debug line ~' & @ScriptLineNumber, 'Selection:' & @CRLF & '$sCmd' & @CRLF & @CRLF & 'Return:' & @CRLF & $sCmd) ;### Debug MSGBOX RunWait($sCmd) Sleep(100) FileDelete($cmdline[1]) diff --git a/changelog.txt b/changelog.txt index 7ff4417..67618dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -66,10 +66,12 @@ Added support for .swf files using swfextract (slow) Added support for .uif image files using uif2iso Added support for .daa, .gbi image files using daa2iso + Added support for ISO zipped image files using unisz Added support for CreateInstall installers (plugin) Added support for DGCA compressed files (plugin) Added support for Android boot images (plugin) Added support for Advanced Installer installers + Added support for Excelsior Installer executables Added support for various CD/DVD image files (bin/cue, img, nrg, c2d, xbox iso, cdi) using iso.wcx plugin Added support for ThinApp/Thinstall portable software using h4sh3m Virtual Apps Dependency Extractor (plugin, experimental) Added support for audio decompression to wav using FFmpeg @@ -140,7 +142,7 @@ Removed nrg2iso Removed cdirip Removed debug file options - Removed i3comp & i5comp due to ZD*.dll license problems + Removed i3comp Removed remove temp option from GUI (can still be set via ini file) Removed remove dupe option from GUI (it did not do anything) Removed many options from installer as they are set on first start diff --git a/changelog_minor.txt b/changelog_minor.txt index 3a05e90..4bff959 100644 --- a/changelog_minor.txt +++ b/changelog_minor.txt @@ -1,13 +1,18 @@ Beta 3: + + Beta 3 brings a brand new updater, fixes several errors related to missing permissions + and adds 8 formats to the list of extractable files. + Added support for .mp3, .wmv and .wma files Added support for bcm compressed files using bcm Added support for zpaq archives using zpaq Added support for Android boot images using bootimg (plugin) Added support for Excelsior Installer executables - Added support for ISO zipped using unisz + Added support for ISO zipped image files using unisz Added status box to sfx script extraction Added output directory permission check Added update summary to update prompt + Added back is5comp (plugin) Changed .exe detection logic for speed improvements Changed file type detection: TrIDLib is now used for extraction, TrID for scan only mode, the library version is much faster but returns less additional information @@ -23,6 +28,7 @@ Beta 3: Fixed helper binaries execution failing if %comspec% environment variable is unset Fixed .pea detection Fixed .chm extraction + Fixed .mht detection Fixed FreeArc extraction Fixed AdvancedInstaller extraction Fixed registry keys are now being deleted after scanning if they did not exist before for ExeInfo, PEid @@ -41,6 +47,7 @@ Beta 3: Fixed syntax help dialog closing automatically Fixed possible false positives when using checkNSIS function Fixed password detection for some .rar files + Fixed some untranslated terms in MethodSelect GUI Removed globalprefs option and preference storage in registry Removed faad and flac, extraction is now handled by FFMPEG Removed unnecessary input file moves diff --git a/def/arc.ini b/def/arc.ini new file mode 100644 index 0000000..a3eba50 --- /dev/null +++ b/def/arc.ini @@ -0,0 +1,15 @@ +[Display] +display=ARC +displayTypeTranslation=TERM_ARCHIVE + +[Extract] +useCmd=1 +executable=arc.exe +parameters=x %file +hide=1 +log=1 +patternSearch=0 +initialShow=0 + +[List] +parameters= \ No newline at end of file diff --git a/def/flv.ini b/def/flv.ini new file mode 100644 index 0000000..4316d55 --- /dev/null +++ b/def/flv.ini @@ -0,0 +1,12 @@ +[Display] +display=Flash Video +displayTypeTranslation=TERM_CONTAINER + +[Extract] +useCmd=1 +executable=FLVExtractCL.exe +parameters=-v -a -t -d %outdir %file +hide=1 +patternSearch=0 +initialShow=0 +workingdir=%filedir \ No newline at end of file diff --git a/def/lit.ini b/def/lit.ini new file mode 100644 index 0000000..f5dc698 --- /dev/null +++ b/def/lit.ini @@ -0,0 +1,15 @@ +[Display] +display=Microsoft LIT +displayTypeTranslation=TERM_EBOOK + +[Extract] +useCmd=1 +executable=clit.exe +parameters=%file %outdir +hide=1 +log=1 +patternSearch=0 +initialShow=0 + +[List] +parameters= \ No newline at end of file diff --git a/def/registry.ini b/def/registry.ini new file mode 100644 index 0000000..fdc2923 --- /dev/null +++ b/def/registry.ini @@ -0,0 +1,27 @@ +; Detectied file type for TrID and Unix file tool, format: +; Definition File=Filetype + +[Trid] +arc=ARC Compressed archive +flv=Flash Video +lit=Microsoft Reader eBook + +[File] +arc=ARC archive data +flv=Macromedia Flash Video +lit=Microsoft Reader eBook Data +uu=uuencoded + +; File extension fallback, format: +; Extension=Definition file + +[Extensions] +arc=arc +flv=flv +lit=lit +msi=msi +uu=uu +uue=uu +wolf=arc_conv +xx=uu +xxe=uu \ No newline at end of file diff --git a/def/uu.ini b/def/uu.ini new file mode 100644 index 0000000..1adcd96 --- /dev/null +++ b/def/uu.ini @@ -0,0 +1,12 @@ +[Display] +display=UUencode +displayTypeTranslation=TERM_ENCODED + +[Extract] +useCmd=1 +executable=uudeview.exe +parameters=-p %outdir -i %file +hide=1 +patternSearch=0 +initialShow=0 +workingdir=%filedir \ No newline at end of file diff --git a/lang/German.ini b/lang/German.ini index 0b42d0dbdcfc0d47f0b2e8c3ee4d14e70d663eed..b9be83c6f6e44e5f994ac8cd377410d36f20cf62 100644 GIT binary patch delta 835 zcma)4O=}ZT6g{!h4{Z`+h-nn*5TmtVi!F#CD1U#LP>&03| zo@NH36S#=8v?6ktf+>GuDOt(%4_45^9T=#f28-Vk&o-^XlZ~o;&I~Dhd=nlf&P(WE zDp|xWX4aV7B(jQGc&suaOT)>KFNH^Y=d1eOU}qm?y2|KuJmRT5!O)|@+H(5bf3>Hg$ zq1XscF{lDcii1&kbIFqTZzHl|cgyjadXLiq1&cF}TTzp9G&!j(rjbWMejeMm|1x_v zSldFKW@z@V=3_Cgxcd@XPRhXDUD+nHe67XB4g8?1)@lY*{9ga>td!0&t}3V*DE7>i zayu@+U!~`jW=|t*P5q0mQ(dp!LHig*8e!}p-yF^4OB8X9lKF<@Z}QK;33?h^P{C>k z*j2lPmv{Eev9rrfX)nZwwx~>Ao=i!-9g(X~#^v6#UOD})KdDABCzbZNA>4#o^!^CV{^;Z1~vd@ksJ~L diff --git a/todo.txt b/todo.txt index 88890fd..c550761 100644 --- a/todo.txt +++ b/todo.txt @@ -19,15 +19,18 @@ gif, apng http://tlwiki.org/index.php?title=Tools // New formats -100.0% (.ISZ) ISo Zipped format (4000/1) + + +// Extraction logic updates +Add cleanup function call if necessary +Disable _Run function's pattern search for extractors that do not provide percentage indicators +Use definition files if possible // Usability: statistics GUI http://www.autoitscript.com/forum/topic/161750-pie-chart/ inno: percentage indicator fixed? arj percentage indicator //tee problem -Zip extraction: 'User input needed' message does not disappear -cleanup after extraction, e.g. {app} // Bugs @@ -35,12 +38,12 @@ jsmsi: .cab not found (working dir?) qbms process seems to hang (with increased cpu usage) on large files with gaup_pro plugin (confirmed for null bytes, image file; might continue after a long time?) Extracting to C:/ creates file in @ScriptDir Unicode files are not moved to outdir if using unpack() function +$is6cab extractor might crash ('... is not working anymore'), resulting in batch processing stop // Other: Logging: quickbms, Crage additional file types for arc_conv, ffmpeg -Disable _Run function's pattern search for extractors that do not provide percentage indicators // Short term @@ -52,7 +55,6 @@ include tridscan gui? ntlea? - // Known bugs: Converting to iso failes when iso file already exists (helper binary not terminating correctly) Overwriting files in general depends on extractor (sometimes asks, sometimes overwrites without asking)