5 TITLE SELECT
- DOS
- SELECT
.EXE
;AN000;
6 SUBTTL SELECT2A
.asm
;AN000;
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10 ; SELECT2A.ASM : Copyright 1988 Microsoft
14 ; COMMENTS: Assemble with MASM 3.0 (using the -A option)
16 ; Panel flow is defined in the following files:
27 ; mrw0 6/16/88 Added panel for shell selection...
30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
31 DATA SEGMENT BYTE PUBLIC 'DATA' ;AN000; Dummy data segment
32 EXTRN SEG_LOC
:WORD ;AN000;
33 EXTRN NAMES_OFF
:WORD ;AN000;
34 EXTRN N_PRN_NAMES
:WORD ;AN000;
35 EXTRN MAX_NAME
:WORD ;AN000;
36 EXTRN SIZE_NAMES
:ABS
;AN000;
40 INCLUDE PANEL
.MAC
;AN000;
41 INCLUDE SELECT
.INC ;AN000;
42 INCLUDE PAN
-LIST
.INC ;AN000;
43 INCLUDE CASTRUC
.INC ;AN000;
44 INCLUDE STRUC.INC ;AN000;
45 INCLUDE MACROS
.INC ;AN000;
46 INCLUDE EXT
.INC ;AN000;
47 INCLUDE VARSTRUC
.INC ;AN000;
48 INCLUDE ROUT_EXT
.INC ;AN000;
50 PUBLIC DOS_LOC_SCREEN
;AN000;
51 PUBLIC PRINTER_SCREEN
;AN000;
52 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56 SELECT
SEGMENT PARA
PUBLIC 'SELECT' ;AN000;
57 ASSUME
CS:SELECT
,DS:DATA ;AN000;
59 INCLUDE CASEXTRN
.INC ;AN000;
61 EXTRN INSTALL_ERROR
:NEAR ;AN000;
62 EXTRN EXIT_DOS
:NEAR ;AN000;
63 EXTRN EXIT_SELECT
:NEAR ;AN000;
65 EXTRN PROCESS_ESC_F3
:NEAR ;AN000;
66 EXTRN INTRO_SCREEN
:NEAR ;AN000;
67 EXTRN choose_shell_screen
:NEAR ;mrw0 ;AC020;SEH
68 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
70 ; ������������������������������������Ŀ
73 ; ��������������������������������������
75 ; The DOS LOCATION screen is presented only if DOS is to be installed
77 ; The maximum length of the install path will be limited to 40 characters.
78 ; This restriction is imposed so that when generating commands
79 ; for the CONFIG.SYS and AUTOEXEC.BAT files, the command line length will not
80 ; exceed 128 characters.
81 ; When the screen is presented for the first time, the default install
82 ; path displayed will be "DOS". On subsequent presentations, the user
83 ; selected path will be displayed.
84 ; Valid keys are ENTER, ESC, F1, F3 and ASCII characters A to Z.
85 ;?????????????????????????????update?????????????????????????????????
86 ; The Functional Specification dated 5 May 1987, states that the APPEND
87 ; and PATH commands will be generated if the user selected to minimize workspace
88 ; or maximize workspace but not if the user selected balance workspace. Since
89 ; this assumption does not seem logical, the check has been revised to
90 ; generate the commands if the install destination is drive C:. Also, the
91 ; PC/DOS parameters screen does not check for the workspace definition.
92 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
93 DOS_LOC_SCREEN: ;AN000;
94 .IF < I_DEST_DRIVE ne E_DEST_DRIVE_C
> ;AN111; if install destination is drive A: or B: JW
96 INIT_VAR F_PROMPT
, E_PROMPT_NO
;AN000; set prompt = no
97 INIT_VAR F_PATH
, E_PATH_NO
;AN000; set path = no
98 INIT_VAR F_APPEND
, E_APPEND_NO
;AN000; set append = no
99 GOTO PRINTER_SCREEN
;AN000; goto next screen (PRINTER)
102 INIT_PQUEUE PAN_DOS_LOC
;AN000; initialize queue
103 PREPARE_PANEL PAN_HBAR
;AN000; prepare horizontal bar
104 PREPARE_CHILDREN
;AN000; prepare child panels
105 INIT_STRING STR_DOS_LOC
,S_DOS_LOC
,M_DOS_LOC
;AN000;
106 .IF < N_DISK1_MODE ne E_DISK1_INSTALL
> ;AN000; if this is not a new fixed disk JW
107 .THEN
;AN000; then JW
108 INIT_SCROLL SCR_COPY_DEST
,I_DESTINATION
;AN000; initialize destination choice JW
109 INIT_SCROLL_COLOUR SCR_COPY_DEST
,2 ;AN026; set field to not active color
110 .ENDIF
;AN000; endif JW
111 DISPLAY_PANEL
;AN000; display DOS_LOC panel
113 COPY_STRING S_STR120_1
,M_STR120_1
,S_DOS_LOC
;AN000;
115 GET_DOS_LOCATION: ;AN000;
116 GET_STRING STR_DOS_LOC
,S_STR120_1
,M_DOS_LOC
,FK_TAB
;AN000;get new install path
118 PROCESS_F3
;AN000; if user entered F3, exit to DOS
119 PROCESS_ESC
;AN000; if user entered ESC, goto previous screen
121 COPY_STRING S_STR120_1
,M_STR120_1
,S_USER_STRING
;AN000;
122 CHECK_PATH S_STR120_1
,0, 0 ;AN000;
123 .IF nc
near ;AN000; if path is valid
125 COPY_STRING S_DOS_LOC
,M_DOS_LOC
,S_USER_STRING
;AN000; save new DOS install path
126 COPY_STRING S_STR120_2
, M_STR120_2
, S_INSTALL_PATH
;AN000;save old install path
127 MERGE_STRING S_INSTALL_PATH
,M_INSTALL_PATH
,S_DEST_DRIVE
,S_DOS_LOC
;AN000; add 'C:\' to install path
128 COMPARE_STRINGS S_INSTALL_PATH
, S_STR120_2
;AN000; compare old and new paths
129 .IF c
;AN000; if paths different
131 INIT_VAR F_APPEND
, E_APPEND_YES
;AN000; set APPEND = yes
132 COPY_STRING S_APPEND
,M_APPEND
,S_INSTALL_PATH
;AN000; set new APPEND path
133 INIT_VAR F_PATH
, E_PATH_YES
;AN000; set PATH = yes
134 COPY_STRING S_PATH
, M_PATH
, S_INSTALL_PATH
;AN000; set new DOS path
135 .ELSEIF
< S_APPEND
eq 0 > ;AN000;
137 COPY_STRING S_APPEND
,M_APPEND
,S_INSTALL_PATH
;AN000;
138 INIT_VAR F_APPEND
, E_APPEND_YES
;AN000;
140 .IF < I_WORKSPACE
eq E_WORKSPACE_MIN
> ;AN000; if workspace option = minimize
142 INIT_VAR S_APPEND
, 0 ;AN000; set APPEND= null
144 INIT_VAR F_PROMPT
, E_PROMPT_YES
;AN000; set PROMPT = yes
146 HANDLE_ERROR ERR_BAD_PATH
, E_RETURN
;AN000; pop error message
147 GOTO GET_DOS_LOCATION
;AN000; goto get DOS location again
150 .IF < N_DISK1_MODE ne E_DISK1_INSTALL
> AND ;AN000; if this is not a new fixed disk JW
151 .IF < N_USER_FUNC
eq E_TAB
> ;AN000; if user tabbed to the scroll field JW
153 GET_SCROLL SCR_COPY_DEST
,I_DESTINATION
,FK_TAB
;AN000; JW
154 PROCESS_F3
;AN000; if user entered F3, exit to DOS JW
155 PROCESS_ESC
;AN000; JW
156 COPY_WORD I_DESTINATION
, I_USER_INDEX
;AN000; save new install destination drive JW
157 .IF < N_USER_FUNC
eq E_TAB
> ;AN000; if user entered ESC JW
159 SET_SCROLL SCR_COPY_DEST
,I_DESTINATION
;AN026; Set to not active
160 GOTO GET_DOS_LOCATION
;AC051;SEH ;AN000 Go get dos location JW
163 PUSH_HEADING DOS_LOC_SCREEN
;AC051;SEH ;AN000; save screen address on SELECT STACK
164 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
166 ; ������������������������������������Ŀ
169 ; ��������������������������������������
171 ; The PRINTER SCREEN is always presented.
172 ; The screen allows the user to indicate the number of printers attached.
173 ; Valid keys are ENTER, ESC, F1, F3 and numeric 0 to 7.
174 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
175 PRINTER_SCREEN: ;AN000;
176 .IF < N_PARALLEL
eq 0 > and ;AN000; if zero parallel and
177 .IF < N_SERIAL
eq 0 > ;AN000; and zero serial printers
179 INIT_VAR F_GRAPHICS
, E_GRAPHICS_NO
;AN000; set GRAPHICS = no JW
180 GOTO choose_shell_screen
;mrw0 ;AC020;SEH goto next screen
183 ;;;display panel to get number of printers ;
184 INIT_PQUEUE PAN_PRINTER
;AN000; initialize queue
185 PREPARE_PANEL PAN_HBAR
;AN000; prepare horizontal bar
186 PREPARE_CHILDREN
;AN000; prepare child panels
187 INIT_NUMERIC NUM_PRINTER
,N_NUMPRINT
,MAX_NUMPRINT
,S_STR120_1
;AN000;
188 DISPLAY_PANEL
;AN000;
190 ;;;get number of printers ;
191 GET_NUMERIC NUM_PRINTER
,N_NUMPRINT
,MIN_NUMPRINT
,MAX_NUMPRINT
,FK_TEXT
,S_STR120_1
;AN000;
193 ;;;save number of printers and goto next screen ;
194 .IF < N_USER_FUNC
eq E_ENTER
> ;AN000; if user entered ENTER key
196 COPY_WORD N_NUMPRINT
, N_USER_NUMERIC
;AN000; save number of printers
197 PUSH_HEADING PRINTER_SCREEN
;AN000; save screen address on SELECT STACK
199 GOTO PROCESS_ESC_F3
;AN000; user entered ESC or F3, take action
201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
203 ; ������������������������������������Ŀ
204 ; �PRINTER_TYPE_SCREEN �
206 ; ��������������������������������������
208 ; Get type of printer
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
211 PRINTER_TYPE_SCREEN: ;AN000;
212 .IF < N_NUMPRINT
eq MIN_NUMPRINT
> ;AN000; if zero printers specified
214 INIT_VAR F_GRAPHICS
, E_GRAPHICS_NO
;AN000; set GRAPHICS = no JW
215 GOTO choose_shell_screen
;mrw0 ;AC020; SEH goto next screen
218 GET_PRINTER_TITLES S_PRINT_FILE
;AN000; read printer titles from SELECT.PRT
219 .IF c
;AN000; if error reading file
221 INIT_VAR N_NUMPRINT
, MIN_NUMPRINT
;AN000; set no of printers = 0
222 HANDLE_ERROR ERR_BAD_PFILE
, E_RETURN
;AN000; popup error message
223 GOTO choose_shell_screen
;mrw0 ;AC020; SEH goto next screen
226 INIT_VAR N_COUNTER
, 1 ;AN000; set printer no = 1
227 .IF < I_WORKSPACE ne E_WORKSPACE_MIN
> ;AN014; SEH if not minimum DOS workspace
229 INIT_VAR F_GRAPHICS
, E_GRAPHICS_YES
;AN000; set GRAPHICS = yes SEH
232 GET_PRINTER_TYPE: ;AN000; repeat loop to get printer info
234 .IF < N_COUNTER
eq 0 > ;AN000; if printer no = zero
236 RELEASE_PRINTER_INFO
;AN000; release memory
239 GOTO INSTALL_ERROR
;AN000;
241 POP_HEADING
;AN000; goto previous screen
244 .SELECT
;AN000; get printer no sub panel
246 .WHEN
< N_COUNTER
eq 1 > ;AN000;
247 INIT_VAR N_BYTE_1
, '1' ;AC025;
249 .WHEN
< N_COUNTER
eq 2 > ;AN000;
250 INIT_VAR N_BYTE_1
, '2' ;AC025;
252 .WHEN
< N_COUNTER
eq 3 > ;AN000;
253 INIT_VAR N_BYTE_1
, '3' ;AC025;
255 .WHEN
< N_COUNTER
eq 4 > ;AN000;
256 INIT_VAR N_BYTE_1
, '4' ;AC025;
258 .WHEN
< N_COUNTER
eq 5 > ;AN000;
259 INIT_VAR N_BYTE_1
, '5' ;AC025;
261 .WHEN
< N_COUNTER
eq 6 > ;AN000;
262 INIT_VAR N_BYTE_1
, '6' ;AC025;
265 INIT_VAR N_BYTE_1
, '7' ;AC025;
269 GET_PRINTER_PARAMS N_COUNTER
, 0, N_RETCODE
;AN000; based on printer #
271 ;;;N_BYTE_1 = printer number ;
272 INIT_CHAR N_BYTE_1
, E_DISK_ROW
, E_DISK_COL
, SUB_PRINTER_1
;AN025; display the printer number
273 INIT_PQUEUE PAN_PRT_TYPE
;AN000; initialize queue
274 PREPARE_PANEL SUB_PRINTER_1
;AC025; printer no
275 PREPARE_PANEL PAN_HBAR
;AN000; prepare horizontal bar
276 PREPARE_CHILDREN
;AN000; prepare child panels
277 INIT_SCROLL_W_LIST SCR_PRT_TYPE
,SEG_LOC
,NAMES_OFF
,N_PRN_NAMES
,SIZE_NAMES
,MAX_NAME
,I_PRINTER
;AN000;
278 DISPLAY_PANEL
;AN000;
280 GET_SCROLL SCR_PRT_TYPE
,I_PRINTER
,FK_SCROLL
;AN000; get printer type
282 PROCESS_F3
;AN000; take action if F3 entered
284 .IF < N_USER_FUNC
eq E_ESCAPE
> ;AN000; if user entered ESC
286 DEC N_COUNTER
;AN000; dec printer number
287 GOTO GET_PRINTER_TYPE
;AN000; goto previous printer
290 COPY_WORD I_PRINTER
, I_USER_INDEX
;AN000; save printer type
292 GET_PRINTER_INFO I_PRINTER
;AN000; get printer info from SELECT.PRT
293 .IF c
;AN000; if error
295 HANDLE_ERROR ERR_BAD_PPRO
, E_RETURN
;AN000; popup error message
296 GOTO GET_PRINTER_TYPE
;AN000; goto get printer type
299 .IF < N_PRINTER_TYPE
eq E_PARALLEL
> and ;AN000;
300 .IF < N_PARALLEL
eq 0 > ;AN000;
302 HANDLE_ERROR ERR_PRT_NO_HDWR
, E_RETURN
;AN000;
303 GOTO GET_PRINTER_TYPE
;AN000;
306 .IF < N_PRINTER_TYPE
eq E_SERIAL
> and ;AN000;
307 .IF < N_SERIAL
eq 0 > ;AN000;
309 HANDLE_ERROR ERR_PRT_NO_HDWR
, E_RETURN
;AN000;
310 GOTO GET_PRINTER_TYPE
;AN000;
315 .WHEN
< N_PRINTER_TYPE
eq E_PARALLEL
> near ;AN000; if parallel printer
316 INIT_CHAR N_BYTE_1
, E_DISK_ROW
, E_DISK_COL
, SUB_PRINTER_1
;AN025; display the printer number
317 INIT_PQUEUE PAN_PARALLEL
;AN000; initialize queue
318 PREPARE_PANEL SUB_PRINTER_1
;AC025;
319 PREPARE_PANEL PAN_HBAR
;AN000; prepare horizontal bar
320 PREPARE_CHILDREN
;AN000; prepare child panels
321 INIT_SCROLL_W_LIST SCR_ACC_PRT
,SEG_LOC
,NAMES_OFF
,N_PRN_NAMES
,SIZE_NAMES
,MAX_NAME
,I_PRINTER
;AN000;
322 INIT_SCROLL_W_NUM SCR_PARALLEL
,N_PARALLEL
,I_PORT
;AN000;
323 DISPLAY_PANEL
;AN000; display panel
325 GET_SCROLL SCR_PARALLEL
, I_PORT
, FK_SCROLL
;AN000;
326 COPY_WORD I_PORT
, I_USER_INDEX
;AN000;
328 .OTHERWISE
near ;AN000; if serial printer
330 INIT_CHAR N_BYTE_1
, E_DISK_ROW
, E_DISK_COL
, SUB_PRINTER_1
;AN025; display the printer number
331 INIT_PQUEUE PAN_SERIAL
;AN000; initialize queue
332 PREPARE_PANEL SUB_PRINTER_1
;AN025;
333 PREPARE_PANEL PAN_HBAR
;AN000; prepare horizontal bar
334 PREPARE_CHILDREN
;AN000; prepare child panels
335 INIT_SCROLL_W_LIST SCR_ACC_PRT
,SEG_LOC
,NAMES_OFF
,N_PRN_NAMES
,SIZE_NAMES
,MAX_NAME
,I_PRINTER
;AN000;
336 INIT_SCROLL_W_NUM SCR_SERIAL
,N_SERIAL
,I_PORT
;AN000;
337 INIT_SCROLL SCR_PRT_REDIR
, I_REDIRECT
;AN000;
338 INIT_SCROLL_COLOUR SCR_PRT_REDIR
, 2 ;AN000;
339 DISPLAY_PANEL
;AN000;
342 SET_SCROLL SCR_PRT_REDIR
, I_REDIRECT
;AN000;
343 GET_SCROLL SCR_SERIAL
, I_PORT
, FK_TAB
;AN000;
344 COPY_WORD I_PORT
, I_USER_INDEX
;AN000;
345 .IF < N_USER_FUNC
eq E_TAB
> near ;AN000;
347 SET_SCROLL SCR_SERIAL
, I_PORT
;AN000;
348 GET_SCROLL SCR_PRT_REDIR
,I_REDIRECT
,FK_TAB
;AN000;
349 COPY_WORD I_REDIRECT
, I_USER_INDEX
;AN000;
352 .UNTIL
< N_USER_FUNC
eq E_ENTER
> or near ;AN000;
353 .UNTIL
< N_USER_FUNC
eq E_ESCAPE
> or near ;AN000;
354 .UNTIL
< N_USER_FUNC
eq E_F3
> ;AN000;
360 .IF < N_USER_FUNC
eq E_ESCAPE
> ;AN000; if user entered ESC
362 GOTO GET_PRINTER_TYPE
;AN000; goto get printer type
364 SAVE_PRINTER_PARAMS N_COUNTER
;AN000; save printer parameters
365 INC_VAR N_COUNTER
;AN000; inc printer number
366 COMP_WORDS N_COUNTER
, N_NUMPRINT
;AN000; if printer no > no of printers
370 RELEASE_PRINTER_INFO
;AN000; release memory
371 .IF c
;AN000; if error
373 GOTO INSTALL_ERROR
;AN000; :::::::
375 GOTO choose_shell_screen
;mrw0 ;AC020; SEH goto next screen
377 GOTO GET_PRINTER_TYPE
;AN000;
379 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;