Option Explicit
On Error Resume Next
Const OverwriteExisting = True
'**************************************************
'Declare Global Objects
'**************************************************
Dim TrueCrypt
Dim DriverFile
Dim Shortcut
Dim fso
Dim objFolder
Dim ShortCutFolder
Dim strDirectory
Dim strTCShortcutDir
'**************************************************
'*Create Object Definitions
'**************************************************
TrueCrypt = "\\share\TrueCrypt\ScriptFiles\TrueCrypt.exe"
DriverFile = "\\share\TrueCrypt\ScriptFiles\truecrypt.sys"
Shortcut = "\\share\TrueCrypt\ScriptFiles\TrueCrypt.lnk"
Set fso = CreateObject("Scripting.FileSystemObject")
strDirectory = "C:\Program Files\TrueCrypt"
strTCShortcutDir = "C:\Documents and Settings\All Users\Start Menu\Programs\TrueCrypt\"
Set objFolder = fso.CreateFolder(strDirectory)
Set ShortCutFolder = fso.CreateFolder(strTCShortcutDir)
'****************************************************
'*Begin Installation - Create Program Files Directory
'****************************************************
If fso.FolderExists(strDirectory) Then
Set objFolder = fso.GetFolder(strDirectory)
'WScript.Echo strDirectory & " already created "
Else
Set objFolder = fso.CreateFolder(strDirectory)
End If
'****************************************************
'*Create Shortcut Directory
'****************************************************
If fso.FolderExists(strTCShortcutDir) Then
Set ShortCutFolder = fso.GetFolder(strTCShortcutDir)
'WScript.Echo strTCShortcutDir & " already created "
Else
Set ShortCutFolder = fso.CreateFolder(strTCShortcutDir)
End If
'************************
'*Copy Files
'************************
'wscript.Echo "Copying Executable"
fso.CopyFile TrueCrypt , "C:\Program Files\TrueCrypt\", OverwriteExisting
'wscript.Echo "Copying Driver"
fso.CopyFile DriverFile , "C:\Program Files\TrueCrypt\", OverwriteExisting
'wscript.Echo "Copying Shortcut for Program Files"
fso.CopyFile Shortcut , "C:\Program Files\TrueCrypt\", OverwriteExisting
'wscript.Echo "Copying Shortcut for Start Menu"
fso.CopyFile Shortcut , "C:\Documents and Settings\All Users\Start Menu\Programs\TrueCrypt\", OverwriteExisting
|