Jump to content

Run Executable After Installation is giving me a headache!


Recommended Posts

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

Link to comment

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).

Link to comment

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

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.