System and method for installing program code for operation from multiple bootable operating systems5361358Abstract A method, system and process for installing an application under a first operating system and translating the installation parameters into a set of similar parameters to assure proper execution under a second operating system. The invention prompts a user for selection of preferences for an initial operating system and stores the initial selections representing a user's requirements under the initial operating system. Then, the hardware is examined to ascertain a list of all bootable devices and the operating systems associated therewith. The list of bootable devices is presented to the user for selection of which operating systems the application should be enabled under. Finally, the application is enabled in accordance with the information stored in the initial selections on each of the selected bootable devices and the operating systems associated with the bootable device. Claims Having thus described our invention, what we claim as new, and desire to secure by Letters Patent is: Description FIELD OF THE INVENTION
______________________________________
/********************************************************/
/*
** FUNCTION NAME: LAPSCFGSYSMsgProc
**
** FUNCTION:
This routine sets up and displays the
** IDLG.sub.-- LAPSCFGSYS dialog
**
** CALLED FROM: Module: XIATND.C
** EXIT NORMAL: 0.
** Function is exception handled (see EXCEPT.C).
*/
/********************************************************/
MRESULT EXPENTRY LAPSCFGSYSMsgProc(hWndD1g,
message, mp1, mp2)
HWND hWndD1g;
USHORT message;
MPARAM mp1;
MPARAM mp2;
MRESULT fpRC = (MRESULT) FALSE;
SHORT mymp1;
USHORT i;
CHAR insertstring[2];
SHORT SelectedItem;
BOOL anyselected;
CHAR Temp[] = "a:";
WITH.sub.-- HANDLING
switch(message)
{
case WM.sub.-- INITDLG:
for (i=0;i<BootableDriveCount;i++) {
insertstring[0] = Bootable.sub.-- Drive.sub.-- List[i];
insertstring[1] = NULLCHAR;
WinSendD1gItemMsg(hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES, LM.sub.-- INSERTITEM,
MPFROM2SHORT (LIT.sub.-- SORTASCENDING, 0),
MPFROMP(insertstring));
} /* endfor */
anyselected = FALSE;
for (i=0;i<BootableDriveCount;i++) {
Temp[0] = Bootable.sub.-- Drive.sub.-- List[i];
if (Check.sub.-- Configsys.sub.-- For.sub.-- Ibmcomdrive(Temp)) {
WinSendD1gItemMsg(hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES, LM.sub.-- SELECTITEM,
MPFROMSHORT(i), MPFROMSHORT(TRUE));
anyselected = TRUE;
}
} /* endfor */
if (!anyselected) {
WinSendD1gItemMsg(hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES, LM.sub.-- SELECTITEM,
MPFROMSHORT(0), MPFROMSHORT(TRUE));
} /* endif */
WinSendD1gItemMsg( hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES, LM.sub.-- SELECTITEM,
MPFROMSHORT(0), MPFROMSHORT(TRUE));
WinSetFocus(HWND.sub.-- DESKTOP,
WinWindowFromID(hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES));
fpRC = (MRESULT)TRUE;
CenterD1gBox(hWndD1g, hWndClient);
break; // End of WM.sub.-- INITDLG
case WM.sub.-- CONTROL:
break; // End of WM.sub.-- CONTROL
case WM.sub.-- COMMAND:
switch(SHORT1FROMMP(mp1))
{
case CFGSYS.sub.-- PB.sub.-- CONTINUE: //Continue
i = 0;
SelectedItem = LIT.sub.-- FIRST;
// loop through selected list and retrieve values
selected
do {
SelectedItem = (SHORT) WinSendD1gItemMsg
(hWndD1g, CFGSYS.sub.-- LB.sub.-- DRIVES,
LM.sub.-- QUERYSELECTION,
MPFROMSHORT( SelectedItem), 0L);
if (Selectedltem != LIT.sub.-- NONE) {
WinSendD1gItemMsg(hWndD1g,
CFGSYS.sub.-- LB.sub.-- DRIVES,
LM.sub.-- QUERYITEMTEXT,
MPFROM2SHORT(SelectedItem, sizeof
insertstring),
MPFROMP(insertstring));
SelectedDxives[i] = insertstring[0];
i++;
} else { //at end of list
SelectedDrives[i] NULLCHAR;
} /* endif */
} while (SelectedItem != LIT.sub.-- NONE);
if (i==0) {
DisplayMessageBox( hWndD1g,
DLGS.sub.-- CFGSYS.sub.-- MUSTSELECT.sub.-- TITLE,
DLGS.sub.-- CFGSYS.sub.-- MUSTSELECT.sub.-- MSG,
ACTION.sub.-- MSG, OK.sub.-- BUTTON,
(USHORT)CFGSELE.sub.-- EXTHELP25720,
(PSZ)NULL); //
} else {
WinDismissDlg(hWndD1g, FALSE);
} /* endif */
break;
case CFGSYS.sub.-- PB.sub.-- EXIT: // Exit
WinDismissD1g(hWndD1g, FALSE);
SelectedDrives[0] = NULLCHAR;
break;
}
break; // End of WM.sub.-- COMMAND
case WM.sub.-- CLOSE:
WinDismissD1g(hWndD1g, FALSE);
break; // End of WM.sub.-- CLOSE
default:
fpRC = WinDefDlgProc(hWndD1g, message, mp1,
mp2);
break;
}
ON.sub.-- EXCEPTION
ReportError(theException, PM .vertline. LOG, hWndD1g, 0);
WinDismissD1g(hWndD1g, FALSE);
mymp1 = (SHORT)theException;
WinPostMsg(hWnd, LAPSWM.sub.-- EXCEPT,
MPFROMSHORT(mymp1), 0L);
END.sub.-- HANDLING;
/*
** Retum value
*/
return fpRC;
} /* End of LAPSCFGSYSMsgProc */
______________________________________
UPDATE An intermediate file, PROTOCOL.INI, is created during the install process. This file is used as input for updating the other operating system environments for execution of the application. The following is an example of a PROTOCOL.INI file created by a user using LAPS to do configuration:
______________________________________
[PROT.sub.-- MAN]
DRIVERNAME = PROTMAN$
[IBMLXCFG]
IBMTOK.sub.-- nif = IBMTOK.nif
LANDD.sub.-- nif = LANDD.nif
[LANDD.sub.-- nif]
DriverName = LANDD$
Bindings = IBMTOK.sub.-- nif
ETHERAND.sub.-- TYPE = "I"
SYSTEM.sub.-- KEY = 0.times.0
OPEN.sub.-- OPTIONS = 0.times.2000
TRACE = 0.times.0
LINKS = 8
MAX.sub.-- SAPS = 3
MAX.sub.-- G.sub.-- SAPS = 0
USERS = 3
TI.sub.-- TICK.sub.-- G1 = 255
T1.sub.-- TICK.sub.-- G1 = 15
T2.sub.-- TICK.sub.-- G1 = 3
TI.sub.-- TICK.sub.-- G2 = 255
T1.sub.-- TICK.sub.-- G2 = 25
T2.sub.-- TICK.sub.-- G2 = 10
IPACKETS = 250
UIPACKETS = 100
MAXTRANSMITS = 6
MINTRANSMITS = 2
TCBS = 64
GDTS = 30
ELEMENTS = 800
[IBMTOK.sub.-- nif]
DriverName = IBMTOK$
ADAPTER = "PRIMARY"
MAXTRANSMITS = 6
RECVBUFS = 2
RECVBUFSIZE = 256
XMITBUFS = 1
______________________________________
To see how the CONFIG.SYS file is updated based on the PROTOCOL.INI file, look at the following sections from the PROTOCOL.INI file. LAPS locates the *.NIF file containing information pertinent to the driver that is being configured.
______________________________________
[IBMLXCFG]
IBMTOK.sub.-- nif = IBMTOK.nif
.
.
[IBMTOK.sub.-- nif]
DriverName = IBMTOK$
.
.
.
______________________________________
Note that the file name is retrieved from a common section (IBMLXCFG) for the particular driver of interest. Then, the *.NIF file is read to extract the information necessary to build the appropriate `DEVICE=` statements in the CONFIG.SYS file:
______________________________________
[IBMTOK]
Type = NDIS
Title = "IBM Token-Ring Network Adapters"
Version = 1.0
DriverName = IBMTOK$
Xports = NETBEUI LANDD
Copyfile = LT2.MSG, LT2H.MSG
[FILE]
Name = IBMTOK.OS2
Path = IBMCOM MACS
______________________________________
In this example, the following statement would be built in the CONFIG.SYS file: ##EQU1## This same scenario is repeated for each drive selected on the window display illustrated in FIG. 4. ENABLING OTHER BOOTABLE SYSTEMS In order to discern which bootable devices are available on a given computer system, the following logic is performed. First, to locate bootable devices, a loop is executed for possible drives A to Z to determine if the particular device is a fixed disk drive. If the drive is a fixed drive, then if it is a local drive, it is added to a temporary list of local drives and a test is performed to determine if the physical drive has been configured by examination of the SYSLEVEL.OS2 file and CONFIG.SYS file of OS/2. If the physical drive has been configured, then it is added to the list of drives. To determine if the drive is bootable, the device must first be opened employing a DOSOPEN call. If the device is a local device, then the device parameters must be retrieved from the Control file, DOSDEVIOCTL. If the device is a tape drive, then it is noted. Otherwise, a test is performed to determine if the device is fixed or removable by further examination of DOSDEVIOCTL. If the device is a fixed drive device then the fact is noted. However, if the device is removable, then the floppy drive device is returned. Otherwise, an unknown media type is returned. If the device is a non-local device, that fact is also noted, and finally, the device is closed. A final check is performed to verify that the proper system files reside on the bootable device. The source code corresponding to this processing appears below.
______________________________________
SOURCE CODE FOR CREATING LIST
______________________________________
/********************************************************/
/*
** FUNCTION NAME: Find.sub.-- Local.sub.-- Bootable.sub.-- Drives
**
** FUNCTION: which drives are local
** and bootable.
** CALLED FROM: Module: XIATND.C
**
** INPUT:
**
** OUTPUT:
**
** EXIT NORMAL: 0. Exception handled.
*/
/********************************************************/
VOID Find.sub.-- Local.sub.-- Bootable.sub.-- Drives(PSZ BootDrives)
USHORT count;
USHORT i;
CHAR dname; /* ASCII drive name */
CHAR temp1ist[26];
CHAR syslevelfile[MAXPATHLEN]= "a:";
CHAR configfile[MAXPATHLEN]="a:";
DosError(DISABLE.sub.-- ERRORPOPUPS);
/* Disable error */
count = 0;
for (i=0;i<26;i++) { Do drives A thru Z */
dname = (CHAR)`A` + (CHAR)i; /* Setup drive */
if (check.sub.-- media.sub.-- type(&dname) == FIXED.sub.-- DRIVE) { //if
it's local
templist[count] = dname; //add it to our array
count++;
}
} //end for
//Now determine which of these are bootable
BootableDriveCount = 0;
strcat(syslevelfile,SYSLEVEL);
strcat(configfile,CONFIG.sub.-- SYS);
for (i=0;i<count;++ ) {
syslevelfile[0] = templist[i];
if (Exist(syslevelfile)) {
configfile[0] = templist[i];
if (Exist(configfile)) {
BootDrives[BootableDriveCount] = temp1ist[i];
BootableDriveCount++;
} /* endif */
} /* endif *
} /* endfor */
DosError(ENABLE.sub.-- ERRORPOPUPS); /* Disable error
popups */
}
______________________________________
SOURCE CODE THAT DETERMINES THE
MEDIA TYPE FOR EACH DEVICE SCANNED IN
FIND.sub.-- LOCAL.sub.-- BOOTABLE.sub.-- DRIVES
______________________________________
/********************************************************/
/*
** FUNCTION NAME: check.sub.-- media.sub.-- type
**
** FUNCTION:
** This routine will check the type of the media - and
** determine if it
** is a tape drive, floppy, remote drive, or fixed or
** CD-ROM.
**
** The routine expects as input the drive letter for
** the media.
**
** CALLED FROM: Module: check.sub.-- disk.sub.-- space
**
** INPUT
**
** OUTPUT:
**
** EXIT NORMAL: . . . Function is exception handled.
*/
/********************************************************/
USHORT check.sub.-- media.sub.-- type(driveletter)
CHAR * driveletter;
USHORT rc;
CHAR DriveString[3];
Type.sub.-- Drive DevInfo;
USHORT DevHandle;
USHORT action;
ULONG size = 0;
BYTE ParmList = 0.times.00;
BYTE Fixed;
//Determine if drive is floppy or non-local
DriveString[0] = *driveletter;
DriveString[1] = COLONCHAR;
DriveString[2] = NULLCHAR;
//Open the device
if (!(DosOpen(DriveString, &DevHandle, &action, size,
NORM, READ.sub.-- ONLY, OPENMODE, 0L))){
// Get device parameters
if (!(DosDevIOCtl(&DevInfo, &ParmList, 0.times.0063,
0.times.008, DevHandle))) {
if (DevInfo.DevType == 6) { //it's a tape drive
rc = TAPE.sub.-- DRIVE;
} else {
//Determine if media is removable
if (!(DosDevIOCtl(&Fixed, &ParmList, 0.times.0020,
0.times.0008,
DevHandle))) {
if (Fixed) {
rc = FIXED.sub.-- DRIVE; //it's not
removable
} else {
rc = FLOPPY.sub.-- DRIVE; //it's a
removable floppy
} /* endif */
} else {
rc = UNKNOWN.sub.-- MEDIA;
} /* endif */
} endif */
} else {
rc = UNKNOWN.sub.-- MEDIA;
} /* endif */
DosClose(DevHandle);
} else {
rc = REMOTE.sub.-- DRIVE;
} /* endif */
return(rc);
}
/********************************************************/
/*
** FUNCTION NAME: Exist
**
** FUNCTION: checks to see if IBMLVL.INI exists
**
** CALLED FROM: Function: Check.sub.-- IBMLVL (this module)
**
** INPUT:
**
** OUTPUT: returns TRUE if file exists or FALSE if it
** doesn't
**
** EXIT NORMAL: 0.
*/
/********************************************************/
BOOL Exist (PSZ pszFileName)
{
HDIR = HDIR .sub.-- CREATE;
USHORT usSearchCount = 1;
FILEFINDBUF findbuf;
if (DosFindFirst(pszFileName,
&hdir,
FILE.sub.-- DIRECTORY,
&findbuf,
sizeof(findbuf),
&usSearchCount,
0L))
return FALSE ;
else
return TRUE ;
} /* Exist ( ) */
______________________________________
While the invention has been described in terms of a preferred embodiment in a specific system environment, those skilled in the art recognize that the invention can be practiced, with modification, in other and different hardware and software environments within the spirit and scope of the appended claims.
|
Same subclass Same class Consider this |
||||||||||
