//$LNK res "c:\windows\gfawin\install\install.res"
OPENW #1,0,0,_X,_Y,16
TITLEW #1,"Magic Installer Ver. 1.0"
GRAPHMODE ,OPAQUE
DIM filename$(300),filesize%(300),filedir$(300)
CLS 4
DLG FILL 0,RGB(192,192,192)
OPTION BASE 1
windir$ = @getwindir$
@Sys_Info
a& = 1
@Call_Screen(a&)
WIN #1
@Dir_Dialog_From
IF e1| = 1
  IF EXIST(currentdir$+"setup.ini")
    @Read_Ini
  ELSE
    ALERT 1,"Setup.Ini File Not Found.|Unable to Continue.",1,"&End",k&
    CLOSEW #1
    END
  ENDIF
ELSE
  CLOSEW #1
  END
ENDIF
IF wver >= VAL(winversion$)
  @Dir_Dialog_To
  IF e| = 1
    @Check_Disk_Space
    @Test_Install_Dir
    FOR i& = 1 TO dnum&
      @Test_Sub_Dir
    NEXT i&
    @Install_Files
    IF auto$ = "AUTOEXEC = YES" THEN @Change_Autoexec
    IF conf$ = "CONFIG = YES" THEN @Change_Config
    IF wini$ = "WIN INI = YES" THEN @Change_Win
    IF oth$ = "OTHER = YES" THEN @Change_Other
    @End_Main
    @init_dde
    create_group(groupname$,"")
    show_group (groupname$,1)
    FOR z& = 1 TO itemnum&
      IF LEN(itemname$(z&)) > 1
        add_item (installdirto$+"\"+copydir$(z&)+iteminstall$(z&),itemname$(z&),"",0,0,0,"","",0)
      ENDIF
    NEXT z&
    exit_progman ("0")
    @kill_dde
  ENDIF
ELSE
  ALERT 1,"Unable to Install to this|Version of Windows",1,"Close",a&
ENDIF
a& = 2
@Call_Screen(a&)
CLOSEW #1

PROCEDURE Call_Screen(VAR a&)
  IF a& = 1
    logo& = LOADBMP(currentdir$+"vga.rle")
    ICON "",201,(_X-511)/2,25,511,198,SS_ICON
  ENDIF
  IF a& = 2
    FREEBMP logo&
  ENDIF
RETURN
> PROCEDURE Meter(VAR percent&,funct$,from$,to$,meter&)
  SELECT meter&
  CASE 1000
    DEFFILL 0
    CLIP (_X-400)/2,240,400,175
    CLIP OFFSET (_X-400)/2,240
    CLS 7
    COLOR 0,7
    DRAW 378,19 TO 378,99 TO 19,99
    DRAW 19,153 TO 19,119 TO 379,119
    DRAW 19,100 TO 19,19 TO 379,19
    COLOR 255,0
    DRAW 379,119 TO 379,153 TO 19,153
    BOX 20,20,379,100
  CASE 102
    COLOR 0,7
    TEXT 200-TXTLEN(funct$)/2,3,funct$
    TEXT 25,23,"From:"
    TEXT 30,42,SPACE$(80)
    TEXT 30,42,from$
    TEXT 25,62,"To:"
    TEXT 30,81,SPACE$(80)
    TEXT 30,81,to$
  CASE 100
    CLS 4
    CLIP OFFSET 0,0
    CLIP OFF
    COLOR 0,7
    DEFFILL 38
  ENDSELECT
  IF percent& < 100
    COLOR 7,0
    DRAW offset&,119 TO offset&,153
    offset& = (358 * percent&)/100 + 20
    IF offset& > 20
      COLOR 255,0
      DRAW 19,119 TO offset&,119
      COLOR 0,7
      DRAW offset&,119 TO offset&,153
      DRAW 19,153 TO offset&,153
      TEXT 200-TXTLEN(STR$(percent&)+"%")/2,128,STR$(percent&)+"%"
    ENDIF
  ENDIF
RETURN
> PROCEDURE Sys_Info
  DLL #1,"kernel.dll" //windir$+"\system\KERNEL.dll"
    DECL DWORD GetHeapSpaces(w)
  ENDDLL

  currentdir$ = @getdir$          // current logged directory
  sysdir$ = @getsysdir$           // Windows System directory
  wver = @getwinver               // Windows version number
  cpu = @getcpu                   // CPU type
  math$ = @getmathchip$()         // Co-processor
  FREEDLL 1
RETURN

> FUNCTION getdir$()            // get current logged directory
  ~INTR($21,_AH=$19)
  drive$ = CHR$(65 + _AL)
  drive& = _AL + 65
  buffer$=SPACE$(65)
  _DL=ASC(drive$) & 31
  _DS=SWAP(V:buffer$)
  _SI=V:buffer$
  ~INTR($21,_AH=$47)
  currentdir$ = drive$+":\"+CHAR{V:buffer$}
  RETURN currentdir$
ENDFUNC

> FUNCTION getwindir$()         // get Windows directory
  buff$=SPACE$(255)
  tchars& = GetWindowsDirectory(V:buff$,255)
  windir$ = LEFT$(buff$,tchars&)
  RETURN windir$
ENDFUNC

> FUNCTION getsysdir$()         // get Windows System directory
  buff$ = SPACE$(255)
  tchars& = GetSystemDirectory(V:buff$,255)
  sysdir$ = LEFT$(buff$,tchars&)
  RETURN sysdir$
ENDFUNC

> FUNCTION getwinver()          // get Windows version
  version& = GetVersion()
  wver = ((version& MOD 256) * 100) + version& \ 256
  RETURN wver
ENDFUNC

> FUNCTION getcpu()             // get CPU type
  flags% = GetWinFlags()
  match& = 1
  IF (flags% AND WF_CPU486) \ WF_CPU486 THEN
    cpu& = 486
  ELSE IF (flags% AND WF_CPU386) \ WF_CPU386
    cpu& = 386
  ELSE
    cpu& = 286
  ENDIF
  RETURN cpu&
ENDFUNC

> FUNCTION getmathchip$()       // get Math Co-Processor status
  flags% = GetWinFlags()
  IF flags% AND WF_80x87 THEN
    math$ = "YES"
  ELSE
    math$ = "NO"
  ENDIF
  RETURN math$
ENDFUNC
> PROCEDURE Dir_Dialog_To
  DISABLEW 1
  DIALOG #0,(_X-348)/2,260,348,150,"",$90400002
    CONTROL "Copy To What Directory?",100,"static",$10000000,20,30,250,20
    CONTROL "",101,"edit",$10810088,20,50,300,25
    CONTROL "&Continue",102,"button",$10010001,20,90,140,30
    CONTROL "E&xit",103,"button",$50000000,180,90,140,30
    CONTROL "",104,"static",$10000007,10,20,320,60
    CONTROL "",105,"static",$10000009,11,21,320,60
  ENDDIALOG
  SHOWDIALOG #0
  _WIN$(DLGITEM(0,101)) = windir$+"\"+defaultdir$
  ~SetFocus(DLGITEM(0,101))
  DO
    SLEEP
    IF MENU(15) = DLGITEM(-1,201)
      IF MENU(11) = WM_PAINT
        SETDC GetDC(DLGITEM(-1,201))
        STRETCH 0,0,logo&,511,198
        SETDC _DC(1)
      ENDIF
    ENDIF
    SELECT MENU(6)
    CASE 102
      installdirto$ = _WIN$(DLGITEM(0,101))
      e| = 1
    CASE 103
      e| = 2
    ENDSELECT
    IF MENU(11) = WM_KEYDOWN
      SELECT MENU(12)
      CASE VK_RETURN
        installdirto$ = _WIN$(DLGITEM(0,101))
        e| = 1
      CASE VK_ESCAPE
        e| = 2
      ENDSELECT
    ENDIF
    EXIT IF e| > 0
  LOOP
  ENABLEW 1
  CLOSEDIALOG #0
RETURN
> PROCEDURE Dir_Dialog_From
  DISABLEW 1
  DIALOG #0,(_X-348)/2,260,348,150,"",$90400002
    CONTROL "Copy From Where?",100,"static",$10000000,20,30,250,20
    CONTROL "",101,"edit",$10810088,20,50,300,25
    CONTROL "&Continue",102,"button",$10010001,20,90,140,30
    CONTROL "E&xit",103,"button",$50000000,180,90,140,30
    CONTROL "",104,"static",$10000007,10,20,320,60
    CONTROL "",105,"static",$10000009,11,21,320,60
  ENDDIALOG
  SHOWDIALOG #0
  _WIN$(DLGITEM(0,101)) = currentdir$
  ~SetFocus(DLGITEM(0,101))
  DO
    SLEEP
    IF MENU(15) = DLGITEM(-1,201)
      IF MENU(11) = WM_PAINT
        SETDC GetDC(DLGITEM(-1,201))
        STRETCH 0,0,logo&,511,198
        SETDC _DC(1)
      ENDIF
    ENDIF
    SELECT MENU(6)
    CASE 102
      installdirfrom$ = _WIN$(DLGITEM(0,101))
      e1| = 1
    CASE 103
      e1| = 2
    ENDSELECT
    IF MENU(11) = WM_KEYDOWN
      SELECT MENU(12)
      CASE VK_RETURN
        installdirfrom$ = _WIN$(DLGITEM(0,101))
        e1| = 1
      CASE VK_ESCAPE
        e1| = 2
      ENDSELECT
    ENDIF
    EXIT IF e1| > 0
  LOOP
  ENABLEW 1
  CLOSEDIALOG #0
RETURN

> PROCEDURE Test_Install_Dir
  TRY
    MKDIR installdirto$
  CATCH
  SELECT ERR
  CASE -13
    //    RMDIR installdirto$
  ENDSELECT
RETURN
> PROCEDURE Test_Sub_Dir
  TRY
    MKDIR installdirto$+"\"+dname$(i&)
  CATCH
  SELECT ERR
  CASE -13
    //RMDIR installdirto$
  ENDSELECT
RETURN
> PROCEDURE Install_Files
  DLL #1,"lzexpand.dll" // currentdir$+"lzexpand.dll"
    DECL LONG LZCopy(w,w)
  ENDDLL
  IF math$ = "YES" THEN testsystem$ = STR$(cpu&)+"MATH"
  IF math$ = "NO" THEN testsystem$ = STR$(cpu&)+"N/A"
  percent& = 0
  FOR currentdisk& = 1 TO disk&
    @Read_Info
    @Read_INF
    meter& = 1000
    funct$ = "Copying Files"
    from$ = ""
    to$ = ""
    @Meter(percent&,funct$,from$,to$,meter&)
    meter& = 102
    @Meter(percent&,funct$,from$,to$,meter&)
    FOR i& = 1 TO filecount& - 1
      IF type$(i&) = testsystem$ || type$(i&) = "N/A"
        @Copy_File
        meter& = 0
        percent& = percent& + INT((size% / VAL(dspace$))*100)
        @Meter(percent&,funct$,from$,to$,meter&)
      ENDIF
    NEXT i&
  NEXT currentdisk&
  meter& = 100
  percent& = 100
  @Meter(percent&,funct$,from$,to$,meter&)
  FREEDLL 1
RETURN
> PROCEDURE Copy_File
  from$ = UCASE$(installdirfrom$+filename$(i&))
  to$ = UCASE$(installdirto$+"\"+filedir$(i&)+filename$(i&))
  meter& = 102
  @Meter(percent&,funct$,from$,to$,meter&)
  OPEN "i",#1,from$
  OPEN "o",#2,to$
  size% = LOF(#1)
  a& = ^LZCopy(_FILE(1),_FILE(2))
  CLOSE #1
  CLOSE #2
RETURN
> PROCEDURE init_dde
  init_cons()
  ~SendMessage(-1,WM_DDE_INITIATE,w&,MAKELONG(app&,topic&))
  maxwait&=2000
  FOR x&=1 TO maxwait&
    PEEKEVENT
  NEXT x&
  serverw&=pm_hdl&
  ~SendMessage(-1,WM_DDE_ADVISE,w&,MAKELONG(item&,hopt&))
  wait_ack()
RETURN
> PROCEDURE init_cons()
  a$="Program Manager"+CHR$(0)
  pm_hdl&=FindWindow(0,V:a$)
  w&=WIN(1)
  a$="PROGMAN"+CHR$(0)
  t$="PROGMAN"+CHR$(0)
  item$=""
  app&=GlobalAddAtom(a$)
  topic&=GlobalAddAtom(t$)
  item&=GlobalAddAtom(item$)
  IF app&=0 OR topic&=0
    alert()
  ENDIF
RETURN
> PROCEDURE kill_cons()
  ~GlobalAddAtom(app&)
  topic&=GlobalAddAtom(topic&)
  item&=GlobalAddAtom(item&)
RETURN
> PROCEDURE alert
  ALERT 1,"No Server|",1,"Cancel",a&
  CLOSEW #1
  END
RETURN
> PROCEDURE wait_ack()
  i& = 0
  DO
    PEEKEVENT
    INC i&
  LOOP UNTIL MENU(11) = WM_DDE_ACK OR i& > maxwait&
  IF i& => maxwait&
    alert()
  ENDIF
RETURN
> PROCEDURE create_group(gname$,gpath$)
  itemalloc& = GlobalAlloc(GMEM_DDESHARE,100)
  item% = GlobalLock(itemalloc&)

  IF gname$ = ""
    ALERT 1,"CreateGroup ERROR|Bad GroupName",1,"OOPS!!!",alert|
  ELSE
    IF gpath$ <> ""
      gpath$ = ","+gpath$
    ENDIF
    group$ = "[CreateGroup("+gname$+gpath$+")]"+CHR$(0)
    POKE$ item%,group$
    ~PostMessage(serverw&,WM_DDE_EXECUTE,w&,MAKELONG(itemalloc&,0))
    wait_ack()
  ENDIF
  ~GlobalUnlock(itemalloc&)
  ~GlobalFree(itemalloc&)
RETURN
> PROCEDURE delete_group(gname$)
  itemalloc& = GlobalAlloc(GMEM_DDESHARE,100)
  item% = GlobalLock(itemalloc&)
  IF gname$ = ""
    ALERT 1,"DeleteGroup ERROR|Bad GroupName",1,"OOPS!!!",alert|
  ELSE
    group$ = "[DeleteGroup("+gname$+")]"+CHR$(0)
    POKE$ item%,group$
    ~PostMessage (serverw&,WM_DDE_EXECUTE,w&,MAKELONG(itemalloc&,0))
    wait_ack()
  ENDIF
  ~GlobalUnlock(itemalloc&)
  ~GlobalFree(itemalloc&)
RETURN
> PROCEDURE show_group(gname$,cmd%)
  itemalloc& = GlobalAlloc(GMEM_DDESHARE,100)
  item% = GlobalLock(itemalloc&)
  IF cmd% > 8 OR cmd% < 1
    ALERT 1,"ShowGroup ERROR|Bad Command Number",1,"OOPS!!!",alert|
  ELSE
    IF gname$ = ""
      ALERT 1,"ShowGroup ERROR|Bad GroupName",1,"OOPS!!!",alert|
    ELSE
      group$ = "[ShowGroup("+gname$+","+STR$(cmd%)+")]"+CHR$(0)
      POKE$ item%,group$
      ~PostMessage (serverw&,WM_DDE_EXECUTE,w&,MAKELONG(itemalloc&,1))
      wait_ack()
    ENDIF
  ENDIF
  ~GlobalUnlock(itemalloc&)
  ~GlobalFree(itemalloc&)
RETURN
> PROCEDURE add_item(cmd_line$,iname$,ipath$,iindex%,xpos%,ypos%,def_dir$,hotkey$,minimize%)
  itemalloc&=GlobalAlloc(GMEM_DDESHARE,100)
  item%=GlobalLock(itemalloc&)
  IF cmd_line$=""
    ALERT 1,"add_item error|bad command line",1,"ooops",alert|
  ELSE
    IF iname$=""
      ipath$=""
      iindex$=""
      xpos$=""
      ypos$=""
      def_dir$=""
      hotkey$=""
      minimize$=""
    ELSE IF ipath$=""
      iname$=","+iname$
      iindex$=""
      xpos$=""
      ypos$=""
      def_dir$=""
      hotkey$=""
      minimize$=""
    ELSE IF xpos%<=0
      iname$=","+iname$
      ipath$=","+ipath$
      ypos$=""
      def_dir$=""
      hotkey$=""
      minimize$=""
    ELSE IF ypos%<=0
      iname$=","+iname$
      ipath$=","+ipath$
      xpos$=","+STR$(xpos%)
      def_dir$=""
      hoykey$=""
      minimize$=""
    ELSE IF def_dir$=""
      iname$=","+iname$
      ipath$=","+ipath$
      xpos$=","+STR$(xpos%)
      ypos$=","+STR$(ypos%)
      hoykey$=""
      minimize$=""
    ELSE IF hotkey$=""
      iname$=","+iname$
      ipath$=","+ipath$
      xpos$=","+STR$(xpos%)
      ypos$=","+STR$(ypos%)
      def_dir$=","+def_dir$
      minimize$=""
    ELSE IF MINimize$=""
      iname$=","+iname$
      ipath$=","+ipath$
      xpos$=","+STR$(xpos%)
      ypos$=","+STR$(ypos%)
      def_dir$=","+def_dir$
      hotkey$=","+hotkey$
    ELSE
      iname$=","+iname$
      ipath$=","+ipath$
      xpos$=","+STR$(xpos%)
      ypos$=","+STR$(ypos%)
      def_dir$=","+def_dir$
      hotkey$=","+hotkey$
      minimize$=","+MINimize$
    ENDIF
    item$="[AddItem("+cmd_line$+iname$+ipath$+iindex$+xpos$+ypos$+def_dir$+hotkey$+MINimize$+")]"+CHR$(0)
    POKE$ item%,item$
    ~PostMessage(serverw&,WM_DDE_EXECUTE,w&,MAKELONG(itemalloc&,0))
    wait_ack()
  ENDIF
  ~GlobalUnlock(itemalloc&)
  ~GlobalFree(itemalloc&)
RETURN
> PROCEDURE exit_progman(gname$)
  itemalloc& = GlobalAlloc(GMEM_DDESHARE,100)
  item% = GlobalLock(itemalloc&)
  IF gname$ = ""
    ALERT 1,"ExitProgman ERROR|Bad GroupName",1,"oops!!",alert|
  ELSE
    group$ = "[ExitProgman("+gname$+")]"+CHR$(0)
    ~PostMessage(serverw&,WM_DDE_EXECUTE,w&,MAKELONG(itemalloc&,0))
    wait_ack()
  ENDIF
  ~GlobalUnlock(itemalloc&)
  ~GlobalFree(itemalloc&)
RETURN
> PROCEDURE kill_dde
  ~PostMessage(serverw&,WM_DDE_UNADVISE,w&,0)
  ~PostMessage(serverw&,WM_DDE_TERMINATE,w&,0)
  wait_ack()
  @kill_cons()
RETURN
> PROCEDURE End_Main
  DISABLEW 1
  IF exit_string$ = ""
    exit_string$ = "Please Take A Few Minutes to Read The Manual and send in the Registration Card."
  ENDIF
  t1$ = "   Install will now Open an Application Window in the Program Manager Before Ending."
  DIALOG #0,(_X-300)/2,260,300,200,"",$80400002
    CONTROL t1$,100,"static",$10000001,10,10,270,50
    CONTROL exit_string$,101,"static",$10000001,10,65,270,80
    CONTROL "E&xit",102,"button",$10000000,100,150,100,30
  ENDDIALOG
  SHOWDIALOG #0
  ~SetFocus(DLGITEM(0,102))
  DO
    SLEEP
    IF MENU(15) = DLGITEM(-1,201)
      IF MENU(11) = WM_PAINT
        SETDC GetDC(DLGITEM(-1,201))
        STRETCH 0,0,logo&,511,198
        SETDC _DC(1)
      ENDIF
    ENDIF
    EXIT IF MENU(6) = 102
  LOOP
  ENABLEW 1
  CLOSEDIALOG #0
RETURN
> PROCEDURE Read_Ini
  OPEN "i",#1,currentdir$+"setup.ini"
  INPUT #1,defaultdir$
  INPUT #1,dnum&
  IF dnum& > 0
    DIM dname$(dnum&)
    FOR i& = 1 TO dnum&
      INPUT #1,dname$(i&)
    NEXT i&
  ENDIF
  INPUT #1,itemnum&
  DIM itemdir$(itemnum&),iteminstall$(itemnum&),itemname$(itemnum&),type$(itemnum&),copydir$(itemnum&)
  FOR i& = 1 TO itemnum&
    INPUT #1,iteminstall$(i&)
    INPUT #1,itemname$(i&)
    INPUT #1,type$(i&)
    INPUT #1,itemdir$(i&)
    INPUT #1,copydir$(i&)
    IF copydir$(i&) = "DEFAULT" THEN copydir$(i&) = ""
    IF copydir$(i&) <> "" THEN copydir$(i&) = copydir$(i&)+"\"
  NEXT i&
  INPUT #1,groupname$
  INPUT #1,dspace$
  INPUT #1,winversion$
  INPUT #1,disk&
  INPUT #1,exit_string$
  INPUT #1,auto$
  INPUT #1,conf$
  INPUT #1,wini$
  INPUT #1,oth$
  CLOSE #1
RETURN
> PROCEDURE Check_Disk_Space
  installdrive = ASC(LEFT$(installdirto$,1))-64
  IF DFREE(installdrive) < VAL(dspace$)
    ALERT 1,"Insuffisent Disk Space to copy|you need at least "+dspace$+" bytes free",1,"Close",a&
    CLOSEW #1
    END
  ENDIF
RETURN
> PROCEDURE Read_Info
  IF EXIST(currentdir$+"info.fil")
    DO
      GETEVENT
      OPEN "i",#1,currentdir$+"info.fil"
      INPUT #1,disk&
      disk& = VAL(LEFT$(STR$(disk&),1))
      CLOSE #1
      IF disk& <> currentdisk&
        MESSAGE "Insert disk #"+STR$(currentdisk&)+" in Disk Drive","Disk Mask Error",MB_RETRYCANCEL|MB_TASKMODAL,n&
      ENDIF
    LOOP UNTIL disk& = currentdisk& || n& = IDCANCEL
    IF n& = IDCANCEL
      CLOSEW #1
      END
    ENDIF
  ELSE
    DO
      MESSAGE "info.fil was not found! Cannot Continue.","File not Found Error",MB_RETRYCANCEL|MB_SYSTEMMODAL,n&
    LOOP UNTIL n& = IDCANCEL
    CLOSEW #1
    END
  ENDIF
RETURN
> PROCEDURE Read_INF
  IF EXIST(currentdir$+"file.inf")
    OPEN "i",#1,currentdir$+"file.inf"
    filecount& = 1
    DO
      INPUT #1,filename$(filecount&)
      INPUT #1,filesize%(filecount&)
      INPUT #1,filedir$(filecount&)
      IF filedir$(filecount&) = "DEFAULT" THEN filedir$(filecount&) = ""
      IF filedir$(filecount&) <> "" THEN filedir$(filecount&) = filedir$(filecount&)+"\"
      filecount&++
      EXIT IF filecount& > 299
    LOOP UNTIL EOF(#1)
    CLOSE #1
  ELSE
    DO
      MESSAGE "file.inf was not found! Cannot Continue.","File not Found Error",MB_RETRYCANCEL|MB_SYSTEMMODAL,n&
    LOOP UNTIL n& = IDCANCEL
    CLOSEW #1
  ENDIF
RETURN
> PROCEDURE Change_Autoexec
  MESSAGE "Installer must make changes to your Autoexec.bat file.","Autoexec.bat Change",MB_YESNOCANCEL|MB_TASKMODAL,n&
  IF n& = IDCANCEL
    CLOSEW #1
    END
  ENDIF
  IF n& = IDYES
    install_drive$ = LEFT$(installdirto$,1)
    OPEN "a",#2,install_drive$ + ":\autoexec.bat"
    OPEN "i",#1,currentdir$+"setup.ini"
    autoexec$ = ""
    DO
      LINE INPUT #1,junk$
    LOOP UNTIL junk$ = "[AUTOEXEC]"
    DO
      LINE INPUT #1,junk$
      EXIT IF junk$ = "[CONFIG]"
      PRINT #2,junk$
    LOOP
    CLOSE #1
    CLOSE #2
  ENDIF
RETURN
> PROCEDURE Change_Config
  MESSAGE "Installer must make changes to your Config.sys file.","Config.sys Change",MB_YESNOCANCEL|MB_TASKMODAL,n&
  IF n& = IDCANCEL
    CLOSEW #1
    END
  ENDIF
  IF n& = IDYES
    install_drive$ = LEFT$(installdirto$,1)
    OPEN "a",#2,install_drive$ + ":\config.sys"
    OPEN "i",#1,currentdir$+"setup.ini"
    config$ = ""
    DO
      LINE INPUT #1,junk$
    LOOP UNTIL junk$ = "[CONFIG]"
    DO
      LINE INPUT #1,junk$
      EXIT IF junk$ = "[WIN INI]"
      PRINT #2,junk$
    LOOP
    CLOSE #1
    CLOSE #2
  ENDIF
RETURN
> PROCEDURE Change_Win
  MESSAGE "Installer must make changes to your Win.ini file.","Win.ini Change",MB_YESNOCANCEL|MB_TASKMODAL,n&
  IF n& = IDCANCEL
    CLOSEW #1
    END
  ENDIF
  IF n& = IDYES
    OPEN "a",#2,windir$+"\win.ini"
    OPEN "i",#1,currentdir$+"setup.ini"
    win_ini$ = ""
    DO
      LINE INPUT #1,junk$
    LOOP UNTIL junk$ = "[WIN INI]"
    PRINT #2,""
    DO
      LINE INPUT #1,junk$
      EXIT IF junk$ = "[OTHER]"
      PRINT #2,junk$
    LOOP
    CLOSE #1
    CLOSE #2
  ENDIF
RETURN
> PROCEDURE Change_Other
  OPEN "i",#1,currentdir$+"setup.ini"
  change_other$ = ""
  change_other_name$ = ""
  DO
    LINE INPUT #1,junk$
  LOOP UNTIL junk$ = "[OTHER]"
  INPUT #1,change_other_name$
  MESSAGE "Installer must make changes to your "+change_other_name$+" file.",change_other_name$+" Change",MB_YESNOCANCEL|MB_TASKMODAL,n&
  IF n& = IDCANCEL
    CLOSEW #1
    END
  ENDIF
  IF n& = IDYES
    //    IF EXIST(installdirto$+"\"+change_other_name$)
    //    OPEN "a",#2,installdirto$+"\"+change_other_name$
    //  ELSE
    OPEN "o",#2,installdirto$+"\"+change_other_name$
    //  ENDIF
    DO
      LINE INPUT #1,junk$
      PRINT #2,junk$
    LOOP UNTIL EOF(#1)
    CLOSE #2
  ENDIF
  CLOSE #1
RETURN
