View Full Version : ams zip fonctions
goukilord10
01-13-2006, 06:26 AM
is it possible for ams run time alone to open a sfx zip archive(like the one it create at publishing) and add to it a file ?
if not anyone know a command line free zip tool capable of this ?
thanks.
playmenow
04-06-2006, 11:45 PM
I would recommend using ace archives, because on www.winace.com there is a DLL that will be very useful ;)
bobbie
04-07-2006, 12:30 AM
7-Zip (http://www.7-zip.org/) has a command line exe that will zip and unzip files and it is open source so free to use in your projects.
Corey
04-07-2006, 12:30 AM
7-zip rules. :yes
azmanar
04-07-2006, 01:33 AM
Bobbie,
Does this mean that I can send values from variables via Shell.Execute directly to 7zip.exe (located in an Autoplay Folder ) and I still remain in AMS app?
bobbie
04-07-2006, 01:38 AM
I did it with autohotkey so I don't see why you can't.
azmanar
04-07-2006, 01:51 AM
I did it with autohotkey so I don't see why you can't.
I dont understand.
bobbie
04-07-2006, 01:54 AM
I haven't tried it yet with ams so just try it and see what happens. nothing to lose.
Bobbie, what are the command lines? Didn't find any in the source website..
bobbie
04-07-2006, 02:09 AM
There is a chm for the commandline .
Command Line Syntax
7z <command> [<switch>...] <base_archive_name> [<arguments>...]
<arguments> ::= <switch> | <wildcard> | <filename> | <list_file>
<switch>::= <switch_symbol><switch_characters>[<option>]
<switch_symbol> ::= '/' | '-'
<list_file> ::= @{filename}
Expressions in square brackets (between '[' and ']') are optional.
Expressions in curly braces ('{' and '}') means that instead that Expression (including braces) must be used some string.
Expression
expression1 | expression2 | ... | expressionN
means that any (but only one) from these expressions must be specified.
Commands and switches can be entered in upper or lower case.
Command is the first non-switch argument.
The "base_archive_name" must be the first filename on the command line after the command.
The switches and other filenames can be in any order.
Wildcards or filenames with spaces must be quoted:
"Dir\Program files\*"
Dir\"Program files"\*
Switch options can be combined to save command line length. However, some switch options take optional string arguments and therefore, must be the last option in a combined argument token string because 7-Zip accepts the rest of the argument token as the optional argument.
7-Zip uses wild name matching similar to Windows 95:
'*' means a sequence of arbitrary characters.
'?' means any character.
7-Zip doesn't uses system wildcard mask parser, and 7-Zip doesn't follow that archaic rule, when *.* means any file. 7-Zip treats *.* as any file that have extension. To process all files you must use * wildcard.
Examples:
*.txt means all files with an extension of ".txt"
?a* means all files with a second character of "a"
*1* means all names that contains character "1"
*.*.* means all names that contain two "." means characters
The default wildcard "*" will be used if there is no filename/wildcard in command line.
Slash ('\') at the end of path means directory. Without Slash ('\') at the end of path it can refer to both file and directory.
List file
You can supply one or more filenames or wildcards for special list files (files containing lists of files). The filenames in such list file must be separated by space, tab or new line symbol(s). Wildcards or filenames with spaces must be quoted.
For list files 7-Zip uses OEM (DOS) encoding.
Multiple list files are supported.
For example, if contents of file "listfile.txt" is the following:
"My programs\*.cpp"
Src\*.cpp
then command
7z a -tzip archive.zip @listfile.txt
adds to archive "archive.zip" all "*.cpp" files from directories "My programs" and "Src".
Short and Long File Names
7-Zip supports short file names (like FILENA~1.TXT) in some cases. But it's strongly recommended to use real (long) file names.
bobbie
04-07-2006, 02:13 AM
a (Add) command
Adds files to archive.
Examples
7z a -tzip archive.zip subdir\*
adds all files from directory subdir to archive archive.zip.
7z a -tzip Files.zip "Program files\*" -r
adds all files from directory Program to archive Files.zip.
Switches that can be used with this command
-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-t (Type of archive)
-u (Update)
-v (Volumes)
d (Delete) command
Deletes files from archive.
Example
7z d archive.zip *.bak -r
deletes *.bak files from archive archive.zip.
Switches that can be used with this command
-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-u (Update)
-w (Working Dir)
-x (Exclude)
See also
Commands: a (Add), u (Update)
Switches: -u (Update)
e (Extract) command
Extracts files from archive to the current directory or to the output directory. Output directory can be specified by -o (Set Output Directory) switch.
This command places all extracted files to one directory. If you want extract files with full paths, you must use x (Extract with full paths) command.
7-Zip will prompt the user before overwriting existing files unless the user specifies the -y (Assume Yes on all queries) switch. If the user gives a no answer, 7-Zip will prompt must file be extracted to other filename. Then a no answer skips file and yes prompts for new filename.
7-Zip accepts the following responses:
Answer Abbr. Action
Yes y
No n
Always a Assume YES for ALL subsequent queries of the same class
Skip s Assume NO for ALL subsequent queries of the same class
Quit q Quit the program
Abbreviated responses are allowed.
Examples
7z e archive.zip
extracts all files from archive archive.zip to the current directory.
7z e archive.zip -oc:\soft *.cpp -r
extracts all *.cpp files from archive archive.zip to c:\soft folder.
Switches that can be used with this command
-ai (Include archives)
-an (Disable parsing of archive_name)
-ao (Overwrite mode)
-ai (Exclude archives)
-i (Include)
-o (Set Output Directory)
-p (Set Password)
-r (Recurse)
-so (use StdOut)
-x (Exclude)
-y (Assume Yes on all queries)
See also
Commands: x (Extract with full paths)
l (List contents of archive) command
Lists contents of archive.
Examples
7z l archive.zip
lists all files from archive archive.zip.
Switches that can be used with this command
-ai (Include archives)
-an (Disable parsing of archive_name)
-ai (Exclude archives)
-i (Include)
-p (Set Password)
-r (Recurse)
-x (Exclude)
If you need more I will upload the chm.
Corey
04-07-2006, 02:21 AM
You can definitely create archives with 7-zip from AMS. I once built an app with "publish to zip" functionality meaning to post it here as an example but it got busy and I forgot about it, and now I can't find it. But it definitely works. Brett even built an add-on so that you could specify which "file to run upon unzip" for creating self extracting archives which autorun when clicked. If I can find it I'll post it but I'm not making any promises, it's been a crazy month. :yes
gracias bobbie, ill try those out :yes
Those are enough for now
Corey
04-07-2006, 02:48 AM
Mina, 7-zip has a forum where you can get surprisingly quick responses to many questions if you ever have a problem. It looks abandoned but actually ever time I posted a question there I got a useful answer within a day... :yes
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.