OK, here's the CA (code embedded directly in CA)...
Dim TempFolder
TempFolder = Session.Property("TempFolder")
ExtractBinary "eula", TempFolder & "EULA.rtf"
Print TempFolder & "EULA.rtf"
Function ExtractBinary(BinaryName, OutputFile)
Const msiReadStreamAnsi = 2
Dim oDatabase
Set oDatabase = Session.Database
Dim View
Set View = oDatabase.OpenView("SELECT * FROM Binary WHERE Name = '" & BinaryName & "'")
View.Execute
Dim Record
Set Record = View.Fetch
Dim BinaryData
BinaryData = Record.ReadStream(2, Record.DataSize(2), msiReadStreamAnsi)
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
Dim Stream
Set Stream = FSO.CreateTextFile(OutputFile, True)
Stream.Write BinaryData
Stream.Close
Set FSO = Nothing
End Function
Function Print(sFile)
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run Session.Property("SystemFolder") & "write.exe /p " & TempFolder & "EULA.rtf"
Set shell = Nothing
End Function
Should I change this CA to script executed from install (Wise's option for executing from Binary Table)? Would that be safer in that any script blocking won't detect, prevent this from running. Also, should I add 'On Error Resume Next' in there anywhere. If there is some reason they couldn't print, I wouldn't want the install to blow up altogether!I'm not really savvy enough to create a .dll to accomplish this, then pass the needed parameters to it from the install (Wise does have a dll CA where parameters can be passed). I would like to learn, however, if its safer. However, I am in a pinch and since what I have now appears to work, if I can ensure the vbScript will run, I would like to take that approach for now since I'm up against a nearing distribution deadline (this Friday, May 11, 2007!). Please don't let this prevent anyone from providing .dll pointers if its fairly easy.
Currently I am duplicating the .rtf's in the binary table as I don't see the reference Stefan supplied earlier. I don't know that this is critical at this point so let me know if I should consider it so.
THANKS ALL FOR THE INFORMATION!!!
I LOOK FORWARD TO HEARING FROM SOMEONE SOOOOON!