Home Forums Software InstaDMG script keyboard layout

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #377925
    toppmac
    Participant

    Hi,

    I am a newbie with instadmg and scripting. But I want to create an image with us as language with Norwegian keyboard layout.

    I have made a beta image, but I’m struggling with the keyboard layout. Can anyone help me with this?

    #377929
    alantrewartha
    Participant

    this topic

    [url]https://www.afp548.com/forum/viewtopic.php?showtopic=22278[/url]

    might be of help

    #377930
    toppmac
    Participant

    Hi,

    I have seen on this topic, and tried to create a script from these suggestions, but i can not get it to work. Does anyone have it fixed and want to share it with a newbie:) Or show me the right way to do it.

    #377931
    alantrewartha
    Participant

    the script i posted on there definitely does work to regionalise as British as part of a PKG postflight script. so you can adapt that. the Norwegian keyboard ID is 12. you can see this by changing the input source manually for a user and inspecting the contents of ~/Library/Preferences/ByHost/com.apple.HIToolbox.[GUID].plist

    HTH

    #377958
    hetjan
    Participant

    I’m having the same experience. If I understand the way Mac OS X works this method will work for each individual user but the login window will still be using the US keyboard…

    #377980
    thomasb
    Participant

    I find it safer and easier to just set all the initial settings the way I want them by hand, clean/modify the plist files with [b]Property List Editor[/b] and then install them with package installers. Scripting plist files with PlistBuddy/defaults can be a pain in the neck, and you will need to create the plist-files first anyway to be able to figure out how to create them with scripts.

    I just uploaded an example package (Localization-100210) to the [url=https://www.afp548.com/filemgmt/viewcat.php?cid=12][b]User submitted[/b][/url] category here at AFP548.com – I guess it will show up soon. It should help you get the desired language and keyboard layout over the login window and for every new user account.

    This tip will come in handy for editing those annoying .GlobalPreferences files: [url=http://www.macosxhints.com/article.php?story=20090915152215383]http://www.macosxhints.com/article.php?story=20090915152215383[/url]

    I have a separate package for setting the NTP server(s) and timezone, which I guess I could have included in my localization package, but not this time. See this thread for more info on how to make an NTP/timezone package: [url=https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=21477]https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=21477[/url]

    A lot of settings can be set using Local MCX too, which is an other interesting approach, but I feel Apple is lagging behind in terms of keeping Workgroup Manager up to date with new settings in Snow Leopard (i.e. Finder preferences). Since this localization package requires you to modify and install plist-files for both root, global Library and home Library, I find it easier to make a separate package for that purpose alone.

    Good luck!

    #377990
    thomasb
    Participant

    Here is the [url=http://thomasberglund.no/misc/Localization-100210.zip]Localization[/url] package example, for those of you waiting.

    #377996
    umd
    Participant

    thanks for sharing the package!!!!

    But couldn’t be it a problem to install foreign UUID (for example the ByHost plists) on to other machines?

    maybe it is an alternativ to combine the package with a script running at the first boot renaming those plists files?

    #377999
    thomasb
    Participant

    Yes, you need to rename the ByHost files. If you are using DeployStudio, the checkbox for renaming ByHost files is checked by default.

    If you want to make your own script to run on first boot with a LaunchDaemon, you can easily do that too.

    #378174
    thomasb
    Participant

    A little followup. Here is the script I use to rename byhost files for User Template and the root user at first boot (launched by a LaunchDaemon).

    [code]#!/bin/sh
    #
    # This script will rename ByHost files
    #
    # Thomas Berglund, 09.12.08
    # Thanks to hostdog74 at the unix.com forum for the directory traversing pseudocode 🙂

    # Make sure script is run by root user
    if [ “$(id -u)” != “0” ] ; then
    echo “This script must be run by root user.” 1>&2
    exit 1
    fi

    # Get the Universally Unique Identifier (UUID)
    # ioreg commands found in a comment at https://www.afp548.com/article.php?story=leopard_byhost_changes
    #
    # Check if hardware is PPC or early Intel
    if [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-50` == “00000000-0000-1000-8000-” ]]; then
    LEOUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c51-62 | awk {‘print tolower()’}`

    # Check if hardware is new Intel
    elif [[ `ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-50` != “00000000-0000-1000-8000-” ]]; then
    LEOUUID=`ioreg -rd1 -c IOPlatformExpertDevice | grep -i “UUID” | cut -c27-62`
    fi

    # Path to localized home directories
    dirPath=”/System/Library/User Template”

    # Find all ByHost direcotries
    find “${dirPath}” -name “ByHost” | while read BYHOST
    do
    # Find all .plist files in ByHost directories
    find “${BYHOST}” -type f -name “*.plist” | while read file
    do
    # Make new filename with new UUID
    newName=”`echo ${file} | sed “s/\(.*\)\.[^\.]*.plist/\1.${LEOUUID}.plist/”`”

    # Rename files
    mv “${file}” “${newName}”
    done
    done

    # Path to root directory
    dirPath2=”/private/var/root”

    # Find all ByHost direcotries
    find “${dirPath2}” -name “ByHost” | while read BYHOST
    do
    # Find all .plist files in ByHost directories
    find “${BYHOST}” -type f -name “*.plist” | while read file
    do
    # Make new filename with new UUID
    newName=”`echo ${file} | sed “s/\(.*\)\.[^\.]*.plist/\1.${LEOUUID}.plist/”`”

    # Rename files
    mv “${file}” “${newName}”
    done
    done[/code]

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Comments are closed