viSci Posted October 26, 2007 Report Share Posted October 26, 2007 I am trying to run a batch file called register.bat after the installation is complete. It gets installed in the program files directory with all the other installation files. The installer seems to be invoking this batch file but none of the intended actions go off. If I go to the installation directory and launch the batch file manually it goes off without a hitch. I have tried calling it from the run window and it also works fine. BTW, the batch file calls a VBscript which runs a regsrv32 and it also runs another setup.exe Here is the register.bat file contents: register.vbs Here is the register.vbs file contents: option explicit dim ws set ws = CreateObject("WScript.Shell") ws.exec "C:\Program Files\ECG Stairstep\vrmixr\setup.exe" ws.run "regsvr32.exe anigif.ocx" set ws = nothing Thanks, Mike Sachs Intelligent Systems Quote Link to comment
Omar Mussa Posted October 26, 2007 Report Share Posted October 26, 2007 QUOTE(sachsm @ Oct 24 2007, 05:35 PM) I am trying to run a batch file called register.bat after the installation is complete. It gets installed in the program files directory with all the other installation files. On a related gotcha, in LV 8.2 (not sure if fixed in 8.5), if you select that option, there is NO UNDO. Basically, the only way to uncheck the 'run after completion' checkbox is to delete the installer spec (truly a pain). Quote Link to comment
Ton Plomp Posted October 26, 2007 Report Share Posted October 26, 2007 QUOTE(sachsm @ Oct 25 2007, 02:35 AM) I am trying to run a batch file called register.bat after the installation is complete. It gets installed in the program files directory with all the other installation files.The installer seems to be invoking this batch file but none of the intended actions go off. If I go to the installation directory and launch the batch file manually it goes off without a hitch. I have tried calling it from the run window and it also works fine. BTW, the batch file calls a VBscript which runs a regsrv32 and it also runs another setup.exe Here is the register.bat file contents: register.vbs Here is the register.vbs file contents: option explicit dim ws set ws = CreateObject("WScript.Shell") ws.exec "C:\Program Files\ECG Stairstep\vrmixr\setup.exe" ws.run "regsvr32.exe anigif.ocx" set ws = nothing Thanks, Mike Sachs Intelligent Systems Maybe you need to browse inside the batch/cmd environment to the installed location. or include the directory in the Path. Can't you run the vbs directly from the installer? Ton Quote Link to comment
viSci Posted October 26, 2007 Author Report Share Posted October 26, 2007 Unfortunately, in LV8.2.1 you can only run executables that are .exe or .bat not .vbs Quote Link to comment
jpdrolet Posted October 26, 2007 Report Share Posted October 26, 2007 try to put cd /D %0\.. as the first line to make sure that the working folder is the same as the batch file Also on not every system are the vbs directly executable so you start it with wscript.exe register.vbs Quote Link to comment
bpreis Posted October 26, 2007 Report Share Posted October 26, 2007 I'd start by changing the batch file to echo on pause register.vbs pause to verify that your vbs actually runs and see what the call to register.vbs is returning QUOTE Maybe you need to browse inside the batch/cmd environment to the installed location. or include the directory in the Path. I think Ton is on to something here. It's possible register.vbs is not being called at all if the current working directory is different from the install directory. In that case you should try: echo on pause cd "%1" register.vbs pause and modify the Installer Build spec to pass "[iNSTALLDIR]" (with quotes) as a command line argument. %1, %2, etc is the syntax used to access command line arguments passed to a batch file. -Bob Quote Link to comment
viSci Posted October 26, 2007 Author Report Share Posted October 26, 2007 Thanks to everyone who has tried to help. Here is the version of a batch file that finally worked: cd c:\Program Files\Ecg Stairstep regsvr32.exe """c:\program files\ecg stairstep\anigif.ocx""" "c:\program files\ecg stairstep\vrmixr\setup.exe" Lessons learned: The cd command does not have any effect when this batch file is called from the installer. The following snippet does not work even though anigif.ocx is located at c:\Program Files\Ecg Stairstep - cd c:\Program Files\Ecg Stairstep regsvr32.exe anigif.ocx The complete absolute path always needs to be provided. The use of triple quotes is required to create a literal path string that contains quotes. The last line will not work without quotes since there are spaces in the pathname. Maybe Vista Powershell will finally extricate us from DOS hell. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.