Create dmg using terminal?
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Create dmg using terminal?
Is it possible to create a dmg for an app from PB maybe using terminal commands?
CD
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Create dmg using terminal?
You can use disk utility. In the first menu / new image from folder.
macOS Catalina 10.15.7
Re: Create dmg using terminal?
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
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Yes Thanks
I think my question should have been is it possible to run a terminal command from within a PB programme?
CD
I think my question should have been is it possible to run a terminal command from within a PB programme?
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Create dmg using terminal?
Code: Select all
source.s ="/Users/yourName/test"
target.s = "myNewImage"
parameter.s = "create -fs HFS+ -srcfolder " +#DQUOTE$ +source +#DQUOTE$ +" -volname " +#DQUOTE$ +target +#DQUOTE$ +" " +target +".dmg"
RunProgram("hdiutil", parameter, GetPathPart(source) )
macOS Catalina 10.15.7
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Hi All
Thanks for the replies gave me some food for thought.
My answer to it is to use AppleScript as well:
First I created this script
and saved it as an application.
I then simply create a text file of the commands for terminal to do called "TrCmd.txt"
and run the script application. Both script and app in same folder.
The script then reads the text file line by line and tells terminal to do each line.
CD
Thanks for the replies gave me some food for thought.
My answer to it is to use AppleScript as well:
First I created this script
Code: Select all
tell application "Finder"
set myFolder to container of (path to me) as text
end tell
set srcFile to myFolder & "TrCmd.txt"
set lns to paragraphs of (read file srcFile as «class utf8»)
repeat with ln in lns
tell application "Terminal"
activate
do script ln
end tell
end repeat
I then simply create a text file of the commands for terminal to do called "TrCmd.txt"
and run the script application. Both script and app in same folder.
The script then reads the text file line by line and tells terminal to do each line.
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Create dmg using terminal?
You can use AppleScript from within PB as well.collectordave wrote:The script then reads the text file line by line and tells terminal to do each line.
viewtopic.php?p=393553#p393553
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Hi All
Stuck a bit again.
I want to copy a .app to a dmg with terminal or AppleScript.
Found hundreds of examples on web none work.
PB copy file does not work with aliases or .app files neither does copy directory.
Any help appreciated
CD
Stuck a bit again.
I want to copy a .app to a dmg with terminal or AppleScript.
Found hundreds of examples on web none work.
PB copy file does not work with aliases or .app files neither does copy directory.
Any help appreciated
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Create dmg using terminal?
You can use copyItemAtPath:toPath:error: from the NSFileManager class. See this postcollectordave wrote:PB copy file does not work with aliases or .app files neither does copy directory.
viewtopic.php?f=19&t=59105
NSFileManager also has a method to move instead of copy.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Works first time.You can use copyItemAtPath:toPath:error: from the NSFileManager class. See this post
viewtopic.php?f=19&t=59105
NSFileManager also has a method to move instead of copy.
Headache going away.
Thank you
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Using the call apple script can the procedure run an AppleScript file?
CD
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Create dmg using terminal?
That should be possible.collectordave wrote:Using the call apple script can the procedure run an AppleScript file?
One way would be to use PB commands to load the file and pass the entire file as a string.
The other way to use initWithContentsOfURL:error: together with fileURLWithPath: instead of initWithSource: .
That way you can let the OS do the loading of the file.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Hi All
Managed to get it working with filberts AppleScript with one exception.
I am building the script as above and supplying it to AppleScript and it does not work.
If I use script editor with the output as the comment in the code it works.
Any ideas?
Regards
CD
Managed to get it working with filberts AppleScript with one exception.
Code: Select all
Unmount = "do shell script " + #DQUOTE$ + "hdiutil unmount Volumes/Tester" + #DQUOTE$
; do shell script "hdiutil unmount Volumes/Tester"
Debug UnMount
Applescript(Unmount)
If I use script editor with the output as the comment in the code it works.
Any ideas?
Regards
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Changed my UnMount to
diskutil instead of hdiutil and it works?
CD
diskutil instead of hdiutil and it works?
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Create dmg using terminal?
Hi All
Just been putting it all together the fruits of this are here
viewtopic.php?f=19&t=73543
A simple app to create a fancy DMG for your app.
Thanks to all.
CD
Just been putting it all together the fruits of this are here
viewtopic.php?f=19&t=73543
A simple app to create a fancy DMG for your app.
Thanks to all.
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.