📄 form1.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Maxisoft Packager"
ClientHeight = 6285
ClientLeft = 45
ClientTop = 435
ClientWidth = 7875
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6285
ScaleWidth = 7875
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command4
Caption = "Finish"
Height = 375
Left = 5760
TabIndex = 8
Top = 5400
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "Continue"
Height = 375
Left = 240
TabIndex = 7
Top = 5400
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "Add"
Height = 375
Left = 6240
TabIndex = 5
Top = 2160
Width = 1455
End
Begin VB.ListBox List1
Height = 3180
Left = 240
TabIndex = 2
Top = 1800
Width = 5775
End
Begin VB.CommandButton Command1
Caption = "Package"
Default = -1 'True
Height = 615
Left = 3600
TabIndex = 0
Top = 360
Width = 1695
End
Begin MSComDlg.CommonDialog cmd
Left = 7200
Top = 1320
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Label Label4
Caption = "External ActiveX (*.OCX) and DLL (*.DLL) Files"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1335
Left = 6240
TabIndex = 6
Top = 2760
Width = 1455
End
Begin VB.Label Label3
Height = 1095
Left = 5400
TabIndex = 4
Top = 240
Width = 2295
End
Begin VB.Label Label2
Caption = "Project Dependency Files"
Height = 375
Left = 240
TabIndex = 3
Top = 1440
Width = 6855
End
Begin VB.Label Label1
Caption = "Load New Visual Basic Project to Package"
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 3495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim drv
'Author: Akinyemi Olusegun
'All codes here are mine
'the setup1 project is not all mine
'I dont have time for the project
'I felt like sharing code with PSCites
'Thats why I made it
Private Sub Command1_Click()
Dim p() As String
Dim prjPat
List1.Clear
cmd.Filter = "Visual Basic Project|*.vbp;*.vbp"
cmd.FilterIndex = 2
cmd.ShowOpen
f = cmd.FileName
Open f For Input As #1
s = Input(LOF(1), #1)
Close #1
'Dim p() As String
p = Split(s, vbCrLf)
For i = 0 To UBound(p)
GetLine (p(i))
Next
prjName = cmd.FileName
Label3.Caption = prjName
p = Split(prjName, "\")
For i = 0 To UBound(p) - 1
prjPat = prjPat + p(i) + "\"
Next
'If i = 0 Then prjPath = p(0) + "\"
prjPath = prjPat
'MsgBox prjPath
End Sub
Function GetLine(st As String)
On Error Resume Next
Dim sDir
sDir = Mid(basCommon.GetWindowsSysDir, 3, Len(basCommon.GetWindowsSysDir) - 2)
Dim l
Dim p() As String
p = Split(st, "#")
y = UBound(p)
If y = 0 Then Exit Function
If y <> 0 Then
If UBound(p) <= 3 Then
If p(2) = "" Then Exit Function
l = Trim(Mid(p(2), 3, Len(p(2)) - 2))
'MsgBox l
lo = Mid(l, 3, Len(l) - 2)
List1.AddItem basCommon.GetWindowsSysDir + l
Else
l = Trim(Mid(p(3), 3, Len(p(3)) - 2))
lo = Mid(l, 2, Len(l) - 1)
'List1.AddItem basCommon.GetWindowsSysDir + lo
'MsgBox lo
Select Case Left(lo, 1)
Case "."
loi = Mid(lo, 2, Len(lo) - 1)
If InStr(1, loi, sDir) = 1 Then
List1.AddItem drv + loi
Else
List1.AddItem basCommon.GetWindowsSysDir + Mid(loi, 2, Len(loi) - 1)
End If
Case Else
'List1.AddItem basCommon.GetWindowsSysDir + lo
List1.AddItem drv + "\" + lo
End Select
End If
End If
End Function
Private Sub Command2_Click()
cmd.Filter = "ActiveX|*.ocx;*.ocx |Dynamic Linking Library|*.dll;*.dll |All Files|*.*;*.*"
cmd.FilterIndex = 2
cmd.ShowOpen
List1.AddItem cmd.FileName
End Sub
Private Sub Command3_Click()
'MsgBox prjName
If Label3.Caption = "" Then
p = MsgBox("You must select a Visual Basic Project", vbCritical)
Exit Sub
End If
frmexe.Show vbModal
frminit.Show vbModal
'MsgBox pkjPath
'Start generating the setup.lst configuration files
'I dont know i just have to do it like this
'If anyone wants to do it better let me know
'
Open pkjPath + "SETUP.LST" For Output As #1
'[Bootstrap]
Print #1, "[Bootstrap]"
Print #1, "SetupTitle=Install"
Print #1, "SetupText=Copying Files, please stand by."
Print #1, "CabFile=" + CabFile
Print #1, "Spawn=Setup1.exe"
Print #1, "Uninstal=st6unst.exe"
Print #1, "TmpDir=msftqws.pdw"
Print #1, "Cabs=1"
Print #1, vbNewLine
'[Bootstrap Files] entries
Print #1, "[Bootstrap Files]"
Print #1, "File1=@VB6STKIT.DLL,$(WinSysPathSysFile),,,6/18/98 12:00:00 AM,102912,6.0.81.69"
Print #1, "File2=@COMCAT.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,5/31/98 9:00:00 AM,22288,4.71.1460.1"
Print #1, "File3=@stdole2.tlb,$(WinSysPathSysFile),$(TLBRegister),,8/4/04 1:00:00 PM,17920,3.50.5014.0"
Print #1, "File4=@asycfilt.dll,$(WinSysPathSysFile),,,8/4/04 1:00:00 PM,65024,5.1.2600.2180"
Print #1, "File5=@olepro32.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,8/4/04 1:00:00 PM,83456,5.1.2600.2180"
Print #1, "File6=@oleaut32.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,8/4/04 1:00:00 PM,553472,5.1.2600.2180"
Print #1, "File7=@msvbvm60.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,8/4/04 1:00:00 PM,1392671,6.0.96.90"
Print #1, "File8=@RICHED32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,8/4/04 1:00:00 PM,1392671,6.0.96.91"
Call FileCopy(basCommon.GetWindowsSysDir + "\VB6STKIT.DLL", pkjPath + "\support\" + "VB6STKIT.DLL")
Call FileCopy(basCommon.GetWindowsSysDir + "\COMCAT.DLL", pkjPath + "\support\" + "COMCAT.DLL")
Call FileCopy(basCommon.GetWindowsSysDir + "\stdole2.tlb", pkjPath + "\support\" + "stdole2.tlb")
Call FileCopy(basCommon.GetWindowsSysDir + "\asycfilt.dll", pkjPath + "\support\" + "asycfilt.dll")
Call FileCopy(basCommon.GetWindowsSysDir + "\olepro32.dll", pkjPath + "\support\" + "olepro32.dll")
Call FileCopy(basCommon.GetWindowsSysDir + "\oleaut32.dll", pkjPath + "\support\" + "oleaut32.dll")
Call FileCopy(basCommon.GetWindowsSysDir + "\msvbvm60.dll", pkjPath + "\support\" + "msvbvm60.dll")
Call FileCopy(basCommon.GetWindowsSysDir + "\RICHED32.DLL", pkjPath + "\support\" + "RICHED32.DLL")
Call FileCopy(basCommon.GetWindowsSysDir + "\VB6STKIT.DLL", pkjPath + "\support\" + "VB6STKIT.DLL")
Call FileCopy("c:\windows" + "\ST6UNST.EXE", pkjPath + "\support\" + "ST6UNST.EXE")
'MsgBox pExe
'Call FileCopy(psup + "\" + psexe, pkjPath + "\support\" + psexe)
'[IconGroups] entries
Print #1, vbNewLine
Print #1, "[IconGroups]"
Print #1, "Group0=" + Mid(psexe, 1, Len(psexe) - 4)
Print #1, "PrivateGroup0=True"
Print #1, "Parent0=$(Programs)"
Close #1
'Reset
frmsetup.Show vbModal
'cob = "makecab /F" + " " + App.Path + "\tdp.txt"
'Generating makecab source file
g = "setup"
Open psup + "\" + g + ".ddf" For Append As #1
Print #1, ".OPTION EXPLICIT"
Print #1, ".Set Cabinet=off"
Print #1, ".Set Compress=off"
Print #1, ".Set MaxDiskSize=CDROM"
Print #1, ".Set ReservePerCabinetSize=6144"
Print #1, ".Set DiskDirectoryTemplate=" + Chr$(34) + ".." + Chr$(34)
Print #1, ".Set CompressionType=MSZIP"
Print #1, ".Set CompressionLevel=7"
Print #1, ".Set CabinetNameTemplate=" + Chr$(34) + CabFile + Chr$(34)
Print #1, Chr$(34) + "setup.lst" + Chr$(34)
Print #1, Chr$(34) + "setup.exe" + Chr$(34)
Print #1, ".Set Cabinet=on"
Print #1, ".Set Compress=on"
Close #1
Open psup + "\" + g + ".ddf" For Append As #1
For i = 0 To List1.ListCount
If List1.List(i) = "" Then Exit For
Print #1, Chr$(34) + GetFil(List1.List(i)) + Chr$(34)
Next
Close #1
g = "setup"
Open psup + "\" + g + ".ddf" For Append As #1
Print #1, Chr$(34) + "VB6STKIT.DLL" + Chr$(34)
Print #1, Chr$(34) + "ST6UNST.EXE" + Chr$(34)
Print #1, Chr$(34) + "COMCAT.DLL" + Chr$(34)
'Print #1, pkjPath + "support\" + "stdole2.tlb"
Print #1, Chr$(34) + "asycfilt.dll" + Chr$(34)
Print #1, Chr$(34) + "olepro32.dll" + Chr$(34)
Print #1, Chr$(34) + "oleaut32.dll" + Chr$(34)
Print #1, Chr$(34) + "msvbvm60.dll" + Chr$(34)
Print #1, Chr$(34) + "RICHED32.DLL" + Chr$(34)
Print #1, Chr$(34) + "setup1.exe" + Chr$(34)
Close #1
kl = "MAKECAB"
cob = kl + " /F" + " " + drv + "\" + Mid(psup, 4, Len(psup) - 1) + "\" + g + ".ddf"
Open psup + "\" + g + ".bat" For Output As #2
Print #2, cob
Close #2
For i = 1 To 50000
DoEvents
Next
'MsgBox psup + "\" + g + ".bat"
'MsgBox cob
'Shell cob
ChDir psup + "\"
'Exit Sub
Shell psup + "\" + g + ".bat"
'MsgBox psup + "\" + g + ".ddf"
Reset
On Error Resume Next
'Kill psup + "\" + g + ".ddf"
p = MsgBox("Visual Basic Packager has finished packaging the project" + vbCrLf + "To use your customized setup" + vbCrLf + "Make the executable version of setup1 project" + vbCrLf + "Copy it into your package directory and run the setup.exe", vbInformation, "Done")
Unload Me
End Sub
Function GetFil(sd As String)
On Error Resume Next
'MsgBox sd
Dim p() As String
p = Split(sd, "\")
GetFil = p(UBound(p))
End Function
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
drv = Mid(App.Path, 1, 2)
'change this to path of visual basic
'to be candid i dont know how to do that
vbpath = "\Program Files\Microsoft Visual Studio\VB98\"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -