Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D5605200BB9 for ; Sun, 23 Oct 2016 15:29:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D41FE160AFC; Sun, 23 Oct 2016 13:29:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 07B32160AD8 for ; Sun, 23 Oct 2016 15:28:59 +0200 (CEST) Received: (qmail 38543 invoked by uid 500); 23 Oct 2016 13:28:59 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 38509 invoked by uid 99); 23 Oct 2016 13:28:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2016 13:28:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D705DC04D6 for ; Sun, 23 Oct 2016 13:28:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kyf_0j8A7yzG for ; Sun, 23 Oct 2016 13:28:55 +0000 (UTC) Received: from mail-yb0-f181.google.com (mail-yb0-f181.google.com [209.85.213.181]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id E4A885F1BE for ; Sun, 23 Oct 2016 13:28:54 +0000 (UTC) Received: by mail-yb0-f181.google.com with SMTP id 191so57262901ybv.3 for ; Sun, 23 Oct 2016 06:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=bK46J2BGKIGzUHf+3F8HQxxYNR9zF0tUlr5+e6jHzHk=; b=QZOKdxIgLsEOohVOzMB9+t5aPfBgYWNnHLS2r1fY+TCrLgGmj9K32H/n+wW6qCY9aa yqnWQ3/A/XuwjeTjKUvwawnuCHuhfTvZ+bIplf33GckIgIcbgFHQfsvZXF6no9zVC3FS vN9Y8fkT8npF8Km4uP8UgjhPb97Mo5/RnLe2MQwxwT/xTnr8YuQ0llAFjDUZZI5iPLjz /PjWRlUBgjgzzBeZCGKRPy4Pwjin2HLAL9Is9kys0eykoqJBDaKENBpRnW2zWqxll3QG j79f0aO2bQn8CeIxIVvbu+ulVx+6B0WSPMd+HcmmW/x7IAlbjKzUyM8EVuIeIbCWYAeW JdoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=bK46J2BGKIGzUHf+3F8HQxxYNR9zF0tUlr5+e6jHzHk=; b=jX/eOZtZ6n9l4Vwp2ax2coDcpPForEOUJVhwNHJ+DGJTAqMOuZCIPeG4tbLT3XS1wG x6mr5R9YAqgACzyN6uwhqZcRK7bqfrrtkLwbIXqXq5gOx2aGu84MGAsqv9cv7oV/gx/T uD+Aas421PLlmvormludwFhFgUUUBUEQ13nYdsilVnB9ef2Nmy4TBDKryZsXJXrNGfoh 8VCOvRHVA02x0/Q8J8Zp9JwIeUD2+PE52tBB/SxeUOUg/5p6b3M5avzdFIjKyuQ8V3s6 Vvm9Wvld6u1GmXNYdcCZZUn2zQdlTFcNRN1vs0zbX5f3q2/4vV1sbUXjbIUgWVYg9/wd 0ZbA== X-Gm-Message-State: ABUngvcvBSmABeybR97CuP27IFp9h5aVhlQ6uf2v6n+aPRgRvF1jzDUna4XyeZjpirdHgFvNgbKgKBYOFub/Rg== X-Received: by 10.37.172.155 with SMTP id x27mr10767736ybi.137.1477229334345; Sun, 23 Oct 2016 06:28:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.115.69 with HTTP; Sun, 23 Oct 2016 06:28:53 -0700 (PDT) In-Reply-To: References: <11203804-40e6-e9d9-2eed-f9f2d2e8bdcc@vservu.de> From: =?UTF-8?Q?Fr=C3=A9deric_Cox?= Date: Sun, 23 Oct 2016 15:28:53 +0200 Message-ID: Subject: Re: Unzip ANE for Flex\AIR Desktop App To: users@flex.apache.org Content-Type: multipart/alternative; boundary=f403045db890b9c0de053f884166 archived-at: Sun, 23 Oct 2016 13:29:01 -0000 --f403045db890b9c0de053f884166 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can use File.applicationDirectory and put the 7za.exe in your project folder. I placed it in /native_bin/win/7za.exe. Make sure the file has "execute" permissions (right-click for properties of the file in Flash Builder). I have defined it as NativeProgramsSettings.UNZIP =3D File.applicationDirectory.resolvePath("native_bin/win/7za.exe"); for Windows and NativeProgramsSettings.UNZIP =3D File.applicationDirectory.resolvePath("native_bin/mac/7za"); for Mac (depending on Capabilities.OS) Then for unzipping (I don't use zip functionality in my app) it is as follows: private function unzipNative(zipFile:File):void{ this.dispatchEvent(new Event("indicatorShowRequest")); var targetDir:File =3D File.applicationStorageDirectory.resolvePath("unzipp= ed" ); targetDir.createDirectory(); targetDir =3D targetDir.resolvePath("unzip_" + new Date().time + "_" + Math.round(Math.random()*10000)); targetDir.createDirectory(); tempDirectoryForZip =3D targetDir; var npInfo:NativeProcessStartupInfo =3D new NativeProcessStartupInfo; npInfo.executable =3D NativeProgramsSettings.UNZIP; var args:Vector. =3D new Vector.; args.push("x"); args.push(zipFile.nativePath); args.push("-r"); args.push("-o" + targetDir.nativePath); npInfo.arguments =3D args; var np:NativeProcess =3D new NativeProcess; np.addEventListener(NativeProcessExitEvent.EXIT, npUnzipExitHandler); np.start(npInfo); } For zip you need to have different arguments of course. You can check by googling "7za command line". Hope it works for you On Fri, Oct 21, 2016 at 8:23 AM, Deepak MS wrote= : > Interesting. I never knew about that. Doesn't that mean user needs to hav= e > 7za installed on their systems? If so, what if users don't have it > installed. Can we package the 7za.exe within our AIR app and use it? > > I looked into some of the examples. But not quite getting it to work: > > Same code with pretty print : https://codepaste.net/82gk2q > > > if(NativeProcess.isSupported) > { > var nativeProcessStartupInfo:NativeProcessStartupInfo =3D new > NativeProcessStartupInfo(); > var file:File =3D new File('c://zip//7za.exe'); //instead of using it fro= m > local file system, i want to place exe file withing source and use it her= e > nativeProcessStartupInfo.executable =3D file; > var processArgs:Vector. =3D new Vector.(); > processArgs.push("7z e file.zip");//+localZipFile.nativePath); > //"file.zip" > resides inside "c://zip//", tried "7za e file.zip", tried "7za.exe > file.zip", none of those work > nativeProcessStartupInfo.arguments =3D processArgs; > process =3D new NativeProcess(); > process.start(nativeProcessStartupInfo); > process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, > onOutputData); > process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData); > process.addEventListener(NativeProcessExitEvent.EXIT, onExit); > process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, > onIOError); > process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError)= ; > } > > For all the options that i tried above, I get following trace: > > (onOutputData) > Got: > 7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 > > (onErrorData) > Error: > Incorrect command line > > (onExit) > Process exited with 7 > > > Kindly let me know if I am missing something there. > > On Thu, Oct 20, 2016 at 6:53 PM, Fr=C3=A9deric Cox > wrote: > > > I successfully used 7za for both Mac and Windows. You don't need a nati= ve > > extension for desktop but you can just use the NativeProcess API with t= he > > extendedDesktop profile. > > > > On Thu, Oct 20, 2016 at 10:48 AM, Deepak MS > > wrote: > > > > > Hi Hans, > > > Yes, I did try that. It works fine for smaller files. But > unfortunately, > > > unzipping process crashes if we use it for bigger files. My zip file > size > > > is around 500MB. It fails at ByteArray.uncompress() as it tries to > > > uncompress entire file at a time. That is the reason I was looking ou= t > > for > > > native way of unzipping the file. > > > > > > For iOS, I have used ANEZipFile library : > > > https://github.com/xperiments/ANEZipFile > > > > > > It works flawlessly and takes just 5 - 6 seconds to unzip a 500MB zip > > file. > > > That is just for iOS though. > > > > > > There is another library: > > > http://airnativeextensions.com/extension/com.distriqt.ZipUtils which > > works > > > on both iOS and Android, but it's not free. > > > > > > -Deepak > > > > > > > > > On Thu, Oct 20, 2016 at 1:49 PM, Hans Nuecke > wrote: > > > > > > > Hi, > > > > > > > > I use an openSource Library for that: http://flex.coltware.com/2010= / > > > > 05/01/as3-zip-unzip-lib-airxzip/ > > > > > > > > Search for keywords "coltware airxzip" and you'll find some nice > posts > > at > > > > stackoverflow with links to the sources or a swc file. And also hin= ts > > how > > > > to use it. > > > > > > > > BTW: What unzipt ANE are you using? I'm considering going the other > > way: > > > > convert my desktop APP (or better: parts of it) to an iOS/Android a= pp > > > > > > > > Regards > > > > > > > > Hans > > > > > > > > > > > > > > > > > > > > Am 20.10.2016 um 06:48 schrieb Deepak MS: > > > > > > > >> Hi there, > > > >> > > > >> I have converted an iPad app to Desktop App ( to make it work on > > surface > > > >> pro, touch based desktop). iPad App was using an unzip ANE. But it > > > cannot > > > >> be used for desktop app. > > > >> > > > >> I tried searching unzip ANEs for windows, but I couldn't come acro= ss > > > any. > > > >> > > > >> There are C libraries like zlib and minizip. I tried creating ANE > > > myself ( > > > >> http://easynativeextensions.com/windows-tutorial-the- > > > native-dll-project/ > > > >> ), but I end up getting many errors. I'm not good at C coding. > > > >> > > > >> Or if anyone is interested to take this up as a project, company i= s > > > happy > > > >> to outsource this piece of work at a cost. > > > >> > > > >> Kindly let me know about it. > > > >> > > > >> Cheers! > > > >> Deepak > > > >> > > > >> > > > > -- > > > > > > > > ___________________________________________________________________ > > > > > > > > *Hans J. Nuecke* / Gorch-Fock-Str. 6 =E2=80=A2 81827 Muenchen =E2= =80=A2 Germany / > > *VservU > > > > GmbH* > > > > Home: +49 (89) 45344858 > office: > > > > +49 (89) 43906 707 > > > > mobile: +49 (176) 56529048 > > > > private: hans@nuecke.de > > > business: > > > > hnuecke@vservu.de > > > > website: www.vservu.de www.megazine3.de < > > > > http://megazine3.de> > > > > Munich HRB 181251 Gesch=C3=A4ftsf=C3=BChrer: Hans J. N=C3= =BCcke USt-Id: > > > > DE266694113 > > > > ___________________________________________________________________ > > > > > > > > > > > > > > --f403045db890b9c0de053f884166--