I need to write a vbscript custom action to call an
executable from source directory. I am using the below script which run fine when executed.

commandline = "NWSAPsetup.exe"
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run commandline

but the same script when run from a custom action of msi gives some vbscript error.
Can anyone please provide me a vbscript that will run perfectly from custom action as well.

Also, i need to write a custom action that call a batch file..
Help will be appreciated.

Many thanks in advance
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
why not use a "Custom Action Type 50" that's what it's there for

http://msdn.microsoft.com/en-us/library/aa368230(VS.85).aspx
Answered 03/25/2009 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
...and come the time to call your batch file, you can use the same CA type to call CMD.EXE (or START.EXE, whatever) specifying an appropriate command line.
Answered 03/25/2009 by: VBScab
Red Belt

Please log in to comment
0
...and if you didn't end up using a Type 50 custom action (CA) for whatever reason (although you really should be), then you may want to try specifying the path to 'NWSAPsetup.exe' in your script. Here it looks like you've probably tested it by lumping your .vbs into the same folder as the executable (which would probably work) but it won't work if you're just calling it from a Type 38 CA. If that doesn't work, check that you've sequenced it correctly....
Answered 03/25/2009 by: captain_planet
Third Degree Brown Belt

Please log in to comment
0
I used the CA - 50

I get an error as "There is a problem with this windows installer package. A program run as part of the setup didn't finish as expected."

Am i doing somthing wrong? please advise
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
Yes, I have put the .vbs in the same folder where the executable is.

But calling it from all the custom action fails.

Please provide a vbscript that work even when called from a custom action...that will really help.

I don't why vbs work fine when executed by double click and fail when called from a custom action
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
Forget the scripted solution. Nasty. Plus, I don't imagine many people here have time to build scripts for other people. Unless you want to pay, of course...

Create a verbose log for the install. When it completes, search the log for that error text. In the preceding few lines, you should see the actual error returned by the executable. Can we presume that your MSI "installs" the EXE before attempting to execute it? Or are you, by any chance, trying to execute it from a non-local path?

Lastly, notice the 'Edit' link on the top right-hand side of your post? Use that, rather than creating new posts.
Answered 03/25/2009 by: VBScab
Red Belt

Please log in to comment
0
I thougt people will not mind providing a 2 line vbscript that will work...as it is not a problem for expert helping guys...
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
I thougt people will not mind providing a 2 line vbscript that will workOnly an amateur would write a 2-line script to do that job. A proper script would check that the source folder exists, whether the executable exists, and so on and so on.

In any event, as has already been stated ad nauseum, you should call the EXE directly, not mess about with batch files and/or scripts. Do you use a hammer to drive screws into your walls, or a screwdriver? Use the right tool for teh job.
Answered 03/25/2009 by: VBScab
Red Belt

Please log in to comment
0
When the bloody hammer doesn't work then need to find other tools if can get a success.

If you can't help me out please stop your useless comments.
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
I *can* help you out but you seem determined to ignore the advice you're getting.

Good luck
Answered 03/25/2009 by: VBScab
Red Belt

Please log in to comment
0
what does your log file say? The one that Ian suggested you create several hours ago!
Answered 03/25/2009 by: timmsie
Fourth Degree Brown Belt

Please log in to comment
0
log files give 1722 error with return vale of 3
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
VBScab,

I have tried calling EXE direclty, it install SAP application but shortcut not launches.

When the command to install exe is run from batch file it install application fine and shortcut of application launches...

I am confused what is missing when exe is installed via msi custom action.
Answered 03/25/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
When the bloody hammer doesn't work then need to find other tools if can get a success.

If you can't help me out please stop your useless comments.


Nice attitude.

People have been trying to help you. You don't need to use a script for this. Type 50 CA runs an exe directly, you can also pass any command line switches that might be required.

Don't get p!ssed at people cos they are not offering to do yout job for you.
Answered 03/25/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
ORIGINAL: MSIPackager

When the bloody hammer doesn't work then need to find other tools if can get a success.

If you can't help me out please stop your useless comments.


Nice attitude.

People have been trying to help you. You don't need to use a script for this. Type 50 CA runs an exe directly, you can also pass any command line switches that might be required.

Don't get p!ssed at people cos they are not offering to do yout job for you.


I think it ironic that the OP mentioned a hammer, because I think this is a case of the Glass Bottle or Old Shoe question I posted about a while back. My first answer would be (as I saw others answer) "Don't use a CA or a vbscript to call nwsapsetup.exe!!!" it's not Windows Installer but the sap setup admin is a robust and customizable setup environment and can be run from your distribution tool of choice to deploy the app. Running a CA from an MSI to run nwsapsetup.exe...ay, my head hurts!

Could the OP be one of the experts from Patni??!!... [:D]
Answered 03/25/2009 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Unless they are using group policy to deploy the package which only supports msi's (unless you count zap files)

Either way he's making it hard for himself...

I see the outsourcing thread is stil ticking over on the job board forum haha
Answered 03/25/2009 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
ORIGINAL: MSIPackager

Unless they are using group policy to deploy the package which only supports msi's (unless you count zap files)

Either way he's making it hard for himself...

I see the outsourcing thread is stil ticking over on the job board forum haha


Big Funny! OP this board is full extremely helpful and very capable people. Take their advice man.
Answered 03/25/2009 by: Galactus
Senior Yellow Belt

Please log in to comment
0
ORIGINAL: djain3

When the bloody hammer doesn't work then need to find other tools if can get a success.

If you can't help me out please stop your useless comments.


Although VBScabs comments/replies seem a bit sarcastic/harsh/blunt, I wouldn't think twice about taking in the advice he provides. He's one of the more knowledgable posters on this forum.

Again, another stream from VBScab's tough love curriculum [:D]
Answered 03/25/2009 by: rbrucelee1978
Orange Belt

Please log in to comment
0
OP

What does OP mean? can anyone advise please[8|]

I finally got the root of the problem..

My original CA type 50 worked...the problem was that batch file was installing preprequisites (MSXML and VC++ 2005 redist)

and the custom action I used to call the command to call SAP executable was not installing the prerequisites.

So, finally I am getting prerequisites installed separately and SAP separately.

All look ok at the moment.
Answered 03/26/2009 by: djain3
Second Degree Blue Belt

Please log in to comment
0
OP=Original Poster, i.e., the person who first posted the thread.

I'm glad you got it sorted.
Answered 03/26/2009 by: VBScab
Red Belt

Please log in to comment
0
custom actions can be pretty complex. you need to have a solid understanding of windows installer sequencing to enable you to sequence them correctly and execute them by the correct resource.

i would suggest you have a read of the two sequencing blurbs I have in my blog.

http://johnmcfadyen.spaces.live.com

It covers these aspects in heavy detail, maybe even have a look at CustomActionData as well (worth knowing about) although probably not relevant in this situation.

your current pre-req will fail due to session availability explained above.
Answered 03/26/2009 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity