Zip/Unzip on Windows
Hi Alan,
I use 7Zip on Windows. I used to use it on Mac as well, but I have not been able to locate it for the updated OS X. Possibly it is not kept up with any longer because of the built in functions which is why I have been looking into it. I lost my working copy of 7za for the Mac in my recent Mac upgrade and have not been able to locate a working copy since.
Here is a sample that backs up a client’s data. The code for windows is much simpler than the Mac. So weed that out.
; Get current data file
Calculate lvDataFile as inDataPath
Do FileOps.$splitpathname(inDataPath,lvDrv,lvDir,lvFile,lvExt) Returns lvError
; Make sure we get all segments
Calculate lvBackupFiles as con(lvDrv,lvDir,lvFile,’.df*’)
Calculate lvBackupZipFile as con(ivBackupPath,sys(9),lvFile,’.zip’)
; Setup command line – 7za needs to be in the OmnisZip folder
Calculate lv7_ZipPath as con(pick(sys(6)=’X’,pick(in42,sys(215),sys(115)),sys(209)),’Zip’,sys(9),’7za’)
If sys(6)=’X’
Do FileOps.$converthfspathtoposixpath(lvBackupFiles,lvBackupFiles)
Do FileOps.$converthfspathtoposixpath(lvBackupZipFile,lvBackupZipFile)
Do FileOps.$converthfspathtoposixpath(lv7_ZipPath,lv7_ZipPath)
Calculate lvCommand as con(‘do shell script ‘,kDq,”,kDq,lv7_ZipPath,”,kDq,’ a -tzip ‘,”,kDq,lvBackupZipFile,”,kDq,’ ‘,”,kDq,lvBackupFiles,”,kDq,kDq)
Else
Calculate lvCommand as con(‘ a -tzip ‘,kDq,lvBackupZipFile,kDq,’ ‘,kDq,lvBackupFiles,kDq)
End If
; Close data so we can back it up
Begin reversible block
Clear all files
End reversible block
Close data file
; Run 7 Zip
If sys(6)=’X’
Do $runapplescript(lvCommand,lvResponse) Returns lvError
Else
Call DLL (“Shell32.dll”,con(‘ShellExecute’,pick(inU,’A’,’W’)),0,”#NULL#”,lv7_ZipPath,lvCommand,”#NULL#”,0) Returns lvErrorCode
End If
*********************************************************************
Michael Mantkowski
ClienTrax Software
1-614-875-2245
*********************************************************************
—–Original Message—–
From: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] On Behalf Of Alan Grinberg
Sent: Saturday, November 18, 2017 11:51 AM
To: OmnisDev List – English <omnisdev-en@lists.omnis-dev.com>
Subject: Zip/Unzip on Windows
Good discussion on the Zip Command for Macintosh.
I wonder what recommendations are out there for doing the same on Windows?
We want to have Omnis control the Zip and Unzip functions.
Currently using Studio 4.3 and Studio 6, although I suppose that doesn’t matter much.
Thanks!
Alan
—————————————————-
Alan Grinberg
AG Systems/ZOO-INK
San Francisco, CA
www.zoo-ink.com <applewebdata://24F50550-8B13-47ED-8FAE-295B23949734>
www.perfectfit.net
alan@perfectfit.net
—————————————————-
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com