Strange behaivour when unpacking my app from a downloaded zip file
Strange behaivour when unpacking my app from a downloaded zip file
It's strange and I don't know what to do.
I have two identical zip files with an arm64 compiled PB app. The files have the same checksum. One file was the original zip file, the second file was uploaded to my website and then downloaded again. As I said, even after downloading, they have the same checksum.
If I uncompress the files, the app from the original zip can be launched. But the app from the downloaded zip cannot be opened. I see the error message "The app is damaged and can’t be opened. You should move it to the Trash". (macOS 13.6.3)
I have no problem with a x64 app inside the zip.
I have two identical zip files with an arm64 compiled PB app. The files have the same checksum. One file was the original zip file, the second file was uploaded to my website and then downloaded again. As I said, even after downloading, they have the same checksum.
If I uncompress the files, the app from the original zip can be launched. But the app from the downloaded zip cannot be opened. I see the error message "The app is damaged and can’t be opened. You should move it to the Trash". (macOS 13.6.3)
I have no problem with a x64 app inside the zip.
Re: Strange behaivour when unpacking my app from a downloaded zip file
Hmmm… I believe some Mad Italian posted some stuff that may help you...
But don't forget google…
https://www.purebasic.fr/english/viewtopic.php?t=81549
But don't forget google…
https://www.purebasic.fr/english/viewtopic.php?t=81549
-
- Enthusiast
- Posts: 772
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: Strange behaivour when unpacking my app from a downloaded zip file
I compiled the steps needed for notarization on MacOS some time ago.
If you like to experience some pain check here:
https://www.purebasic.fr/english/viewtopic.php?t=80722
If you like to experience some pain check here:
https://www.purebasic.fr/english/viewtopic.php?t=80722
Regards,
JamiroKwai
JamiroKwai
Re: Strange behaivour when unpacking my app from a downloaded zip file
Thats it! Thanks. But why? How I offer such App now? This seems to be impossible without a manual terminal command.xattr -cr MyApp.app
Re: Strange behaivour when unpacking my app from a downloaded zip file
Build a dmg file.
Re: Strange behaivour when unpacking my app from a downloaded zip file
You need to notarize it as jamirokwai said.
Re: Strange behaivour when unpacking my app from a downloaded zip file
Maybe this can help?
Forgive me: I saw a great tool, but didn't bookmark, and have no time now…
https://www.startpage.com/do/dsearch?q= ... ge=english
Forgive me: I saw a great tool, but didn't bookmark, and have no time now…
https://www.startpage.com/do/dsearch?q= ... ge=english
Re: Strange behaivour when unpacking my app from a downloaded zip file
I found this:
https://ohanaware.com/appwrapper/ (14-Day trial, then $49.99, €58.99)
…but I'm almost sure there's also some good free stuff somewhere… grrr...
https://ohanaware.com/appwrapper/ (14-Day trial, then $49.99, €58.99)
…but I'm almost sure there's also some good free stuff somewhere… grrr...
Re: Strange behaivour when unpacking my app from a downloaded zip file
I noticed a weird thing: after dropping your "damaged" app into e.g. Terminal ICON (NOT window: I have it on Dock…) it will be OK to run!
Also, take a look at xattred: https://eclecticlight.co/xattred-sandstrip-xattr-tools/
Also, take a look at xattred: https://eclecticlight.co/xattred-sandstrip-xattr-tools/
Re: Strange behaivour when unpacking my app from a downloaded zip file
Create DMG (hdiutil)
Code: Select all
;-TOP by mk-soft, v1.01.0, 20.01.2024
; hdiutil create -volname WhatYouWantTheDiskToBeNamed -srcfolder /path/to/the/folder/you/want/to/create -ov -format UDZO name.dmg
; ----
Procedure CreateDMG(srcFolder.s, dmgFile.s, Title.s = "")
Protected r1, program, destFolder.s, destFile.s, param.s, Output$
If LCase(GetExtensionPart(dmgFile)) <> "dmg"
dmgFile + ".dmg"
EndIf
destFolder = GetPathPart(dmgFile)
destFile = GetFilePart(dmgFile)
If Title = ""
Title = GetFilePart(dmgFile, #PB_FileSystem_NoExtension)
EndIf
param = "create -volname " + #DQUOTE$ + Title + #DQUOTE$ + " -srcfolder " + #DQUOTE$ + srcFolder + #DQUOTE$
param + " -ov -format UDZO " + #DQUOTE$ + dmgFile + #DQUOTE$
; r1 = RunProgram("hdiutil", param, destFolder, #PB_Program_Wait)
r1 = RunProgram("hdiutil", param, destFolder, #PB_Program_Open | #PB_Program_Read)
Output$ = ""
If r1
While ProgramRunning(r1)
If AvailableProgramOutput(r1)
Output$ + ReadProgramString(r1) + Chr(13)
EndIf
Wend
Output$ + Chr(13) + Chr(13)
Output$ + "Exitcode: " + Str(ProgramExitCode(r1))
CloseProgram(r1) ; Close the connection to the program
;MessageRequester("Output", Output$)
If FileSize(dmgFile) < 0
r1 = 0
EndIf
EndIf
ProcedureReturn r1
EndProcedure
;- Main
Enumeration CustomEvent #PB_Event_FirstCustomValue
#MyEvent_CreateDMG_Busy
#MyEvent_CreateDMG_Done
#MyEvent_CreateDMG_Error
EndEnumeration
Global srcFolder.s, dmgFile.s
Procedure thCreateDMG(*dummy)
Protected r1
PostEvent(#MyEvent_CreateDMG_Busy)
r1 = CreateDMG(srcFolder, dmgFile)
If r1
PostEvent(#MyEvent_CreateDMG_Done)
Else
PostEvent(#MyEvent_CreateDMG_Error)
EndIf
EndProcedure
Procedure Main()
Protected dx, dy
Protected r1, temp.s
#WinStyle = #PB_Window_SystemMenu ; | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 580, 140, "DMG Create", #WinStyle)
; MenuBar
CreateMenu(0, WindowID(0))
MenuTitle("File")
; StatusBar
CreateStatusBar(0, WindowID(0))
AddStatusBarField(#PB_Ignore)
; Gadgets
dx = WindowWidth(0)
dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
TextGadget(0, 10, 10, 100, 20, "Source Folder")
StringGadget(1, 120, 8, 400, 25, "", #PB_String_ReadOnly)
ButtonGadget(2, 530, 10, 40, 25, "./.")
TextGadget(3, 10, 45, 100, 20, "DMG File Name")
StringGadget(4, 120, 43, 400, 25, "", #PB_String_ReadOnly)
ButtonGadget(5, 530, 45, 40, 25, "./.")
ButtonGadget(6, 10, 80, 120, 30, "Create DMG")
; Main Loop
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
EndSelect
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case 2
temp = PathRequester("Folder", "")
If temp
srcFolder = temp
SetGadgetText(1, srcFolder)
EndIf
Case 5
temp = SaveFileRequester("DMG File", "", "", 0)
If temp
dmgFile = temp
If LCase(GetExtensionPart(dmgFile)) <> "dmg"
dmgFile + ".dmg"
EndIf
SetGadgetText(4, dmgFile)
EndIf
Case 6
If dmgFile <> "" And FileSize(srcFolder) = -2
If Not IsThread(r1)
r1 = CreateThread(@thCreateDMG(), 0)
If Not r1
MessageRequester("Create DMG", "Error Create Thread!")
EndIf
EndIf
EndIf
EndSelect
Case #MyEvent_CreateDMG_Busy
StatusBarText(0, 0, " Busy ...")
Case #MyEvent_CreateDMG_Done
StatusBarText(0, 0, " Done.")
MessageRequester("Create DMG", "Ready!")
Case #MyEvent_CreateDMG_Error
StatusBarText(0, 0, " Error!")
MessageRequester("Create DMG", "Error!")
EndSelect
ForEver
EndIf
EndProcedure : Main()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Strange behaivour when unpacking my app from a downloaded zip file
Notarization is an Apple requirement not a PB one.
Re: Strange behaivour when unpacking my app from a downloaded zip file
I don't have a Mac M1/M2
Have you tried the code ... Without immediately messing with the parameters.
Have you tried the code ... Without immediately messing with the parameters.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive