Page 1 of 1

Zip and Unzip: trevordevore script applied

Posted: Mon Mar 26, 2018 12:31 pm
by trevix
LC8.1.9 OSX 10.12.6
Trying to build a reliable Zipper and unzipped, using the RevZip commands, I built a simple stack using the scripts that Trevordevore so generously put on GitHub (https://gist.github.com/trevordevore/5246242).

After a few additions , I was able to zip and unzip, using all the Finder/Stack combinations (zip/unzip with the stack, zip with Finder, unzip with stack and viceversa).

The problem is the settings of permissions while UnZipping. Applications unzipped will not launch (the Finder reports: Unable to open the application).
I tried both setting the "pPerm" of "fileCreateAllFoldersInPath" to empty and to "shared".
Did not try on Windows.

Find here the sample stack.
1 - create a folder and put an App into it
2 - open the stack and zip the folder with it
3 - once zipped, unzip the zipped file of point 2, using the stack
4 - Try to launch the app inside the folder --doesn't work

Any help will be appreciated.
Trevix

Re: Zip and Unzip: trevordevore script applied

Posted: Mon Mar 26, 2018 5:02 pm
by FourthWorld
A shell call to chmod can set the executable bit needed for apps on macOS and Linux.

Re: Zip and Unzip: trevordevore script applied

Posted: Tue Mar 27, 2018 9:57 am
by trevix
Yes.
I don't know how to use the shell, but in the Trevordevore script, we have this line for every file path:

Code: Select all

put shell(format("chmod %u%u%u %s ",7, 7, 7, pFilePath)) into theResult
But doesn't fix (anymore?) the permissions so to be able to run a unzipped application.
Instead, this applescript works:

Code: Select all

do shell script "chmod -R 775 " & MyPathToFolder  user name "MyUserName" password "MyPassword" with administrator privileges
But we have to ask the user for username and password.
So I was wondering: something changed in the last 5 years about OSX security so that is not enough anymore to run the "chmod" but we also need to pass username/password (even if the application is not unzipped to a protected folder, but to the desktop) ?

Regards and thanks for your time.

Re: Zip and Unzip: trevordevore script applied

Posted: Wed Mar 28, 2018 9:26 pm
by trevix
Must again correct myself:
The applescript works even without obtaining the username and password

Code: Select all

set myPOSIX to quoted form of POSIX path of "<TheAppPath>"
try
do shell script "chmod -R 775 " & myPOSIX
on error TheErr
return TheErr
end try