[quote=389715:@Tim Parnell]Is your app code signed? Does the unzipped version have the no symbol on top of it in Finder: ? ?
When there’s no further information in that dialog it means there’s something wrong with the app package. Permissions are a place to start, but if that didn’t fix it I would guess the links.
As Jeff mentioned, specific Apple and Windows flags aren’t maintained with UnzipMBS which is a big problem for your app.
Any reason to not use Kaju? It’s written already and it works.
If you don’t intend to use it as a complete solution, unzipping an in-tact .app code is in there.[/quote]
The app is not code signed. The unzipped app does not have a symbol on top of it. When I unzip using finder, the app runs fine. I haven’t used Kaju because up until the point I didn’t have a need to. I may look at Kaju as an option but would prefer to get my own code working properly. Finder is unzipping the app and it runs fine. It does not run fine after unzipping using the MBS Unzip.
[quote=389726:@Jeff Tullin]Yes.
I included the commands I typed to achieve it. (see below)
I didnt try using Xojo, but the unzipped app now runs after chmod
I got it to start by using Terminal:
JeffTulComputer:~ jefftullin$ cd desktop
JeffTulComputer:desktop jefftullin$ cd myapp.app
JeffTulComputer:macstitch.app jefftullin$ cd contents
JeffTulComputer:contents jefftullin$ cd macos
JeffTulComputer:macos jefftullin$ chmod +x MyApp
What did YOU try? (show us the code)[/quote]
Here is what I tried.
[code]Private Sub Unzip(f1 as FolderItem, f2 as FolderItem)
Dim error As String
Dim UnzipFile As UnZipMBS
UnzipFile = New UnZipMBS(f1)
If Not UnzipFile.ExtractFiles(f2, error) Then MsgBox("Failed to unzip the file. ")
myfile.html[/code]
How can I assign string variables to the HTML files in memory without physically extracting them to disk?
And is there a way to read the files recursively?
[quote=412961:@Christian Schmitz]Well, our Archive classes are newer than the UnZipMBS class.
Both can open a file from disk or from memory, walk over files and extract only the one you need in memory.[/quote]
Thanks Christian for the first feedback. Unfortunately it is not clear to me how I can read the content of the files in the main memory. I found the following code:
[code]dim a as new ArchiveReaderMBS
a.SupportFilterAll
a.SupportFormatAll
// open file
dim f as FolderItem = SpecialFolder.Desktop.Child(“test.zip”)
// open from memory
dim b as BinaryStream = BinaryStream.Open(f)
dim s as string = b.Read(b.Length)
if not a.OpenData(s) then
Break // problem?
end if
dim e as ArchiveEntryMBS = a.NextHeader
while e <> nil
// How do I get the contents of a single file read into a string variable?
print e.PathName
e = a.NextHeader
wend[/code]
Is it also possible to search for existing files in the Zip folder (by file name)?
Well, you walk over the list of items. For each item, you can see properties in ArchiveEntryMBS class including file path and name.
You can add those names to an array of string and later use Join() function to get them in one string.
[quote=413066:@Christian Schmitz]Well, you walk over the list of items. For each item, you can see properties in ArchiveEntryMBS class including file path and name.
You can add those names to an array of string and later use Join() function to get them in one string.[/quote]
Thank you, Christian. My primary concern is not the name of the files, but their content. How can I pass it into a string variable (test.html, index.html, my file.html)?