PDA

View Full Version : wont run wscript on XP



moazzam
06-18-2004, 06:08 PM
hi all

ok so I have an installshield setup package built on dev 7.4 . it works perfcetly on all oses except XP. here's the issue. my setup performs these steps:

1. copies my .mdf file to temp folder - works on all
2. installs msde on the machines - works on all
3. moves .mdf file to data folder - works on all
4. from within the installScript, it runs a batch file that in turn calls
a vbs file using "wscript attachdb.vbs"

the attachdb.vbs file works on all oses except XP. I added a "msgbox "start"" line on the first line and even that wont show.

I added alerts and I know that my installscript runs the vbs file (attachdb.vbs) but never executes it

also, if I run the batch file from the dos command, it runs attachdb.vbs with wscript and attaches the database just fine. even gives me the msgbox commands.

WSH IS installed on the machine (from the same install package) cause I ran wscript and it showed me the settings. also, since it vbs file executes when you run it manually, wscript is obviously working

so everthing works fine from dos command but not from installShield!

any ideas?

thanks

Moazzam

joglekar
07-20-2004, 12:50 PM
I am having similar problem on Windows XP. I am unable to execute batch files on Windows XP during the 'execute' sequence. I am able to do so during the 'UI' sequence. I think this is a security issue with WIndows XP. Can anyone answer this?

Thanks

moazzam
07-20-2004, 01:32 PM
so I had a solution for this and it worked for my install package on XP:

if all you need to do is run a vbscript,

1. add it as an action but dont assign it in the sequence.
2. call it using MsiDoAction anywhere in your installScript

if you need to run the batch file (my batch file had some logic so I couldnt skip it):

1. create a vbscript that uses wsh to run your batch file. like this

-----
Dim WshShell
Dim intReturn

Set WshShell = CreateObject("WScript.Shell")
intReturn = WshShell.Run("c:\ptbatchfiles\dbScripts.bat",0,TRUE)
intReturn = WshShell.Run("c:\ptbatchfiles\dbupdateScripts.bat",0,TRUE)

set WshShell = Nothing
-----

2. create an action that runs this vbscript.

3. execute this action anywhere in your installScript using MsiDoAction.

Note: make sure you use FULL paths in ALL your batch files AND vbscript; Doing ChanegDirectory in installscript does not work for this solution!

hope it works for you too!

Moazzam