VOICE Home Page: http://www.os2voice.org |
[Newsletter Index] |
By Peter
Brown © September 2001 |
What Multidesk does not include is the ability to have a different Sound Scheme
for each User. I'm not sure whether this was overlooked by the author or, maybe,
just not required for his original purpose. Having discovered the "single User"
Sounds Problem while writing this article I decided to investigate this further
- OK, I admit it, I was not happy using the same Sound Scheme as the Missus
:-)
The Sound Scheme settings reside in a separate INI file, "MMPM.INI",
which is usually located in BootDrive:\mmos2\mmpm.ini - BootDrive being the drive
that OS/2 boots from, in my case drive K:
A little bit of "experimentation" later and I have discovered that
it is possible (Well it is on the two PCs I have) to swap the mmpm.ini file at boot
up, before the WPS is loaded.
Following these reasonably simple instructions your Users can have different
Sounds rather than having to "share" (or argue about) Sound Schemes.
NOTE: This is described for Warp 4 users with all the standard (?) installation
paths for OS/2, MMOS/2 and MultiDesk, so make adjustments as necessary for your
system.
Having successfully installed MultiDesk and created the initial number of required
Users:-
1] Open the Properties Notebook for \MMOS2\MMPM.INI
2] Click on the File tab, then Page 2, then Uncheck "ReadOnly"
and "System" - only "Archive" should now be checked.
3] Copy \MMOS2\MMPM.INI to each Users Home Directory; Using the User "matty"
described above as an example:-
So
each User now has a copy of mmpm.ini to customise to their hearts content - as long
as we can get the system to load the correct mmpm.ini file for the User.
How I have achieved this is to modify the Pre-Login and Post-Login scripts -
Yes, I know I said I'd rather leave modifying these scripts to a more competent
person but the Wife, Bless her wrinkled stockings :-), insists that she has HER
Sound Scheme active all the time otherwise!
The modifications made are very simple - I have followed the example set by the
standard Pre and Post Login scripts, copying the way that the WarpCenter files are
substituted.
I have added two lines to the Pre-Login script that copy the MMPM.INI file from
\MMOS2 to \Users\LastUserName - where LastUserName is the User named in the \MuDesk\Last
file. This saves any changes that the Last User made to their Sound Scheme.
I have added several lines to the Post-Login script which deletes the current
\MMOS2\MMPM.INI file and copies the MMPM.INI file from the User Directory of the
currently "Logged-In" User to the \MMOS2 directory.
Both Pre and Post Login Rexx scripts have the same name "mdstart.cmd".
The Pre-Login script should be in the MultiDesk Directory.
Each User has an identical Post-Login script in their Home Directory; the template
for the Users version of mdstart.cmd is "mdstart.usr" and should be in
the MultiDesk directory. While these scripts have the same name they are easily
identified when open in the System Editor - Both files have a heading describing
itself as either a PRE or POST Login script.
To change these files I am going to use the versions of "mdstart.*"
located in the MultiDesk Directory - in my case K:\MuDesk.
Firstly, Copy mdstart.cmd to mdstart.cmd.org and mdstart.usr to mdstart.usr.org
so that we retain the originals - just in case!
Next open the System Editor with an empty file. Copy the following changed Pre-Login
script - starting with the "/* Pre-Login Rexx script file for MultiDesk */"
line and finishing with the "exit" line - and paste it into the blank
System Editor. Then save the System Editor file using File, Save as... "mdstart.cmd"
(located in the MultiDesk Directory - in my case K:\MuDesk) with the Type
property of "OS/2 Command File" and selecting to overwrite the existing
copy.
/* Pre-Login Rexx script file for MultiDesk */Now select File, New in the System Editor to create an empty file. Copy the following changed Post-Login script and paste it into the blank System Editor. Then save the System Editor file as "mdstart.usr" (located in the MultiDesk Directory - in my case K:\MuDesk) with the Type property of "OS/2 Command File" and selecting to overwrite the existing copy.
BootDrive = arg(1)
LastUser = arg(2)
/* --- !! This part is for the multi-user management of WarpCenter !! --- */
/* --- !! Do not delete it if you're interested in having multiple !! --- */
/* --- !! WarpCenter configurations. !! --- */
if LastUser = '' then exit
/* Read in all CFG file lines, to find users_tree option */
linein('.\mudesk.cfg', 1, 0)
do i=1 by 1 until Lines('.\mudesk.cfg') = 0
ThisLine = linein('.\mudesk.cfg')
if Abbrev(ThisLine, 'users_tree=') = 1 then leave
end
if Abbrev(ThisLine, 'users_tree=') = 1 then
parse value ThisLine with . '=' UTreePath
else
UTreePath = BootDrive || ':\Users'
if Right(UTreePath, 1) \= '\' then
UTreePath = UTreePath||'\'
/* Save previous User MMPM.INI file to previous User directory */
/* Modified 29/07/2001 by Pete Brown */
MMINIPath = UTreePath || LastUser
'@copy ' || BootDrive || ':\mmos2\mmpm.ini ' || MMINIPath || ' 1> nul 2> nul'
/* End Pete Brown modification */
DestPath = UTreePath || LastUser || '\WC'
'@copy ' || BootDrive || ':\OS2\DLL\dock*.cfg ' || DestPath || ' 1> nul 2> nul'
'@copy ' || BootDrive || ':\OS2\DLL\SCENTER.CFG ' || DestPath || ' 1> nul 2> nul'
/* --- !! End of the multi-user WarpCenter management part !! --- */
exit
/* Post-Login Rexx script file for MultiDesk */You will then have to copy this file "mdstart.usr", renaming it as part of the copy process to "mdstart.cmd", to each Users Directory and selecting to overwrite the existing file.
BootDrive = arg(1)
User = arg(2)
UserIni = arg(3)
SystemIni = arg(4)
UTreePath = arg(5)
/* --- !! This part is for the multi-user management of WarpCenter !! --- */
/* --- !! Do not delete it if you're interested in having multiple !! --- */
/* --- !! WarpCenter configurations. !! --- */
if Right(UTreePath, 1) \= '\' then
UTreePath = UTreePath||'\'
/* Copy current User MMPM.INI file to MMOS2 directory */
/* Modified 29/07/2001 by Pete Brown */
MMINIPath = UTreePath || User
'@del ' || BootDrive || ':\MMOS2\mmpm.ini 1> nul 2> nul'
'@copy ' || MMINIPath || '\mmpm.ini ' || BootDrive || ':\MMOS2 1> nul 2> nul'
/* End Pete Brown modification */
OrgPath = UTreePath || User || '\WC'
'@del ' || BootDrive || ':\OS2\DLL\dock*.cfg 1> nul 2> nul'
'@del ' || BootDrive || ':\OS2\DLL\SCENTER.CFG 1> nul 2> nul'
'@copy ' || OrgPath || '\dock*.cfg ' || BootDrive || ':\OS2\DLL 1> nul 2> nul'
'@copy ' || OrgPath || '\SCENTER.CFG ' || BootDrive || ':\OS2\DLL 1> nul 2> nul'
/* --- !! End of the multi-user WarpCenter management part !! --- */
exit
I have emailed the above script modifications to the MultiDesk author, Cristiano
Guadagnino, for him to peruse and include as the standard MultiDesk scripts
if he wants. Here is his reply:-
"The problem with Sound schemes is definitely a bug.. or
better, I totally overlooked the problem. Since my wife doesn't like
computer-generated sounds, she always keep the speakers off, and would never mess
with the sound schemes :-)
A BIG thank you for discovering this, and for providing
me with the solution!"
Personally, I'm pleased to have contributed - Now I do not have to have the same
Sound Scheme as the Missus :-)
Any time a New User is created you should copy any other Users version
of MMPM.INI to that New Users Directory or, as I discovered by accident during
my "experimentations", the Post-Login script causes OS/2 to create an
empty MMPM.INI for the New User to customise. Obviously you would then need to copy
any other necessary Keys from another MMPM.INI so I prefer to do a straight
copy of an existing MMPM.INI file and let the New User make any modifications they
require.
Just to finish off with some screenshots, Here are the MMPM.INI files
for Users losepete and matty open in INI Editor, part of the INI Tools V1.10 package
from Goran Ivankovic.
All this shows is that there are 2 different MMPM.INI files, in different locations
and with different contents as regards the Sound Scheme in use.
User losepete has a Sound Scheme based on the "Desktop Sounds"
scheme.
User matty has a Sound Scheme based on the "Space Sounds" scheme.
If you follow the above instructions correctly you will discover that this
MMPM.INI file swapping works.
I guess I can cross this off of my previous "Wish List".
Have Fun!