'**************************************************************************
'**************************************************************************
'**************************************************************************
'**************************************************************************
''ix% = DoMsgBox("Before Read","DEBUG",MB_OK)


DECLARE SUB InitialIzation
DECLARE SUB BadOpSys
DECLARE SUB Notadmini
DECLARE SUB Disinsentive
DECLARE SUB FindOldSoftWare
DECLARE SUB ASKEXIT
DECLARE SUB GetPath
DECLARE SUB QuitInstall
DECLARE SUB FillCopyList
DECLARE SUB FillIniFile

DECLARE FUNCTION WriteDisToFile LIB "mscuistf.dll" (Direct$) AS INTEGER
DECLARE FUNCTION ReadIniDisin   LIB "mscuistf.dll" (Direct$) AS INTEGER
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION IsWinNT LIB "mscuistf.dll" AS INTEGER
DECLARE FUNCTION Launch32 LIB "mscuistf.dll" (szDir$) AS INTEGER
DECLARE FUNCTION GetString LIB "mscuistf.dll" (x%) AS INTEGER
DECLARE FUNCTION SetRunLine LIB "mscuistf.dll" (lpNewLine$) AS INTEGER
DECLARE FUNCTION SetDrive LIB "mscuistf.dll" AS INTEGER


''********   For Disincentive  ********************
CONST DIS_NOT_INSTALLED = 101
CONST DIS_INSTALLED = 202
CONST DIS_CORUPTED = 303
''*************************************************


'**************************************************************************
'**************************************************************************
SUB InitialIzation STATIC

    x% = GetString(8002)
    sz$ = GetSymbolValue("SetupString")
    SetTitle sz$
    RemoveSymbol "SetupString"

    SetBitmap COMDLL$, 1

    '' Read setup.inf file
    szSTR$ = GetSymbolValue("STF_SRCINFPATH")
    IF szSTR$ = "" THEN
        szSTR$ = GetSymbolValue("STF_CWDDIR")
    END IF
    SETUPINF$ = szSTR$
    ReadInfFile szSTR$ + "setup.inf"

    '' Find the Mother ship
    HWIN% = FindWindow("SETUP", "SETUP")
    
    '' Get source dir
    SRCDIR$ = GetSymbolValue("STF_SRCDIR")

    '' Disincentive
    RetCode% = ReadIniDisin(SRCDIR$ + "setup.ini")

    '' Get windows type
    WINTYPE% = IsWinNT

    IF WINTYPE% = -1 THEN
        BADOPS% = 500
        BadOpSys
    ELSEIF WINTYPE% = 0 THEN

        WINTYPE% = GetWindowsMajorVersion
        IF WINTYPE% = 3 THEN

            IF GetWindowsMinorVersion = 0 THEN
                BADOPS% = 550
                BadOpSys
            ENDIF

            IF GetWindowsMinorVersion = 99 THEN
                WINTYPE% = 4
            ENDIF

        ENDIF

        kbd& = SendMessage(HWIN%, 2076, 0, 0)
        IF kbd& <> 500 THEN
            sz$ = UIStartDlg(COMDLL$, NOTWINKEY, "FQuitDlgProc", 0, "")
        
            UIPopAll
            ERROR STFQUIT
        ENDIF

    ELSEIF WINTYPE% = 1 THEN
        SetSymbolValue "Win32Launch", SETUPINF$
        x% = Launch32("NTSP.EXE #400")
        sz$ = GetSymbolValue("Win32Message")
        RemoveSymbol "Win32Message"

        IF sz$ = "EXIT" THEN
            Notadmini
        ENDIF
    ENDIF

    ''Make Our Default drive and path string
    WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
    DESTDIR$ = WINDRIVE$ + DEFDIR$

    '' Get MSINPUT dir
    MSENV$ = WINDRIVE$ + DEFDIR$
    sz$ = FindFileUsingFileOpen(MSENV$ + "\POINTER.EXE")
    IF sz$ = "" THEN
       MSINP% = 0
    ELSE
       MSINP% = 1
    ENDIF
    sz$ = ""

    '' Set /O switch if on comand line
    SETUPTYPE$ = GetIniKeyString(SRCDIR$ + "setup.lst","SetupType","OEM")

    IF SETUPTYPE$ = "TRUE" THEN
        OEMTYPE% = 1
    ELSE
        OEMTYPE% = 0
    ENDIF

