MAC Software Deployment Wizard

Let me start off, I am not a MAC person. I am trying to install a application on a MAC and I’m trying to use the wizard. The application is Jabber and I’m not sure of any of the syntax. The line it is failing on is this one…

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

It is my understanding that it copies the Cisco Jabber,app to /Applications. It gets 3/4 of the way down before it fails on the line I mentioned above. Any ideas?

That line it is failing on appears to be deleting the application that may already be on the computer before copying the new version over. At least I think so.

I don’t normally use the wizard, and I don’t have as much experience with this in general.

CC: @hansen_m

how would I copy the Cisco Jabber. app folder to /Applications?

I believe the software distribution wizards are deprecated – have you tried using the Software Distribution Dashboard?

Not familiar with that. How do I navigate to it?
jp

It’s under Dashboards > Software Distribution > Manage Software Distribution.

There is a user guide available here: http://support.bigfix.com/product/documents/SWD_Users_Guide.pdf

Is there a certain subscription one has to have to access that? I’m not seeing that.

jp

It is part of the Lifecycle Management domain and is it’s own external site you can enable.

Either I have something going wrong or I may not be licensed for it because I’m not seeing it in either prod or development environments.

check your license dashboard in BigFix Management Domain.
If you’ve got Lifecycle the Software Distribution site should be listed - you can then enable it.

Checked there several times, not there.

Do you have a, “Lifecycle Management” section in your license dashboard?

The Wizard is provided under the Patch Management license while the dashboard is provided under the Lifecycle Management license.

I agree with @jgstew on what the line is supposed to do – you may try adding an if statement infront of it so that line only runs if the app already exists?

I only have BES Platform, Security & Compliance, and Bigfix Labs.

Alright so you do not have the distribution dashboard – can you post the full actionscript of the fixlet and we can take a look?

wait mkdir -p "/Applications"
createfile until END
cp -Rfp “{pathname of client folder of current site & “/__Download/Cisco Jabber.app”}” "/Applications"
END

move __createfile copyFiles.sh
wait /bin/sh “{pathname of client folder of current site & “/copyFiles.sh”}”

// FOLDER PACKAGE INSTALLS (.pkg, and .mpkg)
if {(not active of action OR ((exists folder whose (name of it ends with “.mpkg” OR name of it ends with “.pkg”) of it)) of folder ("/Applications"))}

wait installer -pkg “/Applications/Cisco Jabber.app” -target /

// FOLDER APPLVISX BINARY
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 ("/Applications")}

appendfile tell application "/Applications/Cisco Jabber.app"
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 (”/Applications")}"

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

// FOLDER APP BINARIES (.app)

elseif {(not active of action OR ((exists folder whose (name of it ends with “.app”) of it)) of folder ("/Applications"))}

wait sh -c “rm '/Applications/{name whose (it ends with “.app”) of folders of folder (”/Applications/Cisco Jabber.app")}’"
wait cp -Rfp “/Applications/Cisco Jabber.app” “/Applications”

// FILE PACKAGE INSTALLS (.pkg, and .mpkg)
elseif {(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 ("/Applications"))}

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 (”/Applications/")}" -target /

endif

Here is the actionscript, it fails on the highlighted line. I’m pretty sure the app is not on the machine.

I would recommend recreating this with the wizard as it looks like the action script has been pretty heavily modified since the wizard created it.

Also you should consider putting the .app into a .dmg file before uploading it.

This is what the action script should look like (For Firefox):

extract Firefox%204102dmg.tmp

wait sh -c "rm '/tmp/Firefox 41.0.2.dmg'"

move "{posix path of file "Firefox 41.0.2.dmg" of folder "__Download" of client folder of current site}" "/tmp/Firefox 41.0.2.dmg"

wait hdiutil attach -quiet -private -mountpoint "/tmp/BESMNTPT41372852009323124" "/tmp/Firefox 41.0.2.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/" & "BESMNTPT41372852009323124")}

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/" & "BESMNTPT41372852009323124") }" -target /

elseif {(exists folder whose (name of it ends with ".mpkg" OR  name of it ends with ".pkg") of it) of folder ("/tmp/" & "BESMNTPT41372852009323124")}

wait installer -pkg "{(if (exists folder whose (name of it ends with ".mpkg") of it) then (pathname of folder whose (name of it ends with ".mpkg") of it) else (pathname of folder whose (name of it ends with ".pkg") of it)) of folder ("/tmp/" & "BESMNTPT41372852009323124") }" -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/" & "BESMNTPT41372852009323124")}

appendfile tell application "{name of folder whose (name of it ends with ".app") of folder ("/tmp/" & "BESMNTPT41372852009323124")}"
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/" & "BESMNTPT41372852009323124")}"

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/" & "BESMNTPT41372852009323124")}

wait sh -c "rm '/Applications/{name whose (it ends with ".app") of folders of folder ("/tmp/" & "BESMNTPT41372852009323124")}'"
wait cp -Rfp "{pathname of folder whose (name of it ends with ".app") of folder ("/tmp/" & "BESMNTPT41372852009323124")}" "/Applications"

else

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

endif

wait /bin/sh -c "hdiutil detach -force `mount | grep /tmp/BESMNTPT41372852009323124 | cut -f 1 -d \ | cut -f 3 -d / | head -1`"
wait sh -c "rm '/tmp/Firefox 41.0.2.dmg'"
1 Like

Late to the game but…

The syntax seems a little odd here. In order to successfully delete an application bundle you’d have to use the -R flag. Also, the only "folders of folder of a typical application bundle would be a “Contents” folder, and there typically wouldn’t be a .app directory under inside the top level of another app directory.

This just seems like a case of the wizard getting it wrong.

Maybe switch to:

if {exists folder "/Applications/Cisco Jabber.app"}
    wait /bin/rm -R "/Applications/Cisco Jabber.app"
endif
1 Like

@hansen_m

The issues go further than that… if you look at the line following that one:

wait sh -c "rm '/Applications/{name whose (it ends with ".app") of folders of folder ("/Applications/Cisco Jabber.app")}'"
wait cp -Rfp "/Applications/Cisco Jabber.app" "/Applications"

The first line deletes the Cisco Jabber folder and the second line performs the installation by… overwriting the jabber folder with itself (which is now deleted).

Overall I think the best thing would be to start over with this one.

@strawgate

True. I don’t see any purpose to the second line unless cp-ing strips some extra attributes or something along those lines.

The first line still won’t remove the Cisco Jabber.app, it’s going to attempt to remove an app bundle inside the top level of the Cisco Jabber.app bundle but fail without the -R flag.

That line was originally suppose to do this:

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

It looks in the mounted directory for the name of the app it’s about to install and removes that app from the /Applications directory.

The following line (that is suppose to be there) does this:

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

Thus installing the application.

The issue here isn’t with the Wizard it’s with the customizations that were made to the actionscript that was outputted by the wizard.