home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Profession19234552001.psc / Form1.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  2001-05-01  |  4.3 KB  |  147 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
  4. Begin VB.Form Form1 
  5.    BackColor       =   &H8000000A&
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Extracting data"
  8.    ClientHeight    =   1950
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   5595
  12.    Icon            =   "Form1.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   1950
  16.    ScaleWidth      =   5595
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   3  'Windows Default
  19.    Begin VB.Timer Timer2 
  20.       Interval        =   1500
  21.       Left            =   3000
  22.       Top             =   1440
  23.    End
  24.    Begin VB.CommandButton Command1 
  25.       Cancel          =   -1  'True
  26.       Caption         =   "&Cancel"
  27.       Default         =   -1  'True
  28.       Height          =   340
  29.       Left            =   4320
  30.       TabIndex        =   2
  31.       Top             =   1520
  32.       Width           =   1160
  33.    End
  34.    Begin MSComctlLib.ProgressBar ProgressBar1 
  35.       Height          =   190
  36.       Left            =   165
  37.       TabIndex        =   1
  38.       Top             =   1515
  39.       Width           =   3975
  40.       _ExtentX        =   7011
  41.       _ExtentY        =   344
  42.       _Version        =   393216
  43.       Appearance      =   1
  44.    End
  45.    Begin VB.Timer Timer1 
  46.       Interval        =   100
  47.       Left            =   -120
  48.       Top             =   1440
  49.    End
  50.    Begin MSComCtl2.Animation Animation1 
  51.       Height          =   735
  52.       Left            =   240
  53.       TabIndex        =   0
  54.       Top             =   240
  55.       Width           =   5295
  56.       _ExtentX        =   9340
  57.       _ExtentY        =   1296
  58.       _Version        =   393216
  59.       FullWidth       =   353
  60.       FullHeight      =   49
  61.    End
  62.    Begin VB.Label Label1 
  63.       Caption         =   "Extracting files..."
  64.       Height          =   255
  65.       Left            =   180
  66.       TabIndex        =   3
  67.       Top             =   1200
  68.       Width           =   4095
  69.    End
  70. Attribute VB_Name = "Form1"
  71. Attribute VB_GlobalNameSpace = False
  72. Attribute VB_Creatable = False
  73. Attribute VB_PredeclaredId = True
  74. Attribute VB_Exposed = False
  75. Dim unZipFile As New Unzip
  76. Dim TempPath As String
  77. Dim ExecPath As String
  78. Private Sub Command1_Click()
  79. End Sub
  80. Private Sub Timer1_Timer()
  81. On Error Resume Next
  82. ProgressBar1.Value = ProgressBar1.Value + 2
  83. 'Label1.Caption = unZipFile.GetLastMessage
  84. Me.Refresh
  85. End Sub
  86. Private Sub Form_Load()
  87. Me.Show
  88. Me.Refresh
  89. LoadAVI
  90. End Sub
  91. Function LoadAVI()
  92. Dim Temp As String
  93. Dim MyAVI As String
  94. Dim MyZip As String
  95. Open App.path & "\" & App.EXEName & ".exe" For Binary As #1
  96.     Temp = String(LOF(1), "x")
  97.     Get #1, , Temp
  98. Close #1
  99. pos1 = InStr(1, Temp, "<start AVI>")
  100. pos1 = pos1 + 11
  101. pos2 = InStr(1, Temp, "<end AVI>")
  102. MyAVI = Mid(Temp, pos1, pos2 - pos1)
  103. Randomize Timer
  104. TempPath = "C:\windows\temp\avi" & CStr(Rnd(1000) * 1)
  105. Destroy TempPath
  106. Open TempPath For Binary As #1
  107. Put #1, , MyAVI
  108. Close #1
  109. Animation1.Open TempPath
  110. Animation1.Play
  111. Destroy TempPath
  112. zippos1 = InStr(1, Temp, "<start compressed file>")
  113. zippos1 = zippos1 + 23
  114. zippos2 = InStr(1, Temp, "<end compressed file>")
  115. MyZip = Mid(Temp, zippos1, zippos2 - zippos1)
  116. Destroy "C:\Windows\Temp\Extract.zip"
  117. Open "C:\Windows\Temp\Extract.zip" For Binary As #1
  118.     Put #1, , MyZip
  119. Close #1
  120. xpos1 = InStr(1, Temp, "<start execute command>")
  121. xpos1 = xpos1 + 23
  122. xpos2 = InStr(1, Temp, "<end execute command>")
  123. ExecPath = Replace(Mid(Temp, xpos1, xpos2 - xpos1), "%extractdir%", "C:\Windows\Temp\Install")
  124. End Function
  125. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  126. Destroy TempPath
  127. End Sub
  128. Function Destroy(xpath As String)
  129. On Error Resume Next
  130. Kill xpath
  131. End Function
  132. Function MakeDir(path As String)
  133. On Error Resume Next
  134. MkDir path
  135. End Function
  136. Private Sub Timer2_Timer()
  137. Timer2.Enabled = False
  138. Dim unZipFile As New Unzip
  139. MakeDir "C:\Windows\Temp\Install\"
  140. unZipFile.ZipFileName = "C:\Windows\Temp\Extract.zip"
  141. unZipFile.ExtractDir = "C:\Windows\Temp\Install\"
  142. unZipFile.Unzip
  143. Destroy "C:\Windows\Temp\Extract.zip"
  144. ProgressBar1.Value = 100
  145. Shell ExecPath, vbNormalFocus
  146. End Sub
  147.