END SUB
'**************************************************************************

'**************************************************************************
'**************************************************************************
SUB BadOpSys STATIC

    sz$ = UIStartDlg(COMDLL$, BADOPS%, "FQuitDlgProc", 0, "")
    UIPopAll
    ERROR STFQUIT

END SUB
'**************************************************************************

'**************************************************************************
'**************************************************************************
SUB Notadmini STATIC

    sz$ = UIStartDlg(COMDLL$, NOTADMIN, "FQuitDlgProc", 0, "")
    UIPopAll
    ERROR STFQUIT

END SUB
'**************************************************************************

'**************************************************************************
'**************************************************************************
SUB Disinsentive STATIC

    IF RetCode% = DIS_NOT_INSTALLED THEN

REDOO:
        sz$ = UIStartDlg(COMDLL$, CDGETNAME, "FNameOrgDlgProc", APPHELP, HELPPROC$)
        szName$ = GetSymbolValue("NameOut")
        szOrg$ = GetSymbolValue("OrgOut")

        IF sz$ = "CONTINUE" THEN
            AddListItem "ConfirmTextIn", szName$
            AddListItem "ConfirmTextIn", szOrg$

            sz$ = UIStartDlg(COMDLL$, CDCONFIRMINFO, "FConfirmDlgProc", APPHELP, HELPPROC$)
        
            RemoveSymbol "ConfirmTextIn"                                
            
            IF sz$ = "BACK" THEN
                UIPop(1)
                GOTO REDOO
            ELSE
                UIPop(2)
            ENDIF

        ELSEIF sz$ = "EXIT" THEN
        
            ASKEXIT
            
            GOTO REDOO

        ENDIF

        SetSymbolValue "INSTALLEDNAME", szName$ 
        SetSymbolValue "INSTALLEDORG", szOrg$ 
        sx% = WriteDisToFile(SRCDIR$ + "setup.ini")
        
    ELSEIF RetCode% = DIS_INSTALLED THEN

DISINSTALLED:
        szName$ = GetSymbolValue("INSTALLEDNAME")
        szOrg$ = GetSymbolValue("INSTALLEDORG")
        szSer$ = GetSymbolValue("INSTALLEDSER")

        AddListItem "ConfirmTextIn", szName$
        AddListItem "ConfirmTextIn", szOrg$
        AddListItem "ConfirmTextIn", szSer$

        sz$ = UIStartDlg(COMDLL$, CDALREADYUSED, "FConfirmDlgProc", APPHELP, HELPPROC$)

        IF sz$ = "EXIT" THEN
            ASKEXIT

            GOTO DISINSTALLED

        ELSE
            UIPop(1)
        ENDIF

    ELSEIF RetCode% = DIS_CORUPTED THEN

DISCORUPTED:
        sz$ = UIStartDlg(COMDLL$, CDBADFILE, "FInfoDlgProc", APPHELP, HELPPROC$)

        IF sz$ = "EXIT" THEN
            ASKEXIT

            GOTO DISCORUPTED

        ELSE
            UIPop(1)
        ENDIF

    ENDIF

END SUB
'**************************************************************************

'**************************************************************************
'**************************************************************************
SUB FindOldSoftWare STATIC

    DLG% = DESTPATH
    Cursor% = ShowWaitCursor()
        
    ''Find old Nexus dir
    IF WINTYPE% = 1 THEN
        SetSymbolValue "Win32Launch", SETUPINF$
        x% = Launch32("NTSP.EXE #300")
        sz$ = GetSymbolValue("Win32Message")
        RemoveSymbol "Win32Message"

        IF FindFileUsingFileOpen(sz$ + "\KBD32.CPL") <> "" THEN
            DESTDIR$ = sz$
            DLG% = PREINSTALLED
        ENDIF
    ELSE
        sz$ = GetIniKeyString(MSENV$, "DIRECTORYS","Keyboard")
        IF FindFileUsingFileOpen(sz$ + "\KBD16.CPL") <> "" THEN
            DESTDIR$ = sz$
            DLG% = PREINSTALLED

        ENDIF
    ENDIF

    '' Kill Old Pointer   This stuff is in \common\win\inc\pointer.h
    kbd& = SendMessage(FindWindow("POINTEXE","Pointer.exe Invisible Window"), 1133, 0, 0)
    
    '' Kill Real Old Pointer
    kd& = SendMessage(FindWindow("GROWSTUB",""),2,0,0)

    RestoreCursor Cursor

