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

📄 adsetup.mst

📁 AutoDocumentation System for Windows Version 2.01.40
💻 MST
📖 第 1 页 / 共 2 页
字号:
''**************************************************************************
''*                    AutoDoc Setup Script
''**************************************************************************

'$DEFINE DEBUG  ''  Define for script development/debugging

'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'

DECLARE FUNCTION WinExec LIB "kernel.exe" (szCommand$, cmdShow%) AS INTEGER

''
''  Dialog Template IDs
''
CONST IDD_DIALOG1 = 100       '' Welcome screen
CONST IDD_DIALOG2 = 101       '' Default or Custom install?
CONST IDD_DIALOG3 = 102       '' OK to quit?
CONST IDD_DIALOG4 = 103       '' Setup failed!
CONST IDD_DIALOG5 = 104       '' Exit on request
CONST IDD_DIALOG6 = 105       '' Setup complete
CONST IDD_DIALOG7 = 106       '' Custom options dialog
CONST IDD_DIALOG8 = 107       '' invisible interface
CONST IDD_DIALOG9 = 108       '' generic help dialog

CONST NO_HELP = 0

''  Bitmap IDs
''
''  These values correspond to the bitmap resources in the adsetup DLL
''
CONST Logo480 = 1
CONST Logo600 = 2
CONST Logo768 = 3

''
''  This ShowWindow() value wAs pulled from Windows.h
''  and specifies a maximized view of the setup background window
''
CONST SW_MAXIMIZE = 3

GLOBAL DEST$        ''  Default destination directory
GLOBAL OPTCUR$      ''  Option selection from option dialog
GLOBAL CUIDLL$      ''  Custom UI dynalink
GLOBAL NO_HELP_FILE$

Declare Function MakePath (szDir$, szFile$) As String
Declare Function Install(AutoDocPath$, SelectList$) As String
Declare Function AddWordProcessor( WPName$, INIFile$ ) As Integer

''
''  Windows USER.EXE entry points that are not prototyped elsewhere
''
Declare Sub      ShowWindow LIB "User" (hwnd%, flags%)
Declare Function GetWindowLong LIB "User" (hwnd%, index%) As Long
Declare Function SetWindowLong LIB "User" (hwnd%, index%, value&) As Long
Declare Function GetSectionSize(Section$) As Long

''
''  The setup script entry point
''
init:
    cuidll$    = "adsetup.dll"          ''Custom user interface dll
    helpprocs$ = "HelpProcedure"        ''Help dialog procedure
    NO_HELP_FILE$ = ""
    
    ''
    ''  Get the window style of the background window
    ''  The -16 is the index of the long value that represents the stlye
    ''  (taken from Windows.h)
    ''
    Style&=GetWindowLong(HwndFrame(), -16)
    
    ''
    ''  Clear the caption style bits (as taken from Windows.h)
    ''
    Style&=Style&-&h00C00000
    
    ''
    ''  Set the window style back minus undesired elements
    ''
    Style&=SetWindowLong(HwndFrame(), -16, Style&)
    
    ''
    ''  Maximize the background window
    ''
    ShowWindow HwndFrame(), SW_MAXIMIZE
    
    ''
    ''  Get the height value of the screen
    ''
    Height% = GetScreenHeight()
    
    ''
    ''  If there are no other matches, use the 640x480 bitmap background
    ''
    Logo% = Logo480
    
    ''
    ''  Check for and set a 800x600 background
    ''
''    If Height%=600 Then
''        Logo%=Logo600
''    End If

    ''
    ''  Check for and set a 1024x768 background
    ''
''    If Height%=768 Then
''        Logo%=Logo768
''    End If
    
    ''
    ''  Set the appropriate bitmap from adsetup.dll
    ''
    SetBitmap cuidll$, Logo
    
    ''
    ''  Specify the Window Title
    ''
    SetTitle "AutoDocumentation System Setup"

    ''
    ''  If the source inf path has not been established, create one
    ''
    szInf$ = GetSymbolValue("STF_SRCINFPATH")
    IF szInf$ = "" THEN
        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
    END IF
    
    ''
    ''  Load the inf settings
    ''
    ReadInfFile szInf$

    ''
    ''  Make sure that the Windows directory is valid
    ''
    i% = SetSizeCheckMode(scmOnIgnore)
    WinDrive$ = Mid$(GetWindowsDir, 1, 1)
    IF IsDriveValid(WinDrive$) = 0 THEN
        i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "AutoDocumentation System Setup", MB_TASKMODAL+MB_ICONHAND+MB_OK)
        Goto QUIT
    END IF

    ''
    ''  The dirty work starts here with the Welcome dialog
    ''
Welcome:
    ''
    ''  Display the Welcome dialog
    ''
    Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG1, "SetupInformationDialog", IDD_DIALOG9, HELPPROC$)
    UIPop 1
    
    ''
    ''  Process the dialog buttons
    ''
    If Result$ <> "CONTINUE" Then
        Gosub AskQuit
        Goto  Welcome
    End If

