I am currently evaluating Advanced Installer 3.6.1 and am having difficulties inserting a custom action.
(I am completely new to vbscript and installations....)
I have read through the forum, and tried to apply them to my particular situation but to no avail.
I keep getting the "..problem with Windows Installer...script could not be run....contact package vendor...." error
The script runs up to a certain point and then fails....
i.e. I can see the script rename and delete the files in the directory before it fails...
What I need to do is...prompt the user for the type of database they are using, Access/SQL, and then rename some files in a directory based on this information....
I need to then register an ODBC connection for these...
My script is below;
[/img]
Code: Select all
set wshell=createObject("wscript.shell")
Const scatsTitle = " SCATS Central Manager 6.5.2 "
Const installDir = "C:\Program Files\SCATS6\Central Manager"
dim dbManage
dim msAccess
dim access97
dbManage = msgBox("Do you have a Database Management System", 4+vbQuestion, scatsTitle)
if dbManage = vbYes then
msAccess = msgBox("Are you you using MS Access?", 4+vbQuestion, scatsTitle)
if msAccess = vbYes then
access97 = msgBox("If you are using MS Access 97 click yes, otherwise click No", 4+vbQuestion, scatsTitle)
if access97 = vbYes then
setSCMSAccess97()
else
setSCMSAccess2000()
end if
else
setSCMSSQL()
end if
else
setSCMSAccess97()
end if
function setSCMSAccess97()
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile installDir&"\New SCMS.mdb" , installDir&"\SCMS.mdb"
objFSO.DeleteFile(installDir&"\New SCMS 2000.mdb"), true
objFSO.DeleteFile(installDir&"\New SCMS.mdf"), true
objFSO.DeleteFile(installDir&"\New SCMS.ldf"), true
end function
function setSCMSAccess2000()
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile installDir&"\New SCMS 2000.mdb" , installDir&"\SCMS.mdb"
objFSO.DeleteFile(installDir&"\New SCMS.mdb"), true
objFSO.DeleteFile(installDir&"\New SCMS.mdf"), true
objFSO.DeleteFile(installDir&"\New SCMS.ldf"), true
end function
function setSCMSSQL()
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile installDir&"\New SCMS.mdf" , installDir&"\SCMS.mdf"
objFSO.MoveFile installDir&"\New SCMS.ldf" , installDir&"\SCMS.ldf"
objFSO.DeleteFile(installDir&"\*.mdb"), true
end function
I hope somone can help...
Thanks in advance,
Seán.