custom action embedded vbscript problem?
I have an embedded vbscript (displayed below) running at the top of Execute Immediate.
If Not Installed then
| Call VBScript From Embedded Code (Action)
End
_______________________________________________________________________________________________________
Embedded VBScript:
On Error Resume NExt
Dim objShell, objNewPort, objWMIService, oFSO, Path, strComputerA
Dim RunErrorToReturn, Results
Dim strComputer : strComputer = "."
Dim objNetwork : Set objNetwork = CreateObject("WScript.Network")
strComputerA = objNetwork.ComputerName
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
ProgramFiles = objShell.ExpandEnvironmentStrings("%ProgramFiles%")
windir= objShell.ExpandEnvironmentStrings("%windir%")
temp = objShell.ExpandEnvironmentStrings("%temp%")
allusers=objShell.ExpandEnvironmentStrings("%AllUsersProfile%")
path= oFSO.GetParentFolderName(WScript.ScriptFullName)
objShell.Run ("RunDll32 printui.dll,PrintUIEntry /if /b ""HP LaserJet III"" /f "+windir+"\inf\ntprint.inf /r ""lpt1:"" /m ""HP LaserJet III""")
On Error Resume Next
____________________________________________________________________________________________________
The problem is this printer is installing not fast enough and the fax printer driver trys to install but can't because the above printer driver wasn't installed in time.
How do I make it where the above embedded script is a mandatory install before the Fax printer driver?
If Not Installed then
| Call VBScript From Embedded Code (Action)
End
_______________________________________________________________________________________________________
Embedded VBScript:
On Error Resume NExt
Dim objShell, objNewPort, objWMIService, oFSO, Path, strComputerA
Dim RunErrorToReturn, Results
Dim strComputer : strComputer = "."
Dim objNetwork : Set objNetwork = CreateObject("WScript.Network")
strComputerA = objNetwork.ComputerName
Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
ProgramFiles = objShell.ExpandEnvironmentStrings("%ProgramFiles%")
windir= objShell.ExpandEnvironmentStrings("%windir%")
temp = objShell.ExpandEnvironmentStrings("%temp%")
allusers=objShell.ExpandEnvironmentStrings("%AllUsersProfile%")
path= oFSO.GetParentFolderName(WScript.ScriptFullName)
objShell.Run ("RunDll32 printui.dll,PrintUIEntry /if /b ""HP LaserJet III"" /f "+windir+"\inf\ntprint.inf /r ""lpt1:"" /m ""HP LaserJet III""")
On Error Resume Next
____________________________________________________________________________________________________
The problem is this printer is installing not fast enough and the fax printer driver trys to install but can't because the above printer driver wasn't installed in time.
How do I make it where the above embedded script is a mandatory install before the Fax printer driver?
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
anonymous_9363
16 years ago
Surely any sane person has LaserJet printer drivers as part of their base build? If not, I'd build a package to install at least one (and probably not an antique like LJ III).
The problem with scripted installs is that many people assume they know what they're doing (no offence). If you don't want to go to thr trouble of building a proper package for LJ drivers, you should create a more professional script, one which uses WMI to create a process, capture the process ID and wait for that process to end before progressing to install your fax driver.
The problem with scripted installs is that many people assume they know what they're doing (no offence). If you don't want to go to thr trouble of building a proper package for LJ drivers, you should create a more professional script, one which uses WMI to create a process, capture the process ID and wait for that process to end before progressing to install your fax driver.
Posted by:
case2k5
16 years ago
Posted by:
michaelnowell
16 years ago
So you're asking someone to write a script for you. I hope that you're willing to pay them for it.
Just before the custom action 'Create_RFPrinter_CA' in the Execute Deferred sequence, add an action to Execute Program From Destination and run the following command line
cmd.exe /c rundll32 printui.dll,PrintUIEntry /ia /m "HP LaserJet 4" /h "Intel" /v "Windows 2000" /f %windir%\inf\ntprint.inf /q
Set you CA to 'Syncronous, Ignore Exit Code' and this will wait until the CA has completed before continuing with the rest of you installation.
Try using the help file in you packaging software, you'll be amazed at what you can learn from it.
Just before the custom action 'Create_RFPrinter_CA' in the Execute Deferred sequence, add an action to Execute Program From Destination and run the following command line
cmd.exe /c rundll32 printui.dll,PrintUIEntry /ia /m "HP LaserJet 4" /h "Intel" /v "Windows 2000" /f %windir%\inf\ntprint.inf /q
Set you CA to 'Syncronous, Ignore Exit Code' and this will wait until the CA has completed before continuing with the rest of you installation.
Try using the help file in you packaging software, you'll be amazed at what you can learn from it.
Posted by:
vijayskb@gmail.com
15 years ago
Posted by:
anonymous_9363
15 years ago
ORIGINAL: [email=vijayskb@gmail.com]vijayskb@gmail.com[/email]Why not do the job properly and use WPS's 'Services' link (Installation Expert/Feature Details/Services)?
Hello Can anybody help to Add a perticular service in Application through VB scripts.
I am using Wise package studio5.6 Tool for application Re-packaging
Pls send the script to Following mail ID
[:)]
[email=vijayskb@gmail.com]vijayskb@gmail.com[/email]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.