InstallTypeLoop:
    ''
    ''  Display the setup type options dialog
    ''
    Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG2, "SetupTypeDialog", IDD_DIALOG9, HELPPROC$)
    UIPop 1
    
    ''
    ''  Process the dialog buttons
    ''
    if Result$ = "EXIT" then
        Gosub AskQuit
        Goto InstallTypeLoop
    end if

    ''
    ''  Get which radio button was selected
    ''
    SelectedInstallType$ = GetSymbolValue("ButtonChecked")

GetPaths:
    ''
    ''  Get the setup source directory
    ''
    SourceDirectory$ = GetSymbolValue("STF_SRCDIR")
    
    ''
    ''  Build the size list for the base product
    ''
    AddListItem "BaseList", "BaseProduct"
    AddListItem "BaseList", "Keywords"
    AddListItem "BaseList", "Windows$System"
    SetSymbolValue "BaseSize", STR$(GetSectionSize("BaseList"))
    RemoveSymbol "BaseList"

    ''
    ''  Build the size list for the help files
    ''
    AddListItem "HelpList", "Help"
    SetSymbolValue "HelpSize", STR$(GetSectionSize("HelpList"))
    RemoveSymbol "HelpList"

    ''
    ''  Build the size list for the sample projects
    ''
    AddListItem "SamplesList", "Samples"
    SetSymbolValue "SamplesSize", STR$(GetSectionSize("SamplesList"))
    RemoveSymbol "SamplesList"

    ''
    ''  Build the size list for the Word 2.0 files
    ''
    AddListItem "Word20List", "Word20"
    SetSymbolValue "Word20Size", STR$(GetSectionSize("Word20List"))
    RemoveSymbol "Word20List"

    ''
    ''  Build the size list for the Word 6.0 files
    ''
    AddListItem "Word60List", "Word60"
    SetSymbolValue "Word60Size", STR$(GetSectionSize("Word60List"))
    RemoveSymbol "Word60List"

    ''
    ''  Set the product path symbol for the settings dialog
    ''
    SetSymbolValue "Edit1", "C:\AUTODOC"
    SetSymbolValue "Edit1Select",  "ALL"

    ''
    ''  Specify the default ProgMan group name and target filename
    ''
    SetSymbolValue "DefaultGroup", "AutoDocumenation System"
    SetSymbolValue "TargetFile",   "AUTODOCW.EXE"
    
    ''
    '' Based upon the installation type, either prompt the user
    '' or just go ahead and do stuff
    ''
    if SelectedInstallType$="1" Then        '' Full installation
        AddListItem    "SelectList",   "ON"
        AddListItem    "SelectList",   "ON"
        AddListItem    "SelectList",   "ON"
        AddListItem    "SelectList",   "ON"
        AddListItem    "SelectList",   "ON"
        AddListItem    "SelectList",   "ON"
        SetSymbolValue "DefaultGroupResult", "AutoDocumentation System"
        Result$ = Install("C:\AUTODOC", "SelectList")
        Goto QUIT
    elseif SelectedInstallType$="3" Then    '' Minimal installation
        AddListItem    "SelectList",   "ON"         '' base product
        AddListItem    "SelectList",   "OFF"        '' help files
        AddListItem    "SelectList",   "OFF"        '' sample projects
        AddListItem    "SelectList",   "ON"         '' Word 2.0 support
        AddListItem    "SelectList",   "ON"         '' Word 6.0 support
        AddListItem    "SelectList",   "ON"         '' create icon
        SetSymbolValue "DefaultGroupResult", "AutoDocumentation System"
        Result$ = Install("C:\AUTODOC", "SelectList")
        Goto QUIT
    endif

    ''
    '' We'll get here if they're doing a custom installation
    ''
    AddListItem    "SelectList",   "ON"
    AddListItem    "SelectList",   "ON"
    AddListItem    "SelectList",   "ON"
    AddListItem    "SelectList",   "ON"
    AddListItem    "SelectList",   "ON"
    AddListItem    "SelectList",   "ON"

PathLoop:
    ''
    ''  Display the setting dialog
    ''
    Result$ = UIStartDlg(CUIDLL$, IDD_DIALOG7, "SetupOptionsDialog", IDD_DIALOG9, HELPPROC$)
    UIPop 1

    ''
    ''  Where should we install the software?
    ''
    AutoDocPath$ = GetSymbolValue("Edit1Result")
    if Mid$(AutoDocPath$, Len(AutoDocPath$), 1)="\" then
        AutoDocPath$ = Mid$(AutoDocPath$, 1, Len(AutoDocPath$)-1)
    elseif Mid$(AutoDocPath$, Len(AutoDocPath$),1)="/" then
        AutoDocPath$ = Mid$(AutoDocPath$, 1, Len(AutoDocPath$)-1)
    end if

    ''
    ''  Process the dialog buttons
    ''
    If Result$ = "CONTINUE" Then
        If IsDirWritable(AutoDocPath$) = 0 Then
            Gosub BadPath
            Goto PathLoop
        End If
    ELSE
        Gosub AskQuit
        Goto PathLoop
    END IF

    ''
    ''  Install the desired files
    ''
    Result$ = Install(AutoDocPath$, "SelectList")

QUIT:
    ''
    '' Based upon the current value of ERROR, determine which
    '' termination dialog is to be displayed
    ''
    ON ERROR Goto ErrQuit

⌨️ 快捷键说明

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