Customizing your latest OS/2 install
Автор: Richard K. Goran
Дата: October, 1996
Источник: EDM/2
How many times have you thought about reinstalling OS/2 but thought to yourself Argh, another customization. In previous columns I have described changing certain Workplace Shell objects via a REXX program ([9512.htm WIN-ATM, December 1995]; [9609.htm LaunchPad, September 1996], etc.) In fact, many of the values you use to customize your system after an OS/2 install can be set using a REXX program.
I have a set of programs that I call SysGen01, SysGen02, etc. that I run after I have completed the OS/2 installation process. The function of each of these programs relies on the preceding program in the group having been run. Some of the programs in the series can be run at any time after the install is completed and is used to update my system. for example, SysGen04 is the program that builds my customized LaunchPad. I run this anytime I want to recreate the LaunchPad, not just after a new install. Since my purpose here is to make it easier for you to customize your individual systems, just making my SysGen programs available would not serve any useful purpose. Rather, my intent with this column is to show you how to build your own.
Warp Connect and Warp Server along with the expansion of notebook use has expanded the more-than-one-computer family greatly. In order to make these utility tools useable from one system to another, I have introduced my own environment variable, HOSTNAME, in each of my config.sys files. This allows me to determine which of my computers my programs are running on. You can let your imagine wander in selecting names for your systems. The VALUE() built-in function is used in REXX to interrogate the value of an environment variable. In the case of the machine name, I use:
GBL.hostname = VALUE( 'HOSTNAME',, 'OS2ENVIRONMENT' )
My use of GBL. as a stem or compound variable is simply a convention I use in my REXX programs to indicate variables that I can expose by exposing the stem of GBL.
The first of the series of programs you create should be a on-time use program that will do whatever cleanup from the install that you want along with creating Desktop folders that you would normally create with Drag and Drop. The second task is easier than the first. Part of what I refer to as cleanup includes tasks like setting your Desktop background color or image. On my primary computer I have copies of Warp without Windows (red box), Warp With WIN-OS2 (blue box), a small Warp maintenance partition, and Warp Connect. I use a different color on each Desktop so I have a quick visual indication of which system is running.
I have two folders on my Desktop named OS/2 Applications and DOS Applications respectively. Each is used to hold miscellaneous program objects and folders that I use frequently and that don't necessarily justify having their own container. I also keep a folder on my Desktop for my FTPPM objects and I create a folder to contain all of the objects that Warp Connect strews around your Desktop. [#Fragment 1 Fragment 1] shows an example of the code I use to set the Desktop background colors along with assigning some program paths to variables for each computer. [#Fragment 2 Fragment 2] contains the setup strings used to create the four folders. The icons that are referenced in this code fragment are images that I have collected that I like on my Desktop. You can remove the ICONFILE and ICONNFILE statements or replace the icon file names with images of your choice.
Some of the other settings that I used to find annoying every time I installed a new copy of OS/2 are related to the Confirmation entries found in the System Setup folder and the Keyboard object. You can use one of the INI display utilities like LISTINI to see what your entries are. The PM_Control stanza in the OS2.INI files contains the entries that you might want to set in SysGen01. [#Fragment 3 Fragment 3] contains the PM_Control values that I obtained by listing my OS2.INI file. Unfortunately, PM_Control keys are not included in the INI file unless they have been changed from their default value.
Including a complete copy of my SysGen01 program would exceed the space limitations of this column. However, it is available via anonymous FTP as sysgen01.zip. The copy on our FTP server is not intended to be run on any other system. I am making it available only as an example.
Additional functions included in my SysGen01 include setting the properties of all of the folders created by the install, building the four folders referenced above and creating the specific VDMs that I need for the few DOS programs I keep on the system, moving the Internet Access Kit (IAK) objects left on the Desktop by the installation into a single folder, and adding appropriate programs to the Startup folder.
With a little thought and planning, and keeping careful notes about the tasks you perform when you install a fresh copy of OS/2 you will have begin to build a list of the tasks you will want to perform in your own series of SysGen programs.
Resources
listini.zip Free for download
sysgen01.zip Free for download
Fragment 1
parse upper value VALUE( 'PATH',, 'OS2ENVIRONMENT' ) with, '\OS2\SYSTEM' -2 GBL.boot_drive +2 GBL.hostname = VALUE( 'HOSTNAME',, 'OS2ENVIRONMENT' ) select when GBL.hostname = 'AST01' then do TAPCIS_drive = 'C:' WP51_drive = 'C:' WP61_drive = 'C:' XTALK_drive = 'C:' if GBL.boot_drive = 'D:' then do /* Warp Connect */ red = 128 green = 255 blue = 255 background_setup_string =, '(none),,,C,' red green blue end if GBL.boot_drive = 'F:' then do /* Merlin */ red = 0 green = 255 blue = 255 background_setup_string =, '(none),,,C,' red green blue end end when GBL.hostname = 'SABER' then do /* customozed for SABER */ end otherwise do say ' Unknown HOSTNAME value of' GBL.hostname exit end end desktop_setup_string =, 'BACKGROUND=' || background_setup_string call SysSetObjectData desktop_id, desktop_setup_string if RESULT = 1 then do say ' Desktop background has been set' end else do say ' Unable to set Desktop background' exit end
Fragment 2
OS2_misc_folder_ID = DOS_misc_folder_ID = INTERNET_misc_folder_ID = CONNECT_misc_folder_ID = OS2_program_folder_class = 'WPFolder' OS2_program_folder_title = 'OS/2^Applications' OS2_program_folder_location = '' OS2_program_folder_setup_string =, 'TITLE=' || OS2_program_folder_title || ';' ||, 'ICONFILE=' || GBL.program_path || 'SYSGEN_O.ICO;' ||, 'ICONNFILE=1,' || GBL.program_path || 'SYSGEN_O.ICO;' ||, 'ICONVIEW=FLOWED,NORMAL;' ||, 'ALWAYSSORT=YES;' ||, 'OBJECTID=' || OS2_misc_folder_ID || ';' ||, '' call SyscreateObject OS2_program_folder_class,, OS2_program_folder_title,, OS2_program_folder_location,, OS2_program_folder_setup_string,, 'UPDATE' if RESULT <> 1 then do say ' Unable to create ' || OS2_program_folder_title end DOS_program_folder_class = 'WPFolder' DOS_program_folder_title = 'DOS^Applications' DOS_program_folder_location = '' DOS_program_folder_setup_string =, 'TITLE=' || DOS_program_folder_title || ';' ||, 'ICONFILE=' || GBL.program_path || 'SYSGEN_D.ICO;' ||, 'ICONNFILE=1,' || GBL.program_path || 'SYSGEN_D.ICO;' ||, 'ICONVIEW=FLOWED,NORMAL;' ||, 'ALWAYSSORT=YES;' ||, 'OBJECTID=' || DOS_misc_folder_ID || ';' ||, '' call SyscreateObject DOS_program_folder_class,, DOS_program_folder_title,, DOS_program_folder_location,, DOS_program_folder_setup_string,, 'UPDATE' if RESULT <> 1 then do say ' Unable to create ' || DOS_program_folder_title end INTERNET_program_folder_class = 'WPFolder' INTERNET_program_folder_title = 'Internet^Objects' INTERNET_program_folder_location = '' INTERNET_program_folder_setup_string =, 'TITLE=' || INTERNET_program_folder_title || ';' ||, 'ICONFILE=' || GBL.program_path || 'SYSGEN_I.ICO;' ||, 'ICONNFILE=1,' || GBL.program_path || 'SYSGEN_I.ICO;' ||, 'ICONVIEW=FLOWED,NORMAL;' ||, 'ALWAYSSORT=YES;' ||, 'OBJECTID=' || INTERNET_misc_folder_ID || ';' ||, '' call SyscreateObject INTERNET_program_folder_class,, INTERNET_program_folder_title,, INTERNET_program_folder_location,, INTERNET_program_folder_setup_string,, 'UPDATE' if RESULT <> 1 then do say ' Unable to create ' || INTERNET_program_folder_title end CONNECT_program_folder_class = 'WPFolder' CONNECT_program_folder_title = 'Warp^Connect' CONNECT_program_folder_location = '' CONNECT_program_folder_setup_string =, 'TITLE=' || CONNECT_program_folder_title || ';' ||, 'ICONFILE=' || GBL.program_path || 'SYSGEN_C.ICO;' ||, 'ICONNFILE=1,' || GBL.program_path || 'SYSGEN_C.ICO;' ||, 'ICONVIEW=FLOWED,NORMAL;' ||, 'ALWAYSSORT=YES;' ||, 'OBJECTID=' || CONNECT_misc_folder_ID || ';' ||, '' if GBL.warp_peer <> '' then do call SyscreateObject CONNECT_program_folder_class,, CONNECT_program_folder_title,, CONNECT_program_folder_location,, CONNECT_program_folder_setup_string,, 'UPDATE' if RESULT <> 1 then do say ' Unable to create ' || CONNECT_program_folder_title end end
Fragment 3
app_name = 'PM_ControlPanel' s=0 s=s+1; setting.s = 'Animation' COPIES( '00'x, 3 ) s=s+1; setting.s = 'ConfirmCopyMoveEtc' '0' s=s+1; setting.s = 'ConfirmDelete' '0' s=s+1; setting.s = 'ConfirmRenameFilesWithExt' '0' s=s+1; setting.s = 'ConfirmSubDelete' '1' s=s+1; setting.s = 'CursorBlinkRate' '500' s=s+1; setting.s = 'DisplayProgressInd' '1' s=s+1; setting.s = 'KeyRepeatDelay' '0' s=s+1; setting.s = 'KeyRepeatRate' '20' s=s+1; setting.s = 'LockStartInput' '010000'x s=s+1; setting.s = 'LogoDisplayTime' '2000' setting.0 = s do s = 1 to setting.0 parse value setting.s with, key_name, key_value key_value = STRIP( key_value ) call SysIni 'USER', app_name, key_name, key_value || '00'x if RESULT = 'ERROR:' then do say ' Error setting' key_name 'to' key_value 'in' app_name end end