⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adsetup.mst

📁 AutoDocumentation System for Windows Version 2.01.40
💻 MST
📖 第 1 页 / 共 2 页
字号:
    IF ERR = 0 THEN
        dlg% = IDD_DIALOG6          '' Setup is complete
    ELSEIF ERR = STFQUIT THEN
        dlg% = IDD_DIALOG5          '' user clicked Exit button
    ELSE
        dlg% = IDD_DIALOG4          '' failure during setup!
    END IF

QuitL1:
    ''
    ''  Display the Quit Dialog
    ''
    sz$ = UIStartDlg(CUIDLL$, dlg%, "SetupInformationNoExitDialog", NO_HELP, NO_HELP_FILE$)
''    IF sz$ = "REACTIVATE" THEN
''        Goto QuitL1
''    END IF
    UIPopAll
    END             '' end of script

ErrQuit:
    ''
    ''  Whoa, files were bad!
    ''
    i% = DoMsgBox("Setup sources were corrupted.  Contact vendor for new diskettes.", "AutoDocumentation System Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
    UIPopAll
    END         '' end of script



BADPATH:
    ''
    ''  One of the paths were not valid
    ''
    sz$ = UIStartDlg(CUIDLL$, IDD_DIALOG4, "SetupInformationNoExitDialog", NO_HELP, NO_HELP_FILE$)
''    IF sz$ = "REACTIVATE" THEN
''        Goto BADPATH
''    END IF
    UIPop 1
    RETURN



AskQuit:
    ''
    ''  Display the Quit Prompt Dialog
    ''
    sz$ = UIStartDlg(CUIDLL$, IDD_DIALOG3, "SetupQuitDialog", NO_HELP, NO_HELP_FILE$)
    UIPop 1

    IF sz$ = "EXIT" THEN
        UIPopAll
        ERROR STFQUIT
''    ELSEIF sz$ = "REACTIVATE" THEN
''        Goto AskQuit
    END IF
    RETURN



'**********************************************************************
'** Purpose:
'**     Builds the copy list and performs all installation operations.
'** Arguments:
'**     none.
'** Returns:
'**     none.
'**********************************************************************
Function Install(AutoDocPath$, SelectList$) Static As String
    ''
    ''  Build the source and destination paths
    ''
    SourceDirectory$ = GetSymbolValue("STF_SRCDIR")
    WindowsSystem$   = GetWindowsDir()+"System"

    ''
    ''  Create the INI file
    ''
    INIFile$ = AutoDocPath$ + "\AUTODOCW.INI"

    ''
    ''  Create the destination root and the SCRIPT subdir if necessary
    ''
    CreateDir AutoDocPath$, cmoNone

    ''
    ''  Check and add the base product to the copy list if selected
    ''
    If GetListItem(SelectList, 1)="ON" Then
        ScriptPath$ = AutoDocPath$ + "\SCRIPTS"
        CreateDir ScriptPath$, cmoNone
        CreateIniKeyValue INIFile$, "Directories", "SCRIPT-PATH", ScriptPath$, cmoOverwrite

        ProjDirPath$ = AutoDocPath$ + "\PROJECTS"
        CreateDir ProjDirPath$, cmoNone
        CreateIniKeyValue INIFile$, "Directories", "PROJECT-PATH", ProjDirPath$, cmoOverwrite

        KywdDirPath$ = AutoDocPath$ + "\KEYWORDS"
        CreateDir KywdDirPath$, cmoNone
        CreateIniKeyValue INIFile$, "Directories", "KEYWORD-PATH", KywdDirPath$, cmoOverwrite

        CreateIniKeyValue INIFile$, "Directories", "LANGUAGE-PATH", AutoDocPath$, cmoOverwrite

        AddSectionFilesToCopyList "BaseProduct", SourceDirectory$, AutoDocPath$
        AddSectionFilesToCopyList "Keywords", SourceDirectory$, KywdDirPath$
        AddSectionFilesToCopyList "Windows$System", SourceDirectory$, WindowsSystem$
    EndIf

    ''
    ''  Check and add the Help files to the copy list if selected
    ''
    If GetListItem(SelectList, 2)="ON" Then
        AddSectionFilesToCopyList "Help", SourceDirectory$, AutoDocPath$
    End If

    ''
    ''  Check and add the Samples to the copy list
    ''
    If GetListItem(SelectList, 3)="ON" Then
        SamplesPath$ = AutoDocPath$ + "\SAMPLES"
        CreateDir SamplesPath$, cmoNone
        AddSectionFilesToCopyList "Samples", SourceDirectory$, SamplesPath$
    EndIf

    ''
    ''  Check and add Word20 to the copy list
    ''
    If GetListItem(SelectList, 4)="ON" Then
        Word20Path$ = AutoDocPath$ + "\WORD20"
        CreateDir Word20Path$, cmoNone
        AddSectionFilesToCopyList "Word20", SourceDirectory$, Word20Path$
    End If

    ''
    ''  Check and add Word60 to the copy list
    ''
    If GetListItem(SelectList, 5)="ON" Then
        Word60Path$ = AutoDocPath$ + "\WORD60"
        CreateDir Word60Path$, cmoNone
        AddSectionFilesToCopyList "Word60", SourceDirectory$, Word60Path$
    End If

    ''
    ''  Copy the files...
    ''
    CopyFilesInCopyList

    ''
    ''  Reset the copy list
    ''
    ClearCopyList
    Cursor%=ShowWaitCursor()

    ''
    ''  Was Word20 installed?
    ''
    If GetListItem(SelectList, 4)="ON" Then
        WP$ = "Microsoft Word 2.0"
        CreateIniKeyValue INIFile$, WP$, "DIR", "WORD20", cmoOverwrite
        CreateIniKeyValue INIFile$, WP$, "DLL", "WORD20.DLL", cmoOverwrite
        Word20$ = GetIniKeyString( INIFile$, WP$, "EXE" )
        If Word20$ = "" Then
            Word20$ = "WINWORD.EXE"
        EndIf
        CreateIniKeyValue INIFile$, WP$, "EXE", Word20$, cmoOverwrite
        Word20$ = GetIniKeyString( INIFile$, WP$, "MACRO-FILE" )
        If Word20$ = "" Then
            Word20$ = "API8X11.DOT"
        EndIf
        CreateIniKeyValue INIFile$, WP$, "MACRO-FILE", Word20$, cmoOverwrite
        i% = AddWordProcessor( WP$, INIFile$ )
    end if

    ''
    ''  Was Word60 installed?
    ''
    If GetListItem(SelectList, 5)="ON" Then
        WP$ = "Microsoft Word 6.0"
        CreateIniKeyValue INIFile$, WP$, "DIR", "WORD60", cmoOverwrite
        CreateIniKeyValue INIFile$, WP$, "DLL", "WORD60.DLL", cmoOverwrite
        Word60$ = GetIniKeyString( INIFile$, WP$, "EXE" )
        If Word60$ = "" Then
            Word60$ = "WINWORD.EXE"
        EndIf
        CreateIniKeyValue INIFile$, WP$, "EXE", Word60$, cmoOverwrite
        Word60$ = GetIniKeyString( INIFile$, WP$, "MACRO-FILE" )
        If Word60$ = "" Then
            Word60$ = "API8X11.DOT"
        EndIf
        CreateIniKeyValue INIFile$, WP$, "MACRO-FILE", Word60$, cmoOverwrite
        i% = AddWordProcessor( WP$, INIFile$ )
    end if

    RestoreCursor Cursor%

    ''
    ''  If the user wants to create a program manager entry, do so...
    ''
    If GetListItem(SelectList, 6)="ON" Then
        ''
        ''  Find out what group the user chose
        ''
        Group$=GetSymbolValue("DefaultGroupResult")

        ''
        ''  Create the Program Manager group
        ''
        CreateProgmanGroup Group$, "", cmoNone

        ''
        ''  Create the application's item
        ''
        CreateProgmanItem Group$, "AutoDocumentation System", AutoDocPath$+"\AUTODOCW.EXE", "", cmoOverwrite

        ''
        ''  Setup an item for the read-me file
        ''
        notepadCmd$ = "NOTEPAD " + AutoDocPath$ + "\README.TXT"
        CreateProgmanItem Group$, "README.TXT", notepadCmd$, "", cmoOverwrite

        ''
        ''  Setup an item for the history file
        ''
        CreateProgmanItem Group$, "HISTORY", "NOTEPAD " + AutoDocPath$ + "\HISTORY.TXT", "", cmoOverwrite

        ''
        ''  Show the read-me file
        ''
        result% = WinExec( notepadCmd$, 1 )
    End If

    ''
    ''  Get the restart count
    ''
    i%=RestartListEmpty()

    ''
    ''  If necessary, copy the restart items
    ''
    If i%=0 Then
        i% = DoMsgBox("Setup will now install system components that could not be copied while Windows is running", "AutoDocumentation System Setup", MB_TASKMODAL+MB_ICONHAND+MB_OK)
        i% = ExitExecRestart()
    End If
End Function



'**
'** Purpose:
'**     Appends a file name to the end of a directory path,
'**     inserting a backslAsh character As needed.
'** Arguments:
'**     szDir$  - full directory path (with optional ending "\")
'**     szFile$ - filename to append to directory
'** Returns:
'**     Resulting fully qualified path name.
'*************************************************************************
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

''
''  Accumulate file sizes from a list
''
Function GetSectionSize(Section$) Static As Long
    Size& = 0

    For SectionIndex% = 1 to GetListLength(Section$)
        Current$ = GetListItem(Section$, SectionIndex%)
        MakeListFromSectionKeys "SizeList", Current$
        listLength% = GetListLength("SizeList")

        For Index% = 1 to listLength%
            Result$ = GetListItem("SizeList", Index%)

            Size& = Size& + GetSectionKeySize(Current$, Result$)
        Next Index%

        RemoveSymbol "SizeList"
    Next SectionIndex%

    GetSectionSize = Size&
End Function

''
''
''
Function AddWordProcessor( WPName$, INIFile$ ) Static As Integer
    Index% = 0

INISearchLoop:
    key$ = "WP"+Mid$(STR$(Index%),2)
    Value$ = GetIniKeyString( INIFile$, "Print", key$)

    if Value$ <> WPName$ and Value$ <> "" then
        Index% = Index% + 1
        goto INISearchLoop
    end if

    ''
    '' Either we found the entry or Index% points to the 1st open entry
    ''
    CreateIniKeyValue INIFile$, "Print", key$, WPName$, cmoOverwrite
    AddWordProcessor = Index%
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -