Nov 20, '08 07:30:00AM • Contributed by: MrLint
Some of the problems with the LN installer :
- Sometimes LN does not ask for authorization
- Running as a non-admin user does not work correctly
- Only installs the templates and seed files (referred to as seed files) to the directory of the account that installed it.
A successful install of LN consists of three "parts:"
- The Notes.app in /Applications
- The "seed" files in $HOME/Library/Application Support/Lotus Notes Data
- Preferences (Notes Preferences -- plain text dropped by the installer -- and com.ibm.notes.plist -- made by the app after user setup, and safe to ignore).
Create a folder called Lotus Notes Data, and copy the contents of the seed folder. It is safe to delete modem files and any languages you aren't going to use from the dic folder. Create a custom Notes Preferences file with the following contents:
[Notes]
SharedDataDirectory=/Library/Application Support/Lotus Notes Data
The installed Notes Preferences file is loaded up with lots of junk, mostly things that the application will recreate later during user setup. The new directive will tell the client to look in the specified path for any templates it needs, instead of assuming it's in the path the installer dropped it in -- this is critical for this to work.
Zip up that folder in Terminal, as using the Finder's zip will add a bunch of metadata that will cause the script later on to flake out. Call it ln_current_seed.zip. While in Terminal, also zip up the Notes.app in /Applications and call it ln_current_app.zip. Put these two files up on your favorite internal web server for later deployment.
The next secret is the deployment. To outline:
- Download, unzip the files and maint seeds to /Library » Application Support, and the application to /Applications.
- Drop Notes Preferences to default user, and maint to /System » Library » User Template » English.lproj » Library » Preferences.
- Clean up.
#!/bin/bash
USER_PREFS="0"
GOOD_SHARED_DIR="0"
MAJ_VER="0"
# get OS kernel version
#VERSION=$(sysctl -n kern.osrelease)
MAJ_VER=$(sysctl -n kern.osrelease | cut -d . -f 1)
if ! [ "$MAJ_VER" -ge "8" ]
then
echo "Lotus Notes 7 requires Mac OS X 10.4.X or later."
read -p "Press any key to exit"
exit
fi
# does the user have LN prefs?
if [ -e ~/Library/Preferences/Notes\ Preferences ]
then
USER_PREFS="1"
fi
if [ -e /Library/Application\ Support/Lotus\ Notes\ Data/Notes\ Preferences ]
then
GOOD_SHARED_DIR="1"
fi
cd /var/tmp
#get files
#need to suppress progress
echo "Retrieving files"
curl -O http://your.web.server/ln_current_app.zip
if [ "$GOOD_SHARED_DIR" -ne "1" ]
then
#Cleanup bad setup
sudo rm -rf /Library/Application\ Support/Lotus\ Notes\ Data
#get files
curl -O http://your.web.server/ln_current_seed.zip
#uncompress seeds
echo "Installing templates"
unzip -o ln_current_seed.zip -d /Library/Application\ Support/
echo "Correcting permissions"
sudo chmod -R 755 /Library/Application\ Support/Lotus\ Notes\ Data
fi
#drop prefs for all new users
echo "Installing multi-user prefs for new users"
sudo mkdir /System/Library/User\ Template/English.lproj/Library/Application\ Support/Lotus\ Notes\ Data
sudo cp -f /Library/Application\ Support/Lotus\ Notes\ Data/Notes\ Preferences /System/Library/User\ Template/English.lproj/Library/Preferences/Notes\ Preferences
#drop app & fix perms
echo "Installing Application"
unzip -o ln_current_app.zip -d /Applications/
echo "Correcting permissions and ownership"
sudo chown -R root:admin /Applications/Notes.app/
sudo chmod -R 775 /Applications/Notes.app/
#cleanup
echo "Cleaning up"
rm ln_current_app.zip
rm ln_current_seed.zip
exit
#drop prefs for current user
if [ "$USER_PREFS" -ne "1" ]
then
echo "Dropping multi user prefs for current user"
mkdir ~/Library/Application\ Support/Lotus\ Notes\ Data
cp /Library/Application\ Support/Lotus\ Notes\ Data/Notes\ Preferences ~/Library/Preferences/Notes\ Preferences
echo "Launch the Notes application and preceed with normal configuration."
fi
read -p "Press any key to exit"
exit#!/bin/bash
USER_PREFS="0"
GOOD_SHARED_DIR="0"
MAJ_VER="0"
# get OS kernel version
#VERSION=$(sysctl -n kern.osrelease)
MAJ_VER=$(sysctl -n kern.osrelease | cut -d . -f 1)
if ! [ "$MAJ_VER" -ge "8" ]
then
echo "Lotus Notes 7 requires Mac OS X 10.4.X or later."
read -p "Press any key to exit"
exit
fi
# does the user have LN prefs?
if [ -e ~/Library/Preferences/Notes\ Preferences ]
then
USER_PREFS="1"
fi
if [ -e /Library/Application\ Support/Lotus\ Notes\ Data/Notes\ Preferences ]
then
GOOD_SHARED_DIR="1"
fi
if [ "$GOOD_SHARED_DIR" -ne "1" ]
then
echo "Lotus Notes is not yet set up correctly. Contact CSS."
echo "ERROR - Shared directory not set up"
else
echo "Multi user setup appears correct"
#drop prefs for current user
if [ "$USER_PREFS" -ne "1" ]
then
echo "Dropping multi user prefs for current user"
mkdir ~/Library/Application\ Support/Lotus\ Notes\ Data
cp /Library/Application\ Support/Lotus\ Notes\ Data/Notes\ Preferences ~/Library/Preferences/Notes\ Preferences
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Notes.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'
killall -HUP Dock
echo "Launch the Notes application and preceed with normal configuration."
fi
fi
read -p "Press any key to exit"
exit- Replace http://your.web.server with the path to where you stored the LN files on your own server.
- Both scripts in their current state must be sourced.
- The installer script must be run as superuser (sudo).
- The user script must be run as the user intending to use LN.
