/build/static/layout/Breadcrumb_cap_w.png

VBscript help required for a custom action

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

Answers (21)

Posted by: timmsie 15 years ago
Fourth Degree Brown Belt
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
Posted by: anonymous_9363 15 years ago
Red Belt
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.
Posted by: captain_planet 15 years ago
Black Belt
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....
Posted by: djain3 15 years ago
Second Degree Blue Belt
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
Posted by: djain3 15 years ago
Second Degree Blue Belt
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
Posted by: anonymous_9363 15 years ago
Red Belt
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.
Posted by: djain3 15 years ago
Second Degree Blue Belt
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...
Posted by: anonymous_9363 15 years ago
Red Belt
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.
Posted by: djain3 15 years ago
Second Degree Blue Belt
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.
Posted by: anonymous_9363 15 years ago
Red Belt
0
I *can* help you out but you seem determined to ignore the advice you're getting.

Good luck
Posted by: timmsie 15 years ago
Fourth Degree Brown Belt
0
what does your log file say? The one that Ian suggested you create several hours ago!
Posted by: djain3 15 years ago
Second Degree Blue Belt
0
log files give 1722 error with return vale of 3
Posted by: djain3 15 years ago
Second Degree Blue Belt
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.
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
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.
Posted by: aogilmor 15 years ago
9th Degree Black Belt
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]
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
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
Posted by: Galactus 15 years ago
Senior Yellow Belt
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.
Posted by: rbrucelee1978 15 years ago
Orange Belt
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]
Posted by: djain3 15 years ago
Second Degree Blue Belt
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.
Posted by: anonymous_9363 15 years ago
Red Belt
0
OP=Original Poster, i.e., the person who first posted the thread.

I'm glad you got it sorted.
Posted by: jmcfadyen 15 years ago
5th Degree Black Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