.APP Files to the Applications Folder on a Mac

(imported topic written by nmelanson91)

Good morning,

I am new on the Mac software deployment side of the house and having some issues building a task to deploy two .app files to the application folder on a Mac. I tried the software deployment wizard but it is not cooperating with me. Can someone assist me on where I should put the files and what the syntax is to copy them.

Thank you all for your help.

(imported comment written by bxk)

If you place the .app in a disk image (DMG) and then point the mac software deployment wizard to the dmg file, this generally works without a problem.

Brian

(imported comment written by nmelanson91)

What is you have 2 .app files can you place them in the same DMG?

Thanks for your reply Brian.

(imported comment written by nmelanson91)

Here is the action that is failing with the dmg, there are two .apps in the dmg I am trying to copy to applications. Turn Proxy Off.app and Turn Proxy On.app.

download http://servername:52311/Uploads/8ce2c75aef7d3c223d50567ac03dd36bcb1f138d/ProxySettingsdmg.tmp

continue if {(size of it = 1388167 AND sha1 of it = “8ce2c75aef7d3c223d50567ac03dd36bcb1f138d”) of file “ProxySettingsdmg.tmp” of folder “__Download”}

extract ProxySettingsdmg.tmp

wait sh -c “rm ‘/tmp/ProxySettings.dmg’”

move “{posix path of file “ProxySettings.dmg” of folder “__Download” of client folder of current site}” “/tmp/ProxySettings.dmg”

wait hdiutil attach -quiet -private -mountpoint “/tmp/BESMNTPT16874473828046693” “/tmp/ProxySettings.dmg”

if {not active of action OR (exists file whose (name of it ends with “.mpkg” OR name of it ends with “.pkg”) of it) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}

wait installer -pkg “{(if (exists file whose (name of it ends with “.mpkg”) of it) then (pathname of file whose (name of it ends with “.mpkg”) of it) else (pathname of file whose (name of it ends with “.pkg”) of it)) of folder (”/tmp/" & “BESMNTPT16874473828046693”) }" -target /

elseif {exists folder whose (name of it ends with “.app” AND exists folder “Contents” whose (exist file “PkgInfo” whose (exists line whose (it = “APPLVISX”) of it) of it) of it) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}

appendfile tell application “{name of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}"

appendfile DoInstall

appendfile quit

appendfile end tell

wait /bin/sh -c "iconv -f UTF-8 -t macintosh {concatenation "\ " of substrings separated by " " of pathname of client folder of current site}/__appendfile > {concatenation “\ " of substrings separated by " " of pathname of client folder of current site}/doinstall.txt”

run “{posix path of framework folder & “/Carbon.framework/Versions/Current/Support/LaunchCFMApp”}” “{(pathname of parent folder of it & “/” & name of it & “/Contents/MacOSClassic/” & preceding text of first “.app” of name of it) of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}"

wait /bin/sh -c "osascript {concatenation “\ " of substrings separated by " " of pathname of client folder of current site}/doinstall.txt”

elseif {exists folder whose (name of it ends with “.app”) of folder ("/tmp/" & “BESMNTPT16874473828046693”)}

wait sh -c “rm '/Applications/{name whose (it ends with “.app”) of folders of folder (”/tmp/" & “BESMNTPT16874473828046693”)}’"

wait cp -Rfp “{pathname of folder whose (name of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT16874473828046693”)}" “/Applications”

else

wait cp -Rpn /tmp/BESMNTPT16874473828046693/* /Applications

endif

wait /bin/sh -c "hdiutil detach -force mount | grep /tmp/BESMNTPT16874473828046693 | cut -f 1 -d \ | cut -f 3 -d / | head -1"

wait sh -c “rm ‘/tmp/ProxySettings.dmg’”

(imported comment written by bxk)

Can you, yes. Is it as easy, no.

You’ll need to modify the action script generated by the wizard to delete and copy the multiple .app folders to the application folder. You’d need to run the rm and cp commands for each .app folders in the DMG. The quick and dirty answer would be to write out the two application names and copy the action script commands as I did below. My example/test was using both Firefox.app and Thunderbird.app.

Before:

wait sh -c “rm '/Applications/{names whose (it ends with “.app”) of folders of folder (”/tmp/" & “BESMNTPT5461297431626932”)}’"

wait cp -Rfp “{pathname of folder whose (names of it ends with “.app”) of folder (”/tmp/" & “BESMNTPT5461297431626932”)}" “/Applications”

After:

wait sh -c “rm '/Applications/{name whose (it equals “Firefox.app”) of folders of folder (”/tmp/" & “BESMNTPT5461297431626932”)}’"

wait cp -Rfp “{pathname of folder whose (name of it equals “Firefox.app”) of folder (”/tmp/" & “BESMNTPT5461297431626932”)}" “/Applications”

wait sh -c “rm '/Applications/{name whose (it equals “Thunderbird.app”) of folders of folder (”/tmp/" & “BESMNTPT5461297431626932”)}’"

wait cp -Rfp “{pathname of folder whose (name of it equals “Thunderbird.app”) of folder (”/tmp/" & “BESMNTPT5461297431626932”)}" “/Applications”

Personally, I’d split them into two DMGs and tasks unless it was really undesirable and in that case I’d spend the time to make some universal relevance to run the delete/copy commands for multiple .app folders.

Brian

(imported comment written by nmelanson91)

Separating them out worked like a charm, thanks Brian for your help!!!