AutoHotkey Community

It is currently May 26th, 2012, 6:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: June 6th, 2007, 3:53 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
It provides a basic zip/unzip support in XP using the native ZipFolder support.
Naturally, the ZipFolder should be enabled for the script to work (regsvr32.exe /s zipfldr.dll).

The example in the script does:
zipping this script/CoHelper.ahk/FileHelper.ahk to script.zip in the temporary folder, then unzipping it in the temporary folder.

DOWNLOAD ZipFolder.ahk and CoHelper.ahk and FileHelper.ahk.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: great!
PostPosted: May 17th, 2008, 2:34 pm 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
great work..
exactly what i was looking for..

but unzip does not seem to work! am i missing something?

_________________
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: great!
PostPosted: May 17th, 2008, 3:29 pm 
Offline

Joined: July 29th, 2005, 5:32 pm
Posts: 179
shajul wrote:
am i missing something?
Yes. :D
Works fine here. What code are you using?

_________________
.o0[ corey ]0o.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Thanks!!
PostPosted: May 17th, 2008, 5:40 pm 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
Thanks for your prompt reply!

Works fine now! some bug in my system maybe :(

thanks again!

_________________
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2008, 6:57 pm 
Wow!

:D 8)

but, how the ... did I miss this excellent script? :shock:

Quote:
Wed Jun 06, 2007


Report this post
Top
  
Reply with quote  
PostPosted: August 11th, 2008, 11:12 pm 
Hello!

Apologies for barging in. I'm trying to find a simple, preferrably open-source solution to unpack a zip from within an ahk script - eventually a compiled script, more of an installer, that could be freely distributed.

Problem is, I need this to work in all Windows versions from Win95 to Vista, so relying on XP's built-in code is not an option. Could anyone kindly offer some tips in this regard? Thank you!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 12th, 2008, 1:11 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
perfect

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 14th, 2008, 12:23 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Very useful, many thanks.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2008, 7:49 pm 
Hi, is there anyway possible to have Password protection for the zip, for this process? :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 3rd, 2010, 6:49 pm 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
Noticed since most of us have moved to COM stdlib, it may help someone looking for an updated version

Code:
Zip(sDir, sZip)
{
   If Not FileExist(sZip)
   {
      VarSetCapacity(Header, 22, 0)
      Header := "PK" . Chr(5) . Chr(6)
      ReadMemory(sZip, &Header, 22)
   }
   psh  := COM_ActiveXObject("Shell.Application")
   pzip := COM_Invoke(psh, "Namespace", sZip)
   COM_Invoke(pzip, "CopyHere", sDir, 4|16)
   Sleep,   1000
   COM_Release(pzip)
   COM_Release(psh)
}

Unz(sZip, sUnz)
{
   psh  := COM_ActiveXObject("Shell.Application")
   pzip := COM_Invoke(psh, "Namespace", sZip)
   punz := COM_Invoke(psh, "Namespace", sUnz)
   pitms:= COM_Invoke(pzip, "Items")
   COM_Invoke(punz, "CopyHere", "+" . pitms, 4|16)
   Sleep,   1000
   COM_Release(pitms)
   COM_Release(pzip)
   COM_Release(punz)
   COM_Release(psh)
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2010, 3:37 am 
Offline

Joined: December 12th, 2009, 3:13 am
Posts: 15
n-l-i-d wrote:
Wow!

:D 8)

but, how the ... did I miss this excellent script? :shock:

Quote:
Wed Jun 06, 2007


Likewise!

Thx sean and free radical


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 4th, 2010, 3:10 pm 
Mhh, your version, sadly, doesn't work, Free Radical. :(

Quote:
Function Name: "Namespace"
Error: The COM Object may not be a valid one!


Get the same error with "CopyHere".[/quote]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 1:07 pm 
Offline

Joined: August 14th, 2007, 12:11 pm
Posts: 86
I had the same problem and the reason was that path you want to extract in must exist, zip file must exist and be careful how you parse variable to the function. if you are having problems please post your script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2010, 2:25 pm 
Offline

Joined: September 20th, 2006, 2:05 pm
Posts: 73
Dreck wrote:
Mhh, your version, sadly, doesn't work, Free Radical. :(

Quote:
Function Name: "Namespace"
Error: The COM Object may not be a valid one!


Get the same error with "CopyHere".


works for me :cry:

Still needs FileHelper.ahk.
Don't forget to #include it.

Also, the sDir must exist, so just use FileSelectFolder to create the folder to zip to, before calling the function,
or add it to the function.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2010, 7:30 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5477
Location: the tunnel(?=light)
Full credit for re-writing these functions for AutoHotkey_L and COM_L goes to answer4u, I removed the Sleep commands as I believe they were related to the timing of the manual release of COM objects in the original, which is no longer necessary in COM_L:

Code:
Zip(sDir, sZip)
{
   If Not FileExist(sZip)
   {
      VarSetCapacity(Header, 22, 0)
      Header := "PK" . Chr(5) . Chr(6)
      ReadMemory(sZip, &Header, 22)
   }
  COM_CreateObject( "Shell.Application" ).Namespace( sZip ).CopyHere( sDir, 4|16 )

}

Unz(sZip, sUnz)
{
   psh  := COM_CreateObject("Shell.Application")
   psh.Namespace( sUnz ).CopyHere( psh.Namespace( sZip ).items, 4|16 )

}

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], mrhobbeys, nothing, siterip, Stigg and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group