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
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)
Please log in to answer
Posted by:
timmsie
15 years ago
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
http://msdn.microsoft.com/en-us/library/aa368230(VS.85).aspx
Posted by:
anonymous_9363
15 years ago
Posted by:
captain_planet
15 years ago
...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
Posted by:
djain3
15 years ago
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
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
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.
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
Posted by:
anonymous_9363
15 years ago
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
Posted by:
anonymous_9363
15 years ago
Posted by:
timmsie
15 years ago
Posted by:
djain3
15 years ago
Posted by:
MSIPackager
15 years ago
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
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
Posted by:
Galactus
15 years ago
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
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
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
Posted by:
jmcfadyen
15 years ago
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.
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.
so that the conversation will remain readable.