'1
'2 INSTALL SCRIPT
'3
'4
'5 This progam will install the Database on a users PC
'6 It will make directories and copies the files necessary
'7 to run the Database
'8 For Questions and Concerns contact Input NAME
'9
'10
Dim inst_db 'variable for installing the database
Dim inst_dt_lnk 'variable for installing the desktop shortcut
Dim dba 'Database administrator for use in sending error message to
Dim dba_email 'The email address for the administrator
'15
dba = "Name"
dba_email = "EMAIL"
'18
'19
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShellScript = CreateObject("WScript.Shell")
With objShellScript
StartMenu = .specialFolders("StartMenu")
Desktop = .specialFolders("Desktop")
End With
Set objShellApp = CreateObject("Shell.Application")
Set olApp = CreateObject("Outlook.Application")
Set objMail = olApp.CreateItem(olMailItem)
'29
'30
inst_db = MsgBox("This script will install the files necessary to run the" & vbNewLine & _
"Database." & vbNewLine & vbNewLine & _
"Would you like to continue?", _
vbQuestion + vbYesNo + vbDefaultButton1, _
"Database Install")
'36
If inst_db = 6 Then '6 = yes, 7 = No
'38
If fso.FolderExists("C:\FOLDER") Then
' Do Nothing the Folder Exists
Else
fso.CreateFolder ("C:\FOLDER")
End If
'44
If fso.FolderExists(StartMenu & "\Programs\FOLDER") Then
' Do Nothing the Folder Exists
Else
fso.CreateFolder (StartMenu & "\Programs\FOLDER")
End If
'53 Copy the network Database Frontend Files to Your hard drive:
'54 The Database
fso.CopyFile _
"\\LOCATION\DATABASE.accde", _
"C:\FOLDER\", True
'58
'59 The Shortcut THIS IS WHERE I CREATED A SHORTCUT FROM THE OPEN.VBS & RENAMED IT
fso.CopyFile _
"\\LOCATION\Shortcut.lnk", _
"C:\FOLDER\", True
'65 The VBS file that checks to see that you have the latest version
fso.CopyFile _
"\\LOCATION\" & _
"Open.vbs", _
"C:\FOLDER\", True
'70
'71 The uninstall File
fso.CopyFile _
"\\LOCATION\" & _
"uninstall.bat", _
"C:\Folder\", True
'82
'83 The Icon
fso.CopyFile _
"\\Location\Name of Icon.ico", _
"C:\Folder\", True
'87
'88
'89 Copy the Shortcuts to your Start Menu:
fso.CopyFile _
"\\Location\" & _
"Shortcut.lnk", _
StartMenu & "\Programs\Folder\", True
'94 the Uninstal Files
fso.CopyFile _
"\\Location\" & _
"Uninstall.bat", _
StartMenu & "\Programs\Folder\", True
'99
'100 Asks the User if they would like a desktop shortcut:
inst_dt_lnk = MsgBox("Would like to place a shorcut to the " & vbNewLine & _
"Database Name" & vbNewLine & _
"on the desktop?", _
vbQuestion + vbYesNo + vbDefaultButton1, _
"Database Name")
'106
If inst_dt_lnk = 6 Then
fso.CopyFile _
"\\Location\" & _
"Shortcut.lnk", _
Desktop & "\", True
Else
'Do Nothing, the user does not want a desktop shortcut
End If
End If
'116
MsgBox "The installation has been completed sucessfully.", _
vbInformation + vbOKOnly, _
"DFS_Log"
objShellApp.ShellExecute "MSAccess", _
"C:\Folder\Database", _
"open"
'122