- This topic has 0 replies, 1 voice, and was last updated 15 years, 1 month ago by
typofonic.
-
AuthorPosts
-
March 5, 2010 at 12:10 pm #378133
typofonic
ParticipantHey all,
This is my setup:
I have copied the User Template directory to another partition and have set up a user account with the username “template”. When logged into the “template” user I can customize the user template. When I’m done customizing I run a script (see below) that copies the contents of the user template back into the /System/Library/User Template/da.lproj and English.lproj. Now all new users I create from that point are based on this template. I’ve integrated this in a User Template.pkg and a Postflight script that runs on first boot, and the idea was that createUser should create the user based on this new user template. The postflight works just fine with the other stuff it does, but just not with the User Template commands.[img]http://www.typofonic.com/instadmg/Library.png[/img]
[img]http://www.typofonic.com/instadmg/Home.png[/img]As you see in the screenshots above, in my User Template I have symlinked many of the folders to another folder on the other partition so that all accounts can share them. Some of the reasons why I’ve done this is to separate my important system files and setup from the main system, so reinstalls are much quicker. Also I have different user account setup on my system for work and personal stuff, and they should share many of the same files.
Unfortunately the user that createUser.pkg creates during the instaDMG build doesn’t work properly after login. This is how the user directory looks after having logged in for the first time:
[img]http://www.typofonic.com/instadmg/Problem.png[/img]It creates these duplicate folders ‘Downloads 1’, ‘Documents 1’ on startup. Also none of my settings (dock, finder labels, view settings etc.) take effect. The only way I can fix this is after the login to manually run the above script below and then manually create a new user in System Preferences, and delete the user created by createUser:
/////////////////////
# 1 Delete existing templates
sudo rm -R /System/Library/User\ Template/English.lproj
sudo rm -R /System/Library/User\ Template/da.lproj# 2 Copy new templates into both da.lproj and English.lproj folders
sudo cp -R /Volumes/work/Arkiv/System/Brugere/template /System/Library/User\ Template/da.lproj/
sudo cp -R /Volumes/work/Arkiv/System/Brugere/template /System/Library/User\ Template/English.lproj/# 3 Set owner: group of template folder to root:wheel
sudo chown -R root:wheel /System/Library/User\ Template/# 4 Set permissions of template folder
sudo chmod 700 /System/Library/User\ Template/
sudo chmod -R 777 /System/Library/User\ Template/Non_localized/
sudo chmod -R 777 /System/Library/User\ Template/English.lproj/
sudo chmod -R 777 /System/Library/User\ Template/da.lproj/# 5 Set correct permissions for special folders
sudo chmod -R o+w /System/Library/User\ Template/English.lproj/Sites
sudo chmod -R o+w /System/Library/User\ Template/English.lproj/Public
sudo chmod o-w /System/Library/User\ Template/English.lproj/Drop\ Box
sudo chmod -R o+w /System/Library/User\ Template/da.lproj/Sites
sudo chmod -R o+w /System/Library/User\ Template/da.lproj/Public
sudo chmod o-w /System/Library/User\ Template/da.lproj/Drop\ Box///////////////////////
What’s even more weird is that step 3, 4 and 5 of this script is also run as a postflight package (the last package in my CustomPKG folder). But accounts created after boot still (without me running the above script manually first) don’t work properly, as explained above.
This is how my User Template package looks.
[img]http://www.typofonic.com/instadmg/Iceberg.jpg[/img]This is the order of my packages in CustomPKG (I have left out non relevant packages for troubleshooting purposes):
[img]http://www.typofonic.com/instadmg/CustomPKG.jpg[/img]P.S. The permissions are wrong I know, but it works now. When I have gotten this to work I would like to give everything the proper permissions though.
Any ideas how to fix this, and what I’m doing wrong? I have spent countless of nights trying to make this work during the last year.
All the best
Anders 😯
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed