Permission issue?

Discussion in 'Mac Programming' started by macdummy777, Feb 16, 2010.

  1. macdummy777 macrumors newbie

    Joined:
    Feb 16, 2010
    #1
    Hello all,

    I hope this is simple...:(

    Do I need to set the owner of the contents for a packager file to "root" and "admin"?

    Currently they are Me and "Staff".

    The packager file and postflight script work fine as long as the user selects a folder in his "home" (eg. Desktop, Documents, etc.)

    If the user does NOT select a folder in his home, it installs in the root of the drive and installation fails. Specifically, the postflight script does not copy the content files to the proper location.

    If I do need to set the ownership of the content files on the Mac making the packager file to root and admin, can someone please tell me how to do this?

    Thanks for your time!

    John
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    Well, the user will not have permission to automatically copy files anywhere but their home directory. You will have to do something to ask the user for permission to copy anywhere else. Don't even try to work around this; I don't know if you can't, but you shouldn't. That kind of operation _needs_ user permission.
     
  3. macdummy777 thread starter macrumors newbie

    Joined:
    Feb 16, 2010
    #3
    Gnasher,

    Thanks for the reply. I do require admin authorization but that doesn't help and you're correct anyway so....

    Maybe I can approach this issue a different way and I have an idea.

    I think the target of packager file is currently set to the drive's root. So if the user accepts the default install location, the files go to the root, the postflight cannot copy = failure.

    STUPID QUESTION: Is there a way to set the DEFAULT destination to the user's home and a specific folder (documents or desktop, for example)?

    I am sure there is but I'm a newbie and I think it involves using this symbol: ~

    and some other language to indicate the user's home and a specific folder.

    I've seen a pro struggle with this syntax so I could use some help!

    Thanks again!

    John
     
  4. macdummy777 thread starter macrumors newbie

    Joined:
    Feb 16, 2010
    #4
    Looking around on google gives a few clues but nothing certain:

    1. /home/$USER/Documents
    2. ~/home/$USER/Documents
    3. /home/USER/Documents
    4. ~/home/USER/Documents

    I can't get to the Mac for another hour or so but setting the default target location for the content to be copied by the postflight script might solve this issue?

    I have a setup warning but most users don't read the "getting started" file or the info I provide before they have to select the target drive....

    Thanks again....

    John
     
  5. macdummy777 thread starter macrumors newbie

    Joined:
    Feb 16, 2010
    #5
    It appears that the syntax may be:

    ~/Documents

    However, Packagemaker doesn't like that and says to use a script.

    That is, copy the payload (contents) to a temporary location, then use a script to copy to the Users' "/Documents" folder and from there, the files will be copied by the script to their specific locations. This results in an extra round of copying so there must be a better way. :(

    Maybe there's a way to stop the install until the user have actually selected a folder and not just a volume? :confused:

    It's a shame because the installer works as long as the user selects a target folder...it used to work even if they didn't but I think Snow Leopard is different. Sigh...
     

Share This Page