home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SETUPKIT / SETUP1 / SETUP1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-19  |  25.1 KB  |  667 lines

  1. VERSION 5.00
  2. Begin VB.Form frmSetup1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00400000&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "VB5 Setup Toolkit"
  7.    ClientHeight    =   1770
  8.    ClientLeft      =   225
  9.    ClientTop       =   1590
  10.    ClientWidth     =   7950
  11.    ClipControls    =   0   'False
  12.    DrawStyle       =   5  'Transparent
  13.    FillStyle       =   0  'Solid
  14.    BeginProperty Font 
  15.       Name            =   "Times New Roman"
  16.       Size            =   24
  17.       Charset         =   0
  18.       Weight          =   700
  19.       Underline       =   0   'False
  20.       Italic          =   -1  'True
  21.       Strikethrough   =   0   'False
  22.    EndProperty
  23.    ForeColor       =   &H00000000&
  24.    Icon            =   "setup1.frx":0000
  25.    LinkMode        =   1  'Source
  26.    LockControls    =   -1  'True
  27.    MaxButton       =   0   'False
  28.    MinButton       =   0   'False
  29.    PaletteMode     =   1  'UseZOrder
  30.    ScaleHeight     =   118
  31.    ScaleMode       =   3  'Pixel
  32.    ScaleWidth      =   530
  33.    WhatsThisHelp   =   -1  'True
  34.    WindowState     =   2  'Maximized
  35.    Begin VB.Label lblModify 
  36.       AutoSize        =   -1  'True
  37.       BorderStyle     =   1  'Fixed Single
  38.       Caption         =   $"setup1.frx":0442
  39.       BeginProperty Font 
  40.          Name            =   "MS Sans Serif"
  41.          Size            =   8.25
  42.          Charset         =   0
  43.          Weight          =   400
  44.          Underline       =   0   'False
  45.          Italic          =   0   'False
  46.          Strikethrough   =   0   'False
  47.       EndProperty
  48.       Height          =   450
  49.       Left            =   15
  50.       TabIndex        =   1
  51.       Top             =   15
  52.       Visible         =   0   'False
  53.       Width           =   7860
  54.       WordWrap        =   -1  'True
  55.    End
  56.    Begin VB.Label lblDDE 
  57.       AutoSize        =   -1  'True
  58.       BorderStyle     =   1  'Fixed Single
  59.       Caption         =   "This label is used for DDE connection to the Program Manager"
  60.       BeginProperty Font 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   8.25
  63.          Charset         =   0
  64.          Weight          =   400
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   255
  70.       Left            =   15
  71.       TabIndex        =   0
  72.       Top             =   1515
  73.       Visible         =   0   'False
  74.       Width           =   4485
  75.    End
  76. Attribute VB_Name = "frmSetup1"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Compare Text
  83. ' Can't put this is a resource because it indicated resource load failure, must localize separately
  84. Const mstrRESOURCELOADFAIL$ = "An error occurred while initializing string resources used by Setup."
  85. '-----------------------------------------------------------
  86. ' SUB: DrawBackGround
  87. ' Draws the 'blue wash' screen and prints the 'shadowed'
  88. ' app setup title
  89. '-----------------------------------------------------------
  90. Private Sub DrawBackGround()
  91.     Const intBLUESTART% = 255
  92.     Const intBLUEEND% = 0
  93.     Const intBANDHEIGHT% = 2
  94.     Const intSHADOWSTART% = 8
  95.     Const intSHADOWCOLOR% = 0
  96.     Const intTEXTSTART% = 4
  97.     Const intTEXTCOLOR% = 15
  98.     Dim sngBlueCur As Single
  99.     Dim sngBlueStep As Single
  100.     Dim intFormHeight As Integer
  101.     Dim intFormWidth As Integer
  102.     Dim intY As Integer
  103.     '
  104.     'Get system values for height and width
  105.     '
  106.     intFormHeight = ScaleHeight
  107.     intFormWidth = ScaleWidth
  108.     '
  109.     'Calculate step size and blue start value
  110.     '
  111.     sngBlueStep = intBANDHEIGHT * (intBLUEEND - intBLUESTART) / intFormHeight
  112.     sngBlueCur = intBLUESTART
  113.     '
  114.     'Paint blue screen
  115.     '
  116.     For intY = 0 To intFormHeight Step intBANDHEIGHT
  117.         Line (-1, intY - 1)-(intFormWidth, intY + intBANDHEIGHT), RGB(0, 0, sngBlueCur), BF
  118.         sngBlueCur = sngBlueCur + sngBlueStep
  119.     Next intY
  120.     '
  121.     'Print 'shadowed' appname
  122.     '
  123.     CurrentX = intSHADOWSTART
  124.     CurrentY = intSHADOWSTART
  125.     ForeColor = QBColor(intSHADOWCOLOR)
  126.     Print Caption
  127.     CurrentX = intTEXTSTART
  128.     CurrentY = intTEXTSTART
  129.     ForeColor = QBColor(intTEXTCOLOR)
  130.     Print Caption
  131. End Sub
  132. Private Sub Form_Load()
  133. ' Most of the work for Setup1 takes place in Form_Load()
  134. ' and is mostly driven by the information found in the
  135. ' SETUP.LST file.  To customize the Setup1 functionality,
  136. ' you will generally want to modify SETUP.LST.
  137. ' Particularly, information regarding the files you are
  138. ' installing is all stored in SETUP.LST.  The only
  139. ' exceptions are the Remote Automation files RacMgr32.Exe
  140. ' and AutMgr32.Exe which require special handling below
  141. ' with regards to installing their icons in a special
  142. ' program group.
  143. ' Some customization can also be done by editing the code
  144. ' below in Form_Load or in other parts of this program.
  145. ' Places that are more likely to need customization are
  146. ' documented with suggestions and examples in the code.
  147.     Const strINI_FILES$ = "Files"                           'default section to install
  148.     Const strEXT_GRP$ = "GRP"                               'extension for progman group
  149.     Const SW_HIDE = 0
  150.     Dim strGroupName As String                              'Name of Program Group
  151.     Dim sFile As FILEINFO                                   'first Files= line info
  152.     gfRegDAO = False
  153.     On Error GoTo MainError
  154.     SetFormFont Me
  155.     Me.Font.Size = 24
  156.     Me.Font.Bold = True
  157.     '
  158.     'Initialize linespacing variables for message box calls, etc.
  159.     '
  160.     LF$ = Chr$(10)
  161.     LS$ = LF$ & LF$
  162.     CRLF = Chr$(13) & Chr$(10)
  163.     '
  164.     'Initialize string resources used by global vars and forms/controls
  165.     '
  166.     GetStrings
  167.     '
  168.     'Get Windows and Windows\System directories
  169.     '
  170.     gstrWinDir = GetWindowsDir()
  171.     gstrWinSysDir = GetWindowsSysDir()
  172.     '
  173.     ' If the Windows System directory is a subdirectory of the
  174.     ' Windows directory, the proper place for installation of
  175.     ' files specified in the setup.lst as $(WinSysDest) is always
  176.     ' the Windows \System directory.  If the Windows \System
  177.     ' directory is *not* a subdirectory of the Windows directory,
  178.     ' then the user is running a shared version of Windows.  In
  179.     ' this case, if the user does not have write access to the
  180.     ' shared system directory, we change the system files
  181.     ' destination to the windows directory
  182.     '
  183.     If InStr(gstrWinSysDir, gstrWinDir) = 0 Then
  184.         If WriteAccess(gstrWinSysDir) = False Then
  185.             gstrWinSysDir = gstrWinDir
  186.         End If
  187.     End If
  188.     '
  189.     ' The command-line arguments must be processed as early
  190.     ' as possible, because without them it is impossible to
  191.     ' call the app removal program to clean up after an aborted
  192.     ' setup.
  193.     '
  194.     ProcessCommandLine Command$, gfSilent, gstrSilentLog, gfSMS, gstrMIFFile, gstrSrcPath, gstrAppRemovalLog, gstrAppRemovalEXE
  195.     gfNoUserInput = (gfSilent Or gfSMS)
  196.     AddDirSep gstrSrcPath
  197.     '
  198.     ' The Setup Bootstrapper (SETUP.EXE) copies SETUP1.EXE and SETUP.LST to
  199.     ' the end user's windows directory.  Information required for setup such
  200.     ' as setup flags and fileinfo is read from the copy of SETUP.LST found in
  201.     ' that directory.
  202.     '
  203.     gstrSetupInfoFile = gstrWinDir & gstrFILE_SETUP
  204.     gstrAppName = ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_APPNAME)
  205.     If gstrAppName = gstrNULL Then
  206.         MsgError ResolveResString(resNOSETUPLST), MB_OK Or MB_ICONSTOP, gstrSETMSG
  207.         gstrTitle = ResolveResString(resSETUP, "|1", gstrAppName)
  208.         ExitSetup Me, gintRET_FATAL
  209.     End If
  210.     gstrTitle = ResolveResString(resSETUP, "|1", gstrAppName)
  211.     If gfSilent Then LogSilentMsg gstrTitle & CRLF
  212.     '
  213.     ' This is the default name of the group in which to install the icons.
  214.     '
  215.     gstrDefGroup = ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_DEFGROUP)
  216.     If gstrDefGroup = gstrNULL Then
  217.         gstrDefGroup = gstrAppName
  218.     End If
  219.     '
  220.     ' Display the background "blue-wash" setup screen as soon as we get the title
  221.     '
  222.     ShowMainForm
  223.     '
  224.     ' Display the welcome dialog
  225.     '
  226.     ShowWelcomeForm
  227.     '
  228.     ' Get name of application's executable file.  This name will be added to the
  229.     ' program manager/Explorer.  Only the EXE Name should be entered under this key in
  230.     ' the setup information file (SETUP.LST).
  231.     '
  232.     gstrAppExe = ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_APPEXE)
  233.     '
  234.     ' Get that name of the app for uninstalling.  In most cases, this will be
  235.     ' the same as gstrAppExe except when the application is a shared component.
  236.     ' gstrAppToUninstall is used by SMS uninstall to determine the location
  237.     ' of the uninstall files.
  238.     '
  239.     gstrAppToUninstall = ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_APPTOUNINSTALL)
  240.     '
  241.     ' If this flag is set, then the default destination directory is used
  242.     ' without question, and the user is never given a chance to change it.
  243.     ' This is intended for installing an .EXE/.DLL as a component rather
  244.     ' than as an application in an application directory.  In this case,
  245.     ' having an application directory does not really make sense.
  246.     '
  247.     If ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_FORCEUSEDEFDEST) = "1" Then
  248.         gfForceUseDefDest = True
  249.     End If
  250.     '
  251.     ' Read default destination directory.  If the name specified conflicts
  252.     ' with the name of a file, then prompt for a new default directory
  253.     '
  254.     gstrDestDir = ResolveDestDir(ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_APPDIR))
  255.     While FileExists(gstrDestDir) = True Or gstrDestDir = gstrNULL
  256.         If MsgError(ResolveResString(resBADDEFDIR), MB_OKCANCEL Or MB_ICONQUESTION, gstrSETMSG) = IDCANCEL Then
  257.             ExitSetup Me, gintRET_FATAL
  258.         End If
  259.         
  260.         If gfNoUserInput = True Then
  261.             ExitSetup Me, gintRET_FATAL
  262.         Else
  263.             ShowPathDialog gstrDIR_DEST
  264.         End If
  265.     Wend
  266.     '
  267.     ' Ensure a trailing backslash on the destination directory
  268.     '
  269.     AddDirSep gstrDestDir
  270.     Do
  271.         '
  272.         ' Display install button and default directory.  The user
  273.         ' can change the destination directory from here.
  274.         '
  275.         ShowBeginForm
  276.         '
  277.         ' This would be a good place to display an option dialog, allowing the user
  278.         ' a chance to select installation options: samples, docs, help files, etc.
  279.         ' Results of this dialog would be checked in the loop below
  280.         '
  281.         'ShowOptionsDialog (Function you could write with option check boxes, etc.)
  282.         '
  283.         '
  284.         ' Initialize "table" of drives used and disk space array
  285.         '
  286.         InitDiskInfo
  287.         SetMousePtr gintMOUSE_HOURGLASS
  288.         ShowStaticMessageDialog ResolveResString(resDISKSPACE)
  289.         '
  290.         ' For every section in SETUP.LST that will be installed, call CalcDiskSpace
  291.         ' with the name of the section
  292.         '
  293.         CalcDiskSpace strINI_FILES
  294.         'CalcDiskSpace "MySection"
  295.         'CalcDiskSpace "MyOtherSection"
  296.         '
  297.         ' If you created an options dialog, you need to check results here to
  298.         ' determine whether disk space needs to be calculated (if the option(s)
  299.         ' will be installed)
  300.         '
  301.         'If chkInstallSamples.Value = TRUE then
  302.         '    CalcDiskSpace "Samples"
  303.         'End If
  304.         '
  305.         HideStaticMessageDialog
  306.         SetMousePtr gintMOUSE_DEFAULT
  307.     '
  308.     ' After all CalcDiskSpace calls are complete, call CheckDiskSpace to check
  309.     ' the results and display warning form (if necessary).  If the user wants
  310.     ' to try another destination directory (or cleanup and retry) then
  311.     ' CheckDiskSpace will return False
  312.     '
  313.     Loop While CheckDiskSpace() = False
  314.     '
  315.     ' Starts logging to the setup logfile (will be used for application removal)
  316.     '
  317.     EnableLogging gstrAppRemovalLog
  318.     '
  319.     ' Should go ahead and force the application directory to be created,
  320.     ' since the application removal logfile will later be copied there.
  321.     '
  322.     MakePath gstrDestDir, False 'User may not ignore errors here
  323.     '
  324.     ' Create the main program group if one is wanted/needed.
  325.     '
  326.     Const fDefCreateGroupUnderWin95 = False
  327.     '
  328.     ' If fDefCreateGroupUnderWin95 is set to False (this is the default), then no
  329.     ' program group will be created under Win95 unless it is absolutely necessary.
  330.     '
  331.     ' By default under Windows 95, no group should be created, and the
  332.     ' single program icon should be placed directly under the
  333.     ' Start>Programs menu (unless there are other, user-defined icons to create
  334.     '
  335.     Dim cIcons As Integer            ' Count of how many icons are required.
  336.     Dim fAdditionalIcons As Boolean
  337.     '
  338.     ' There are two default reasons why we will install more icons than
  339.     ' simply the program executable:
  340.     '   1) If we are installing user-defined icons (by customizing this procedure or
  341.     '      or by customizing SETUP.LST)
  342.     '   2) If we are creating a program removal icon (whenever we're running under NT)
  343.     '
  344.     ' Read through the SETUP.LST file and determine how many icons are needed.
  345.     '
  346.     cIcons = CountIcons(strINI_FILES)
  347.     '
  348.     ' Do the same for other sections in SETUP.LST if you've added your own.
  349.     '
  350.     'cIcons = cIcons + CountIcons("MySection")
  351.     'cIcons = cIcons + CountIcons("MyOtherSection")
  352.     '
  353.     ' If you have modified this procedure to install more icons, make sure you set
  354.     ' this variable to True, so that a program group will be created for the icons.
  355.     ' Currently, it is True only if more then one entry was found in the "Files"
  356.     ' section of SETUP.LST that specified an icon or if this is NT 3.51.
  357.     '
  358.     fAdditionalIcons = False
  359.     fAdditionalIcons = fAdditionalIcons Or (cIcons > 1)
  360.     fAdditionalIcons = fAdditionalIcons Or (Not TreatAsWin95())
  361.     '
  362.     ' The following variable determines whether or not we create a program
  363.     ' group for icons.  It is controlled by fNoGroupUnderWin95,
  364.     ' fAdditionalIcons, and FTreatAsWin95().
  365.     '
  366.     Dim fCreateGroup As Boolean
  367.     If TreatAsWin95() Then
  368.         '
  369.         ' Win95 only:
  370.         ' We create a program group only if we have additional icons besides
  371.         ' the application executable (if any), or if fDefCreateGroupUnderWin95
  372.         ' has been set to True to override this default behavior.
  373.         '
  374.         fCreateGroup = fDefCreateGroupUnderWin95 Or fAdditionalIcons
  375.     Else
  376.         '
  377.         ' Win32 NT only:
  378.         ' We must always create a Program Manager group
  379.         ' because we always create an icon for the application removal program.
  380.         '
  381.         fCreateGroup = True
  382.     End If
  383.     strGroupName = ""
  384.     If fCreateGroup Then
  385.         strGroupName = frmGroup.GroupName(frmSetup1, gstrDefGroup)
  386.         fMainGroupWasCreated = True
  387.     End If
  388.     '
  389.     ' Show copy form and set copy gauge percentage to zero
  390.     '
  391.     SetMousePtr gintMOUSE_HOURGLASS
  392.     ShowCopyDialog
  393.     UpdateStatus frmCopy.picStatus, 0, True
  394.     '
  395.     ' Always start with Disk #1
  396.     '
  397.     gintCurrentDisk = 1
  398.     '
  399.     ' For every section in SETUP.LST that needs to be installed, call CopySection
  400.     ' with the name of the section
  401.     '
  402.     CopySection strINI_FILES
  403.     'CopySection "MySection"
  404.     'CopySection "MyOtherSection"
  405.         
  406.     '
  407.     ' If you created an options dialog, you need to check results here to
  408.     ' determine whether to copy the files in the particular section(s).
  409.     '
  410.     'If chkInstallSamples.Value = TRUE then
  411.     '    CopySection "Samples"
  412.     'End If
  413.     '
  414.     UpdateStatus frmCopy.picStatus, 1, True
  415.     HideCopyDialog
  416.     '
  417.     ' If we installed AXDIST.EXE, we now need to run it
  418.     ' so it will install any additional files it contains.
  419.     '
  420.     If gfAXDist = True Then
  421.         '
  422.         'Synchronously shell out and run the utility with the correct switches
  423.         '
  424.         If FileExists(gstrAXDISTInstallPath) Then
  425.             FSyncShell gstrAXDISTInstallPath, SW_HIDE
  426.         End If
  427.     End If
  428.     '
  429.     ' If we installed WINt351.EXE, we now need to run it
  430.     ' so it will install any additional files it contains.
  431.     '
  432.     If gfWINt351 = True Then
  433.         '
  434.         'Synchronously shell out and run the utility with the correct switches
  435.         '
  436.         If FileExists(gstrWINt351InstallPath) Then
  437.             FSyncShell gstrWINt351InstallPath, SW_HIDE
  438.         End If
  439.     End If
  440.     '
  441.     ' Now, do all the 'invisible' update things that are required
  442.     '
  443.     SetMousePtr gintMOUSE_DEFAULT
  444.     ShowStaticMessageDialog ResolveResString(resUPDATING)
  445.     '
  446.     ' Register all the files that have been saved in the registration array.  The
  447.     ' CopySection API adds a registration entry (when required) if a file is copied.
  448.     '
  449.     RegisterFiles
  450.     '
  451.     ' Register all the licenses that appear in the [Licenses] section of
  452.     ' Setup.lst.
  453.     '
  454.     RegisterLicenses
  455.     '
  456.     ' If any DAO files were installed, we need to add some special
  457.     ' keys to the registry to support it so that links will work
  458.     ' in OLE Database fields.
  459.     '
  460.     If gfRegDAO = True Then
  461.         RegisterDAO
  462.     End If
  463.     '
  464.     ' Create program icons (or links, i.e. shortcuts).
  465.     '
  466.     If (fMainGroupWasCreated = True) Or ((cIcons > 0) And TreatAsWin95()) Then
  467.         ShowStaticMessageDialog ResolveResString(resPROGMAN)
  468.         CreateIcons strINI_FILES, strGroupName
  469.         '
  470.         ' Do the same for other sections in SETUP.LST if you've added your own.
  471.         '
  472.         'CreateIcons "MySection", strGroupName
  473.         'CreateIcons "MyOtherSection", strGroupName
  474.         '
  475.     End If
  476.     '
  477.     ' If you still need to create more icons, insert code here, and make certain
  478.     ' that you have set the variable fAdditionalIcons to True above
  479.     '
  480.     ' If Not fAdditionalIcons Then
  481.     '   MsgError "Internal Setup Customization Error: fAdditionalIcons = False", vbOKOnly Or vbExclamation, gstrTitle
  482.     '   ExitSetup Me, gintRET_FATAL
  483.     ' End If
  484.     ' CreateOSLink frmSetup1, strGroupName, gsDest.strAppDir & "My Exe 1.exe", "My Exe 1 command-line arguments", "My Exe 1"
  485.     ' CreateOSLink frmSetup1, strGroupName, gsDest.strAppDir & "My Exe 2.exe", "My Exe 2 command-line arguments", "My Exe 2"
  486.     '
  487.     '
  488.     ' Create a separate program group and icons for the Remote Automation
  489.     ' Connection Manager and the Automation Manager, if either has been
  490.     ' installed.
  491.     ' This program group is entirely separate from the one created for the
  492.     ' application program (if any), because it will be shared by all
  493.     ' VB applications which install them.
  494.     '
  495.     ' NOTE: This is NOT the place to install additional icons.  This is
  496.     ' NOTE: handled after the Remote Automation icons have been created.
  497.     '
  498.     ShowStaticMessageDialog ResolveResString(resPROGMAN)
  499.     If gsDest.strAUTMGR32 <> "" Or gsDest.strRACMGR32 <> "" Then
  500.         'At least one of these programs was installed.  Go ahead
  501.         'and create the program group.
  502.         Dim strRemAutGroupName As String
  503.         
  504.         strRemAutGroupName = ResolveResString(resREMAUTGROUPNAME)
  505.         '
  506.         ' Create the group for the Remote Automation Icons.  Note that
  507.         ' since the user cannot choose the name of this group, there is
  508.         ' no way at this point to correct an error if one occurs.  Therefore,
  509.         ' fCreateOSProgramGroup will abort setup, without returning, if there
  510.         ' is an error.
  511.         '
  512.         fCreateOSProgramGroup frmSetup1, strRemAutGroupName, False, False
  513.         'Now create the icons for AUTMGR32.EXE and RACMGR32.EXE
  514.         If gsDest.strRACMGR32 <> "" Then
  515.             CreateOSLink frmSetup1, strRemAutGroupName, gsDest.strRACMGR32, "", ResolveResString(resRACMGR32ICON), False
  516.         End If
  517.         If gsDest.strAUTMGR32 <> "" Then
  518.             CreateOSLink frmSetup1, strRemAutGroupName, gsDest.strAUTMGR32, "", ResolveResString(resAUTMGR32ICON), False
  519.         End If
  520.     End If
  521.     '
  522.     'Register the per-app path
  523.     '
  524.     If gstrAppExe <> "" Then
  525.         Dim strPerAppPath As String
  526.         strPerAppPath = ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_APPPATH)
  527.         AddPerAppPath gstrAppExe, gsDest.strAppDir, strPerAppPath
  528.     End If
  529. ExitSetup:
  530.     HideStaticMessageDialog
  531.     RestoreProgMan
  532.     If fWithinAction() Then
  533.         'By now, all logging actions should have been either aborted or committed.
  534.         MsgError ResolveResString(resSTILLWITHINACTION), vbExclamation Or vbOKOnly, gstrTitle
  535.         ExitSetup Me, gintRET_FATAL
  536.     End If
  537.     MoveAppRemovalFiles strGroupName
  538.     '
  539.     ' If we installed AXDIST.EXE, we now need to delete it.
  540.     ' It's a self-extracting file that has already extracted.
  541.     '
  542.     If FileExists(gstrAXDISTInstallPath) Then
  543.         Kill gstrAXDISTInstallPath
  544.     End If
  545.     '
  546.     ' If we installed WINt351.EXE, we now need to delete it.
  547.     ' It's a self-extracting file that has already extracted.
  548.     '
  549.     If FileExists(gstrWINt351InstallPath) Then
  550.         Kill gstrWINt351InstallPath
  551.     End If
  552.     ExitSetup Me, gintRET_FINISHEDSUCCESS
  553. MainError:
  554.     Dim iRet As Integer
  555.     iRet = MsgError(Error$ & LS$ & ResolveResString(resUNEXPECTED), MB_RETRYCANCEL Or MB_ICONEXCLAMATION, gstrTitle)
  556.     If gfNoUserInput Then iRet = IDCANCEL
  557.     Select Case iRet
  558.         Case IDRETRY
  559.             Resume
  560.         Case IDCANCEL
  561.             ExitSetup Me, gintRET_ABORT
  562.             Resume
  563.         'End Case
  564.     End Select
  565. End Sub
  566. '-----------------------------------------------------------
  567. ' SUB: HideCopyDialog
  568. ' Unloads the copy files status form
  569. '-----------------------------------------------------------
  570. Private Sub HideCopyDialog()
  571.     Unload frmCopy
  572. End Sub
  573. '-----------------------------------------------------------
  574. ' SUB: HideStaticMessageDialog
  575. ' Unloads the setup messages form
  576. '-----------------------------------------------------------
  577. Private Sub HideStaticMessageDialog()
  578.     Unload frmMessage
  579. End Sub
  580. '-----------------------------------------------------------
  581. ' SUB: ShowBeginForm
  582. ' Displays the begin setup form
  583. '-----------------------------------------------------------
  584. Private Sub ShowBeginForm()
  585.     If gfNoUserInput Then
  586.         If IsValidDestDir(gstrDestDir) = False Then
  587.             ExitSetup frmSetup1, gintRET_FATAL
  588.         End If
  589.     Else
  590.         frmBegin.Show 1
  591.     End If
  592. End Sub
  593. '-----------------------------------------------------------
  594. ' SUB: ShowCopyDialog
  595. ' Displays the copy files status form
  596. '-----------------------------------------------------------
  597. Private Sub ShowCopyDialog()
  598.     CenterForm frmCopy
  599.     frmCopy.Show
  600.     frmCopy.Refresh
  601.     If gfNoUserInput = True Then
  602.         frmCopy.cmdExit.Visible = False
  603.     Else
  604.         frmCopy.cmdExit.SetFocus
  605.     End If
  606. End Sub
  607. '-----------------------------------------------------------
  608. ' SUB: ShowMainForm
  609. ' Displays the main setup 'blue wash' form
  610. '-----------------------------------------------------------
  611. Private Sub ShowMainForm()
  612.     Me.Caption = gstrTitle
  613.     Me.Show
  614.     DrawBackGround
  615.     Me.Refresh
  616. End Sub
  617. '-----------------------------------------------------------
  618. ' SUB: ShowStaticMessageDialog
  619. ' Displays a setup message in a 'box' of the appropriate
  620. ' size for the message
  621. ' IN: [strMessage] - message to display
  622. '-----------------------------------------------------------
  623. Private Sub ShowStaticMessageDialog(ByVal strMessage As String)
  624.     Dim frm As Form
  625.     Set frm = frmMessage
  626.     frm.lblMsg.Caption = strMessage
  627.     '
  628.     'Default height is twice the height of the setup icon.
  629.     'If the height of the message text is greater, then
  630.     'increase the form height to the label height plus
  631.     'half an icon height
  632.     '
  633.     frm.ScaleHeight = frm.imgMsg.Height * 2
  634.     If frm.lblMsg.Height > frm.ScaleHeight Then
  635.         frm.ScaleHeight = frm.lblMsg.Height + frm.imgMsg.Height * 0.5
  636.     End If
  637.     '
  638.     'Vertically center the icon and label within the form
  639.     '
  640.     frm.imgMsg.Top = frm.ScaleHeight / 2 - frm.imgMsg.Height / 2
  641.     frm.lblMsg.Top = frm.ScaleHeight / 2 - frm.lblMsg.Height / 2
  642.     CenterForm frm
  643.     frm.Show
  644.     frm.Refresh
  645. End Sub
  646. '-----------------------------------------------------------
  647. ' SUB: ShowWelcomeForm
  648. ' Displays the welcome to setup form
  649. '-----------------------------------------------------------
  650. Private Sub ShowWelcomeForm()
  651.     If Not gfNoUserInput Then
  652.         frmWelcome.Show 1
  653.     End If
  654. End Sub
  655. '-----------------------------------------------------------
  656. ' SUB: GetStrings
  657. ' Loads string resources into global vars and forms/controls
  658. '-----------------------------------------------------------
  659. Private Sub GetStrings()
  660.     On Error GoTo GSErr
  661.     gstrSETMSG = ResolveResString(resSETMSG)
  662.     Exit Sub
  663. GSErr:
  664.     MsgError mstrRESOURCELOADFAIL, MB_ICONSTOP Or MB_OK, gstrNULL
  665.     ExitSetup Me, gintRET_FATAL
  666. End Sub
  667.