END SUB
'**************************************************************************

'**************************************************************************
'**************************************************************************
SUB GetPath STATIC

    SetSymbolValue "EditFocus", "ALL"
    

GETPATHL1:

    SetSymbolValue "EditTextIn", DESTDIR$
    sz$ = UIStartDlg(COMDLL$, DLG%, "FEditDlgProc", APPHELP, HELPPROC$)
    
    IF sz$ = "CONTINUE" THEN

        DESTDIR$ = GetSymbolValue("EditTextOut")

        IF WINTYPE% = 1 THEN
               ''   INPUT    USER
            free& = 347957 + 422923
        ELSEIF WINTYPE% = 3 THEN
               ''   INPUT    USER
            free& = 271697 + 345995
        ELSEIF WINTYPE% = 4 THEN
               ''   INPUT    USER
            free& = 347957 + 422923
        ENDIF
        drive$ = MID$(DESTDIR$, 1, 1)

        IF GetFreeSpaceForDrive(drive$) < free& THEN
NOSPACE:
            sz$ = UIStartDlg(COMDLL$, 6600, "FInfo0DlgProc", 0, "")
            IF sz$ = "CONTINUE" THEN
                UIPop 1
                GOTO GETPATHL1
            ELSEIF sz$ = "BACK" THEN
                UIPop 1
                ASKEXIT
                GOTO GETPATHL1
            ELSEIF sz$ = "REACTIVATE" THEN
                GOTO NOSPACE
            ELSE
                GOTO GETPATHL1
            END IF
        END IF


        ''Validate new path.
        IF IsDirWritable(DESTDIR$) = 0 THEN
            
BADPATH:
            sz$ = UIStartDlg(COMDLL$, BADPATH, "FInfo0DlgProc", 0, "")
            IF sz$ = "REACTIVATE" THEN
                GOTO BADPATH
            END IF
            UIPop 1

            GOTO GETPATHL1

        END IF
        UIPop 1

    ELSEIF sz$ = "REACTIVATE" THEN
        GOTO GETPATHL1
    ELSE
        ASKEXIT

        GOTO GETPATHL1

    END IF

END SUB
'**************************************************************************

'*************************************************************************
'*************************************************************************
SUB QuitInstall STATIC

    IF ERR = 0 THEN
        sz$ = UIStartDlg(COMDLL$, EXITSUCCESS, "FInfoDlgProc", 0, "")

        IF WINTYPE% = 1 THEN
            x% = WriteProfileString("windows","run", MSENV$ + "\POINT32.EXE, " + DESTDIR$ + "\KBDX32.EXE")
        ELSE
            x% = SetRunLine(MSENV$ + "\POINTER.EXE " + DESTDIR$ + "\KBDX16.EXE ")'' must have space at end of line
        ENDIF

        IF sz$ = "EXIT" THEN
            x% = PostMessage(HWIN%, 2048, 100, 0)  
            UIPop 1
            END

        ELSEIF sz$ = "BACK" THEN

            UIPop 1
            IF WINTYPE% = 1 THEN
                CopyFile SETUPINF$ + "ntsp.exe", DESTDIR$ + "\ntsp.exe", cmdNone, 0
                x% = PostMessage(HWIN%, 2048, 100, 0)  
                x% = WinExec(DESTDIR$ + "\ntsp.exe  #100", 5)
            ELSE
                x% = PostMessage(HWIN%, 2048, 100, 1)  
            ENDIF
            END
        ELSE
            END
        END IF

        UIPop 1
        END

    ELSEIF ERR = STFQUIT THEN
        dlg% = EXITQUIT
    ELSE
        dlg% = EXITFAILURE
    END IF
QUITL1:
    sz$ = UIStartDlg(COMDLL$, dlg%, "FInfo0DlgProc", 0, "")
    IF sz$ = "REACTIVATE" THEN
        GOTO QUITL1
    END IF
    UIPop 1
    x% = PostMessage(HWIN%, 2048, 100, 0)  
    
    END
 
    
