osx - Create dmg installer with $HOME/Application folder -


i have created script application installation root application folder (/application), i'm not able create same 1 user home folder $home/application (~/application). here script

#!/bin/sh #http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools  set -o verbose #echo onset +o verbose #echo off  # note: must run on mac  app_name="xxx" out_mac=out/ dmg_path=${out_mac}${app_name}.dmg dmg_content_path=${out_mac}contents bundle_path=${dmg_content_path}/${app_name}.app  #clean old dmg if exist rm -rf ${dmg_path}  setfile -a b "${bundle_path}"  hdiutil create -srcfolder ${dmg_content_path} -volname ${app_name} -fs hfs+ \ -fsargs "-c c=64,a=16,e=16" -format udrw -size 550m ${dmg_path}.temp.dmg  device=$(hdiutil attach -readwrite -noverify -noautoopen "${dmg_path}".temp.dmg | \ egrep '^/dev/' | sed 1q | awk '{print $1}')  osascript <<eot tell application "finder" tell disk "${app_name}" open set current view of container window icon view set toolbar visible of container window false set statusbar visible of container window false set bounds of container window {200, 100, 900, 530} set theviewoptions icon view options of container window set arrangement of theviewoptions snap grid set icon size of theviewoptions 96 set background picture of theviewoptions file ".background:installer_dmg_bg.png" make new alias file @ container window posix file "/applications" properties {name:"applications"} delay 1 set position of item "${app_name}" of container window {200, 200} set position of item "applications" of container window {500, 200} -- update without registering applications delay 5 -- eject end tell end tell eot  chmod -rf go-w "/volumes/${app_name}" sync sync hdiutil detach ${device} sync hdiutil convert "${dmg_path}".temp.dmg -format udzo -imagekey zlib-level=9 -o ${dmg_path} rm -rf "${dmg_path}".temp.dmg 

i tried changing

make new alias file @ container window posix file "/applications" properties {name:"applications"}

to

make new alias file @ container window posix file "~/applications" properties {name:"applications"}

and

make new alias file @ container window posix file "$home/applications" properties {name:"applications"}

but no luck!

you can if specify:

path applications folder user domain 

so in script this:

set apphome path applications folder user domain make new alias file @ container window apphome properties {name:"applications"} 

*when using path applications folder user domain posix file not needed.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -