     12.   Setup   	285 

     12.   Setup    

            
  ,     ,   
 , ,   DLL,   
   .      
     Setup. 
       ,      
      
,  Visual Basic     
.  ,      
,     Setup,   
Setup Wizard. 

    12.1.    

     Setup     : 
    	     ; 
    	    ; 
    	 ; 
    	   Program Manager      Start. 
       Setup   Setup Wizard, 
 Visual Basic (.   "   
 "   9). Visual Basic    Setup 
Toolkit,     Setup Wizard    
 Setup.        
Setup, ,   ,     
       Setup. 

    12.1.1.   Setup Wizard 

         Setup    Setup 
Wizard. Setup Wizard      
 ,       , 
 ,        Setup. 
    Setup Wizard     : 
           . Setup Wizard  
 ,       ; 
                
      CD-ROM; 
          Internet    
   Microsoft Internet Explorer  3.0. 
     Setup Wizard ,   Setupwiz.exe   
\Setupkit\kitfil32    Visual Basic. 
      ,      Setup, 
Setup Wizard      , 
  .  Setup Wizard   VB5Dep.ini   
Windows,  ,        
  . 


    286    

    ,         
Microsoft Common Dialog, Setup Wizard    Setup 
  (Comdlg32.ocx). 

    : Wizard Setup        
,     Setup.   ,  
   ,     Confirm Dependencies 
    Data Access Object,  ,    
    ()  ,   
      . 


    12.1.2.   

     Setup      ,  Setup 
Wizard,    ,      
 . 

        : Setup.exe 

    Setup Wizard  Setup.exe   Visual Basic   
     .   ,  
 Setup.exe. Setup.exe    , 
  Setup.1st,      Setup (, 
Setupl .exe). 

    Setup. 1st 

    Setup Wizard   Setup.lst.     , 
 ,    ,      
  . 
      Setup.lst    : 

    [Bootstrap] 
    Filel = l, , setupl. __, setupl .exe, $ (WinPath) , . . . 
    [Files] 
    Filel=l,,GRID32.0C_,GRID32.0CX,$(WinSysPath),,$(Shared).. 
    [Setup] 
    Title=LoanSheet 
    DefaultDir=$(ProgramFiles)\Loan 
    Setupl .exe 

    Setup Wizard    , Setupl .exe,   
Visual Basic        . Setup1.exe 
       .  Setup 
         . 
          (St5Unst.log),  
       : 
        ; 
      ,   .    ,  
   ,          ; 
          ; 
        Program Manager    Start; 
       DLL, EXE  OCX,   . 
     Setup       
(St5Unst.exe)   Windows.     
 .   " ". 


     12.   Setup   	287 


    12.1.3.   Visual Basic Setup Toolkit 

         Visual Basic Setup Toolkit 
    Setup,  , 
    Setup Wizard. , Setup Toolkit 
     Setup,     
         
  . 
     Setup Toolkit    , DLL   
 ,   Visual Basic.  , Setupl.vbp, 
   \Vb\Setup-Kit\Setup1.      
      Setup1.exe.     
Setup Wizard       Setup. Setup Wizard 
 Setup1.exe   Visual Basic Setup-kit\Setup1   Setup. 

    :     Setupl.vbp. 

     Setup Wizard  Setup Toolkit Setup Toolkit  Setup Wizard 
         
,        
  . , .      
 ,       
.     ,  . 
        Setup  : 
    1.    Setupt ,frm,    
Form_Load,         ShowBegin, 
   : 

    Dim LoadHelp As   Integer 
    LoadHelp = MsgBox   ("       Help?",   vbYesNo) 
    If  LoadHelp  =  vbYes   Then 
    CalcDiskSpace   "Help" Endlf 
    '      ,     clcons  = _ 
Countlcons(strINI_FILES) If  LoadHelp = vbYes  Then 
    clcons  =  Countlcons("Help") Endlf 
    '       ,     CopySection  strINI_FILES. 
    If  LoadHelp  =  vbYes   Then 
    CopySection  "Help" Endlf 
    '      ,    Createlcons _ strINI_FILES,   strGroupName 

    2.  Setupl .frm,       . . 
    3.  Setup Wizard.   File Summary    
     ,   , 
       "Yes". 
    4.     Setup Wizard   . 


    288   

    5.  Diskl      Setup.lst.    
    [Files]   .    
    [Files],       
,     (, [Help]), 
    CopySection.   ,  
  : 

    [Help] 
    Filel=5,SPLIT, Appl.HLl, Appl.HLP, $(AppPath),,,10/07/97,2946967 
    (AppPath),,,10/07/97,2946967 
    File2=6,SPLIT, Appl.HL2, Appl.HLP 
    File3=7,, Appl.HLS, Appl.HLP 

        ,  Setup  
   [Bootstrap]        
    Help.    
Yes,   CalcDiskSpa-     
      Help.   
  ,    [Files]  Setup.lst. 
         LoadHelp.    
  Help, Setupl .exe     CopySection  
 ,    [Help]  Setup.lst. 

    12.1.4.   

        Setup,  Setup Wizard, 
    Windows    
   (St5Unst.exe). 
        Microsoft Windows NT  Windows 95  
  Add/Remove Programs (/ )  
Control Panel. 
            
         
.     ,     
      . 

    :        
         . 

        ,    
,      ,     
    Setup.      
,     . 

    12.2.   

          , 
,  ,  . Visual Basic 
   ,     
    . ,  
  ,       
  .          
   . 
           Code 
Profiler.     ,   
   . 


     12.   Setup    289 

    12.2.1. Visual Basic Code Profiler 

        ,    
  ,       
. Visual Basic Code Profiler  ,    
 ,      . Code 
Profiler ,     ,      
 . 

    . 12.1.   Code Profiler. 

    Code Profiler   Visual Basic  Professional  
   Tools ( Vbcp.dll).     
    .   Visual 
Basic    . 

    12.2.2.    

      ,     
     ,   
    .     
   . ,     
 ,  ,       
     . 
     Windows 3.1         
.ini.  Windows NT  Windows 95      . 
       Visual Basic 
GetSetting  SaveSetting   Windows API. 

     GetSetting  SaveSetting 

     GetSetting       
.  GetSetting : 

    GetSetting (_, , , []) 

              
Windows 95    : 

    Dim strCustID as Integer Private Sub Form_Load() 
    strCustID = GetSetting _ 
    ("OrderApp", "CustSection", "CustID", "0") End Sub 


    290   

     SaveSetting       . 
 SaveSetting : 

    SaveSetting _, , ,  

            Windows 
95    : 

    :jim  strCustID 
    Private Sub_Form_Unload() 
    strCustID = txtCustlD.Text 
    SaveSettings _ 
    "OrderApp", "CustSection", "CustID", StrCustID ..,nd Sub 


     Win32 API 

    Windows   ,     
     .ini. 
     Windows 95  Windows NT     
    ,   Visual Basic. 
  ,     Windows (  
 .ini). 
         Windows,   
    . 

    	 

    GetPrivateProfileString	     
 .ini. 
    GetPrivateProfilelnt	      .ini. 
    WritePrivateProfileString	     .ini. 
    GetProfileString	    Win.ini. 
    GetProfilelnt	    Win.ini. 
        DLL .   5. 

    12.2.3.   

          .  
   ,   ,  
   ,   . 
       .    
      . , 
   ,  ,    ,  
      .    
   ,    .  
  ,    ,  
  . 

       

           
 : 
              ,  
.       ; 


     12.   Setup   	291 

          ,    .  
          
      ; 
             ; 
              DLL. 

       

          
(        ).  
     ,     
 . 
           : 
         ,    
  ; 
         .    
    .      
 .       
  ; 
         ,  .   
      ,   . 
,          , 
   . 

        

       Microsoft Windows,   
       
 .       
  : 
          AutoRedraw .   
     ,   
,  AutoRedraw  False    " "  
 ; 
          Image  PictureBox.  
 Image    ,  PictureBox.  
          Click,  
       Image; 
          PictureBox    
       ; 
             ,  .  
  ,  . 

       

     ,    :    
      .    
        ,  : 
             ,    
    "",   ,  . 
      ,   
Erase  ReDim Preserve,       , 
 . Erase   ; ReDim Preserve 
     ; 
        ,    PictureBox,   , 
 LoadPicture       . 


    292   

    12.2.4.   

             
,   Microsoft Visual Basic  5.0.   , 
   ,     (), 
   ,     . 
       , 
  . 
          StartLogging  
LogEvent   LogMode. 
            
StartLogging.   : 

    .StartLogging ,  

                LogEvent. 
             ,     
( LogEvent). 
           : 

    	 

    vbLogAuto	,           .      
   Windows 95     , 
  LogFile.    Windows NT   
     NT. 
    VbLogOff	 . 
    VbLogToFile	   . 
    VbLogToNT	     NT. 
    VbLogOverwrite	,       
  .       
    . 
    VbLogThreadID	,        
 .        
   . 
     LogEvent        
.   Windows NT      
 NT.   Windows 95    , 
   StartLogging.    ,  
   VBEvents.log. 
      LogEvent : 

    .LogEvent (_, _) 

     _  ,      . 
 _      : 
,    . 
     LogMode       , , 
    ( LogEvent).   
LogMode : 

     = .LogMode 

     LogPath           
.   LogPath : 
     = .LogPath 


     12.   Setup   	293 

        ,     Visual Basic: 

    Select Case Index Case 0 '   Dim logMode As Long 
    '   logMode logMode = cboLogMode.Listlndex + _ 
    &H10 * chkLogOverwrite.Value + _ 
    &H10 * chkLogThreadlD.Value '    
App.StartLogging txtLogTarget, logMode cmdAction(l).Enabled = True 
cmdAction(1).Default = True Case 1 '   App.LogEvent 
txtLogText, _ 
    cboEventType.ItemData(cboEventType.Listlndex) End Select 


    12.2.5.    

    Microsoft Visual Basic    ,  
    : 
       Visual SourceSafe (  Enterprise)   
 &   ; 
        ,        
 ,     (,  ) 
   . 

    12.2.6.  Microsoft Visual SourceSafe 

    Microsoft Visual SourceSafe  -   
     .  , 
Visual SourceSafe       
 ,    .   
       ,   
      ,   , 
     . 

    12.2.7.  Visual SourceSafe 

        Visual SourceSafe  Visual Basic,  
          
 ,    .  Visual Basic Setup 
    SourceSafe.    
Visual SourceSafe  Visual Basic   ,    
Visual SourceSafe,      SourceSafe. 
           
SccAddin.SourceCode-ControlAddin   Add-lns.  SourceSafe 
  SourceSafe   Add-lns    Get, Check Out  
Check In   Tools   Visual Basic. 

    12.2.8.    Visual SourceSafe 

        Visual SourceSafe,    Add 
Project to SourceSafe   SourceSafe.      SourceSafe. 


    294   


      

      ,     ,   
    .     Check Out 
  Tools. SourceSafe       
.        Check In, 
         . 

    12.2.9.    

          ,  
   ,    . 
        , 
    ,     .   
         
.  ,         
   . 

    :   Visual Basic \Samples\Pguide\Atm\   
 Atm.vbp,     . 


       

       : 
    1.     (* ,),    
  .       
    ,    Microsoft 
Visual C++. 
    2.   ,      
  (* .res).       
(Rc.exe),    Visual Basic  Professional  Enterprise. 
         : 
    1.   Project  Add File. 
    2.    Add File   Files of type  Resource Files (*.RES). 
    3.   ,     ,   Open. 

          

    Visual Basic   ,    
      .     
 . 

              |                                               
                                                   , 
    'LoadResString	 . 
    LoadResPicture	    (0=bitmap,	 
 LoadResPicture   -1,=1, 2=cursor). 
    LoadResData	   
(		),	,	,	 	.wav. 

    ,      Form_Load   
 100    Caption   Label.  
 - 100 (  icon)   
 Picture   Image. 

    Private   Sub   Form_Load() 
    Labell.Caption = LoadResString(100) 
    Imagel.Picture = LoadResPicture(100, 1) End Sub 