END SUB
'*************************************************************************

'*************************************************************************
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
    IF szDir$ = "" THEN
        MakePath = szFile$
    ELSEIF szFile$ = "" THEN
        MakePath = szDir$
    ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
        MakePath = szDir$ + szFile$
    ELSE
        MakePath = szDir$ + "\" + szFile$
    END IF
END FUNCTION
'*************************************************************************

'*************************************************************************
'*************************************************************************
SUB ASKEXIT STATIC
ASKQUIT:
    sz$ = UIStartDlg(COMDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
    IF sz$ = "EXIT" THEN
        UIPopAll
        ERROR STFQUIT
    ELSEIF sz$ = "REACTIVATE" THEN
        GOTO ASKQUIT
    ELSE
        UIPop 1
    END IF

END SUB
'*************************************************************************

'*************************************************************************
'*************************************************************************
SUB FillCopyList STATIC

    ClearCopyList

    LangType& = SendMessage(HWIN%, 2089, 0, 0)
    AddSectionFilesToCopyList "MS_Input", SRCDIR$, MSENV$
    ini$ = GetWindowsDir

    IF WINTYPE% = 3 THEN
        AddSectionFilesToCopyList "Sys16", SRCDIR$, ini$ + "SYSTEM"
        AddSectionFilesToCopyList "Win16drv", SRCDIR$, MSENV$
        AddSectionFilesToCopyList "Win16", SRCDIR$, MSENV$
        AddSectionFilesToCopyList "Nex16", SRCDIR$, DESTDIR$

        IF LangType = 65 THEN
            AddSectionKeyFileToCopyList "WinLan", "A", SRCDIR$, ini$ + "SYSTEM" 
            AddSectionKeyFileToCopyList "Common", "A", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZA", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "A", SRCDIR$, MSENV$ 
            AddSectionKeyFileToCopyList "Common", "K", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 66 THEN
            AddSectionKeyFileToCopyList "WinLan", "B", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "B", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZB", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "B", SRCDIR$, MSENV$ 
            AddSectionKeyFileToCopyList "Common", "L", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 67 THEN
            AddSectionKeyFileToCopyList "WinLan", "C", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "C", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZC", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "C", SRCDIR$, MSENV$ 
            AddSectionKeyFileToCopyList "Common", "M", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 68 THEN
            AddSectionKeyFileToCopyList "WinLan", "D", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "D", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZD", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "D", SRCDIR$, MSENV$ 
            AddSectionKeyFileToCopyList "Common", "N", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 69 THEN
            AddSectionKeyFileToCopyList "WinLan", "E", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "E", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZE", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "E", SRCDIR$, MSENV$ 
            AddSectionKeyFileToCopyList "Common", "O", SRCDIR$, DESTDIR$ 
        ENDIF

    ELSEIF WINTYPE% = 4 THEN
        AddSectionFilesToCopyList "Sys16", SRCDIR$, ini$ + "SYSTEM"
        AddSectionFilesToCopyList "Win16", SRCDIR$, MSENV$
        AddSectionFilesToCopyList "Nex16", SRCDIR$, DESTDIR$
        AddSectionFilesToCopyList "Win16drv", SRCDIR$, MSENV$

        IF LangType = 65 THEN
            AddSectionKeyFileToCopyList "WinLan", "A", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "A", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "K", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "A", SRCDIR$, MSENV$ 
        ELSEIF LangType = 66 THEN
            AddSectionKeyFileToCopyList "WinLan", "B", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "B", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "L", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "B", SRCDIR$, MSENV$ 
        ELSEIF LangType = 67 THEN
            AddSectionKeyFileToCopyList "WinLan", "C", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "C", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "M", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "C", SRCDIR$, MSENV$ 
        ELSEIF LangType = 68 THEN
            AddSectionKeyFileToCopyList "WinLan", "D", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "D", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "N", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "D", SRCDIR$, MSENV$ 
        ELSEIF LangType = 69 THEN
            AddSectionKeyFileToCopyList "WinLan", "E", SRCDIR$, ini$ + "SYSTEM"
            AddSectionKeyFileToCopyList "Common", "E", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "O", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "DosLan", "E", SRCDIR$, MSENV$ 
        ENDIF


    ELSEIF WINTYPE% = 1 THEN
        AddSectionFilesToCopyList "Sys32", SRCDIR$, ini$ + "SYSTEM32"
        AddSectionFilesToCopyList "WinNTdrv", SRCDIR$, MakePath(GetWindowsDir, "SYSTEM32\DRIVERS")
        AddSectionFilesToCopyList "Win32", SRCDIR$, MSENV$
        AddSectionFilesToCopyList "Nex32", SRCDIR$, DESTDIR$

        IF LangType = 65 THEN
            AddSectionKeyFileToCopyList "WinLan", "K", SRCDIR$, ini$ + "SYSTEM32"
            AddSectionKeyFileToCopyList "Common", "K", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "A", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZA", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 66 THEN
            AddSectionKeyFileToCopyList "WinLan", "L", SRCDIR$, ini$ + "SYSTEM32"
            AddSectionKeyFileToCopyList "Common", "L", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "B", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZB", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 67 THEN
            AddSectionKeyFileToCopyList "WinLan", "M", SRCDIR$, ini$ + "SYSTEM32"
            AddSectionKeyFileToCopyList "Common", "M", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "C", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZC", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 68 THEN
            AddSectionKeyFileToCopyList "WinLan", "N", SRCDIR$, ini$ + "SYSTEM32"
            AddSectionKeyFileToCopyList "Common", "N", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "D", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZD", SRCDIR$, DESTDIR$ 
        ELSEIF LangType = 69 THEN
            AddSectionKeyFileToCopyList "WinLan", "O", SRCDIR$, ini$ + "SYSTEM32"
            AddSectionKeyFileToCopyList "Common", "O", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "E", SRCDIR$, DESTDIR$ 
            AddSectionKeyFileToCopyList "Common", "ZE", SRCDIR$, DESTDIR$ 
        ENDIF

    ENDIF

END SUB
'*************************************************************************

'*************************************************************************
'*************************************************************************
SUB FillIniFile STATIC

    ini$ = MakePath(GetWindowsDir(), "CONTROL.INI")
    CreateIniKeyValue ini$, "MMCPL", "mskbd", DESTDIR$ + "\kbd16.cpl", cmoOverwrite

    ini$ = MakePath(GetWindowsDir(), "SYSTEM.INI")
    szSec$ = "keyboard"

    IF WINTYPE% = 3 THEN
        CreateIniKeyValue ini$, "386Enh", "keyboard", MSENV$ + "\ms_input.386", cmoOverwrite
    ENDIF

    CreateIniKeyValue ini$, "boot", "keyboard.drv", MakePath(MSENV$,"kbd.drv"), cmoOverwrite
    
    CreateIniKeyValue ini$, szSec$, "Type", "4", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "SubType", "8", cmoOverwrite

    ini$ = MSENV$ + "\MS_INPUT.INI"

    CreateIniKeyValue ini$, "Directories", "Keyboard", DESTDIR$, cmoOverwrite
    
    CreateIniKeyValue ini$, szSec$, "Interface", "Keyboard", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "Device", "Keyboard", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "CapsLockDisable", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "NumLock", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "CapsLock", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "ScrollLock", "OFF", cmoOverwrite
    
    szSec$ = "WindowsPointer"
    
    CreateIniKeyValue ini$, szSec$, "WrapBarrier", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "SnapTo", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "SnapBack", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "ScreenWrap", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "FastPointer", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "MouseKey", "ON", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "Home", "OFF", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "MouseKeyFeedback", "ON", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "Sonar", "OFF", cmoOverwrite
        
    szSec$ = "Sound"

    CreateIniKeyValue ini$, szSec$, "KeySound", "SoundsOff", cmoOverwrite

    szSec$ = "TaskMan"
    szWin$ = GetWindowsDir

    CreateIniKeyValue ini$, szSec$, "F2", szWin$ + "WINFILE.EXE", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "F3", DESTDIR$ + "\KBDX16.EXE", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "F4", szWin$ + "PBRUSH.EXE", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "F5", szWin$ + "NOTEPAD.EXE", cmoOverwrite
    CreateIniKeyValue ini$, szSec$, "F6", szWin$ + "CALC.EXE", cmoOverwrite

    ini$ = ""
    szSec$ = ""

END SUB
'*************************************************************************
