miyako / 4d-plugin-zip

4D plugin to zip and unzip.
MIT License
4 stars 4 forks source link

Trouble with unzipping a 4D merged application #2

Closed scopie2 closed 5 years ago

scopie2 commented 5 years ago

I download a zipped 4d Merged Application file (ConInPro.zip) from an sftp server using your CURL plugin. (Plugin works well, thank you , except there is a spinning beachball during the download.)

When I unzip the dowloaded file in the Mac Finder by double clicking on it, the file unzips without problems and the resultant (signed) ConInPro.app is fully functional.

When I use 4d-plugin-zip on it, the file unzips about 60% and then throws an error = 1. It then finishes unzipping to full size but ends with a damaged file icon over the app icon. Sometimes the damaged file icon mysteriously disappears after a minute or so to reveal the usual app icon. Either way this file unzipped with 4d-plugin-zip is damaged. The finder gives a warning and recommends putting it in the trash when you attempt to open it.

Here is the unzip command patterned after the example database:

$error:=Unzip (Get 4D folder(Active 4D Folder)+"Update:ConInPro.zip";Get 4D folder(Active 4D Folder)+"Update:";"";ZIP_With_attributes)

I'm using the latest version of Mojave with now version 17.1 of 4D. I have tried signing the ConInPro.zip file without benefit.

Is there anything I can do to get this to work properly?

miyako commented 5 years ago

there are 4 curl plugins in the repository and many revisions, so it would help if you could clarify which one you have an issue with.

have you tried to diff (FileMerge for X code) the unzipped file to understand what's missing? could be symbolic links, could be something else.

you didn't specify whether you used the plugin to zip.

but if you know you can unarchive with standard archive utility, you don't need to use the plugin.

scopie2 commented 5 years ago

I’m using cURL FTP.bundle last modified on 22 Nov 2018 — I think that is 2.9.

The original ConInPro.zip I tried to unzip with 4d-plugin-zip was created with the compress command in Mac Finder. The results of trying to unzip it with 4d-plugin-zip were as noted in the previous communication.

I tried zipping ConInPro.app with 4d-plugin-zip; the resultant zipped file was about 3MB larger then the one made by the Finder. When I tried to unzip that file with the same line of 4D code it immediately crashed 4D after putting a Zero byte ConInPro.app file in the Update folder.

The reason I need to unzip with 4d-plugin-zip — rather than in the Finder with the achieve utility — is I am trying to do an automatic app update from within 4D. After downloading the updated ConInPro.app into my app with 4d-plugin-curl-ftp in to the Updates folder I need to unzip it before issuing the RESTART 4D command. If I can’t get 4d-plugin-zip to unzip ConInPro.zip, I will not be able to do a full automatic update. I would prefer a full automatic update because my users will not be sophisticated with computers but there are alternatives.

I have never used xCode except slightly to start leaning Swift so I can’t help you by examining things there.

It would be great if there was a 4D plugin that did the equivalent of double clicking on a zipped file in the Finder, letting the Finder Archive Utility do the unzipping in situ.

On Feb 15, 2019, at 2:30 PM, Keisuke Miyako notifications@github.com wrote:

there are 4 curl plugins in the repository and many revisions, so it would help if you could clarify which one you have an issue with.

have you tried to diff (FileMerge for X code) the unzipped file to understand what's missing? could be symbolic links, could be something else.

you didn't specify whether you used the plugin to zip.

but if you know you can unarchive with standard archive utility, you don't need to use the plugin.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/miyako/4d-plugin-zip/issues/2#issuecomment-464228375, or mute the thread https://github.com/notifications/unsubscribe-auth/Atdtr2XkNCM14PuHcvdsRQEbxwUOGyWnks5vNzUcgaJpZM4a-NWi.

miyako commented 5 years ago

LAUNCH EXTERNAL PROCESS + open is pretty much the same as double clicking

miyako commented 5 years ago

there is also https://stackoverflow.com/questions/7748027/use-archive-utility-app-from-command-line-or-with-applescript

miyako commented 5 years ago

if you can help with providing links to a real zip file that reproduces the issue, I may be able to study the case. but no promises.

also Nov. '18 for the ftp plugin might be a bit old

scopie2 commented 5 years ago

https://www.dropbox.com/s/a1bzkndnha73kdb/ConInPro.zip?dl=1

https://www.dropbox.com/s/wykhp2lvxmwcagg/ConInPro1.zip?dl=1

The first one (147MB) was created with Finder. The other (150MB) was created with 4d-plugin-zip https://github.com/miyako/4d-plugin-zip. they are not exactly the same versions of the app but almost.

I’ll try the other solutions you suggest. Thank You.

On Feb 15, 2019, at 4:32 PM, Keisuke Miyako notifications@github.com wrote:

if you can help with providing links to a real zip file that reproduces the issue, I may be able to study the case. but no promises.

also Nov. '18 for the ftp plugin might be a bit old

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/miyako/4d-plugin-zip/issues/2#issuecomment-464261642, or mute the thread https://github.com/notifications/unsubscribe-auth/AtdtrwDJuk91Dtnd46TqWY3H_12hDxTLks5vN1GjgaJpZM4a-NWi.

scopie2 commented 5 years ago

The LAUNCH EXTERNAL PROCESS with 'open' works well. Unzips the file in a few seconds.

You can close this issue anytime but I would appreciate a comment about the spinning beachball while the sftp download is going on and if I can do anything to suppress it. (I’m using cURL FTP.bundle last modified on 22 Nov 2018 — I think that is 2.9.)

Thanks again,

Scott Manders

miyako commented 5 years ago

for the beachball, you could use a newer version of the plugin

miyako commented 5 years ago

first, it seems like you didn't pass the right options when you zipped the app.

should be

$src:=System folder(Desktop)+"ConInPro.app" $dst:=System folder(Desktop)+"ConInPro.zip"

$pass:=""

$success:=Zip ($src;$dst;$pass;3;ZIP_With_attributes | ZIP_Ignore_hidden)

then you can unarchive with unarchiver.

only then can you do

$src:=System folder(Desktop)+"ConInPro.zip" $dst:=System folder(Desktop)

$success:=Unzip ($src;$dst;"";ZIP_With_attributes)

and again, please consider using a new version, especially when a version is failing you.

miyako commented 5 years ago

I can see that the app crashed on startup if I zip/unzip using the plugin,

but the console tells me

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information: dyld: launch, loading dependent libraries

Dyld Error Message: Library not loaded: @executable_path/../Frameworks/hunspell.framework/Versions/A/hunspell Referenced from: /Users/USER/Desktop/ConInPro.app/Contents/MacOS/ConInPro Reason: no suitable image found. Did find: /Users/miyako/Desktop/ConInPro.app/Contents/MacOS/../Frameworks/hunspell.framework/Versions/A/hunspell: file too short /Users/miyako/Desktop/ConInPro.app/Contents/MacOS/../Frameworks/hunspell.framework/Versions/A/hunspell: file too short

the file is 25 bytes.

if I double click the same file I get 552 KB so maybe zip is working unzip not.

miyako commented 5 years ago

I did some work in v2.4 which should allow unzipping apps. the challenge was that apps have symbolic links that could itself contain symbolic links, and the destination file or folder may not exist at the time of creating the symbolic link during unzip.