Custom action to call a batch file
Hi,
I am trying to write a custom action to cal the batch file.
I have written it but problem is that it only launches the black screen ( command screen ) for a while but doesn't execute the command written in batch file.
command written in batch file is as follow, a single line:
NwSAPSetup.exe /Silent /Pakcage="SAP_GUI_7.10_b01"
When this batch file is executed by double click, it works pefectly but from a msi custom action it is not working.
Please help...[&:]
I am trying to write a custom action to cal the batch file.
I have written it but problem is that it only launches the black screen ( command screen ) for a while but doesn't execute the command written in batch file.
command written in batch file is as follow, a single line:
NwSAPSetup.exe /Silent /Pakcage="SAP_GUI_7.10_b01"
When this batch file is executed by double click, it works pefectly but from a msi custom action it is not working.
Please help...[&:]
0 Comments
[ + ] Show comments
Answers (27)
Please log in to answer
Posted by:
cygan
15 years ago
very simple task but just wondering why do you want to exeucte the .bat file
have a look at https://kb.altiris.com/ type in comspec and look for article id 2505
job done
regarding the vb script with the custom action how is it sequenced and what are your conditions are you using the binary table
have a look at https://kb.altiris.com/ type in comspec and look for article id 2505
job done
regarding the vb script with the custom action how is it sequenced and what are your conditions are you using the binary table
Posted by:
djain3
15 years ago
Posted by:
djain3
15 years ago
Posted by:
cygan
15 years ago
Posted by:
cygan
15 years ago
seems to me you have not included "NwSAPSetup.exe" in your package
where is the ref to the <path> ie C:\foldername\NwSAPSetup.exe in your batch file
have you added the batch file to your package
if you are running NwSAPSetup.exe after the msi installs then sequence after innstallfinalize with condition Not Installed
where is the ref to the <path> ie C:\foldername\NwSAPSetup.exe in your batch file
have you added the batch file to your package
if you are running NwSAPSetup.exe after the msi installs then sequence after innstallfinalize with condition Not Installed
Posted by:
anonymous_9363
15 years ago
Posted by:
djain3
15 years ago
Yes you are correct this NwSAPSetup.exe is not included in msi package.
there is nothing in my msi package...just nothing...I have created a msi wrapper to call this NwSAPSetup.exe as msi installation is required for Landesk deployment...
I just have to install this exe using the msi....thats it
Yes, I run the .bat file after the installfinalize...
.bat file contains a single line which is : NwSAPSetup.exe /Silent /Pakcage="SAP_GUI_7.10_b01"
problem i have is...when this bat file is run..it install SAP 7.10 and a desktop shortcut ... which launch perfectly..
I have used the msi custom action to call this command...first set a property to poing path of this exe and then call another custom actioin to provide /Silent /Pakcage="SAP_GUI_7.10_b01" command.
This also install SAP on target machine. Now the issue is that shortcut doesn't launch.
So, I thought if bat file install it fine then I should call the bat file from my package.
I have used the set property custom action with InstallAction property with value of [SourceDir]setup\NwSAPsetup.exe
and then used the custom action execute program from path where i have passed the following command to installaction property /Silent /Package="SAP_GUI_7.10_b01"
there is nothing in my msi package...just nothing...I have created a msi wrapper to call this NwSAPSetup.exe as msi installation is required for Landesk deployment...
I just have to install this exe using the msi....thats it
Yes, I run the .bat file after the installfinalize...
.bat file contains a single line which is : NwSAPSetup.exe /Silent /Pakcage="SAP_GUI_7.10_b01"
problem i have is...when this bat file is run..it install SAP 7.10 and a desktop shortcut ... which launch perfectly..
I have used the msi custom action to call this command...first set a property to poing path of this exe and then call another custom actioin to provide /Silent /Pakcage="SAP_GUI_7.10_b01" command.
This also install SAP on target machine. Now the issue is that shortcut doesn't launch.
So, I thought if bat file install it fine then I should call the bat file from my package.
I have used the set property custom action with InstallAction property with value of [SourceDir]setup\NwSAPsetup.exe
and then used the custom action execute program from path where i have passed the following command to installaction property /Silent /Package="SAP_GUI_7.10_b01"
Posted by:
cygan
15 years ago
Posted by:
cygan
15 years ago
ok will give you a TIP here hope this might help.
this is by no means a packaging standard for removing folders
will create a folder on programfilesfolder called "myfolder" and I will delete this folder on installing my msi
I will create a folder "c:\program files\myfolder"
will create a .bat file called mybat.bat
mybat.bat contains RD /S /Q "C:\program files\MyFolder" <note path>
add .bat to the msi < note path>
custom action type : execute program from path
property : %COMSPEC
command line : "/c "c\<note path>"\"mybat.bat""
location : Normal Execute Immediate/deferred. After InstallValidate
condition : REMOVE= "ALL"
processing option : synchronous, ignore exit code
in your case sequence after installfinalize with condition Not Installed
if your setup.exe has other files in the folder you will have to include them as well
forget about using properties to define the path for now just hard code it and see if your batch file works
this is by no means a packaging standard for removing folders
will create a folder on programfilesfolder called "myfolder" and I will delete this folder on installing my msi
I will create a folder "c:\program files\myfolder"
will create a .bat file called mybat.bat
mybat.bat contains RD /S /Q "C:\program files\MyFolder" <note path>
add .bat to the msi < note path>
custom action type : execute program from path
property : %COMSPEC
command line : "/c "c\<note path>"\"mybat.bat""
location : Normal Execute Immediate/deferred. After InstallValidate
condition : REMOVE= "ALL"
processing option : synchronous, ignore exit code
in your case sequence after installfinalize with condition Not Installed
if your setup.exe has other files in the folder you will have to include them as well
forget about using properties to define the path for now just hard code it and see if your batch file works
Posted by:
djain3
15 years ago
Posted by:
djain3
15 years ago
Posted by:
cygan
15 years ago
Posted by:
cygan
15 years ago
Why do I need to ? please advise...as I simply run bat from soure diretory
ORIGINAL: djain3
I have not included bat file in my msi.
Why do I need to ? please advise...as I simply run bat from soure diretory
is it mandatory to include .bat file in package to work? where should I install it and what is the use when it has to run from source directory
seems your bat file is not been read from the soucre dir hence 1722
try the tip that i gave
Posted by:
djain3
15 years ago
Dear cygan....if I use sychronous ignore exit code...it will not give error for sure but it doesn't mean that it will execute the command given in custom action :) custom action still fails
yes, bat file is not running from souredir....that i wanted to know ...why
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.
yes, bat file is not running from souredir....that i wanted to know ...why
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
last i checked SAP was already MSI based called by an external EXE wrapper.
As such wrapping your EXE file with an MSI is likely to fail due to this
MSI for landesk calls EXE
EXE calls MSI for SAP
duplicate session existance will cause the EXE to fail deployment as you already have a session in progress from your wrapper.
;-)
As such wrapping your EXE file with an MSI is likely to fail due to this
MSI for landesk calls EXE
EXE calls MSI for SAP
duplicate session existance will cause the EXE to fail deployment as you already have a session in progress from your wrapper.
;-)
Posted by:
Blue_Demon
15 years ago
Hey folks,
I have the same issue, need to deploy VC++ 2005 redist before installing an application (or the app install doesn't finish if it isn't present).
Trying to get a custom action going to run the PreReq first, then install the app, but it keeps installing it afterwards and returns an error about having another install running.
Any quick tips?
Thanks.
I have the same issue, need to deploy VC++ 2005 redist before installing an application (or the app install doesn't finish if it isn't present).
Trying to get a custom action going to run the PreReq first, then install the app, but it keeps installing it afterwards and returns an error about having another install running.
Any quick tips?
Thanks.
Posted by:
anonymous_9363
15 years ago
Posted by:
Blue_Demon
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
Blue_Demon
15 years ago
ORIGINAL: VBScab
(deploying with GPO).That makes it easy, then. You can create a deployment package with the VCRTs and deploy it to 'Authorised Users' on a per-machine basis.
[font="tms rmn"]
Cool. So just do up an MSI running this exe?
How does GPO handle the sequence of installs, as I need the merge module exe to run before the application install. (Coming from a Netware background, so not 100% on GPO)
Posted by:
jmcfadyen
15 years ago
blue your still missing the point here.
you cannot run 2 msi's together.
VC 2005 is an MSI wrapped inside an EXE. Therefore your method of wrapping the exe in an msi will not work.
As your initial msi will run, call the exe which in turn will call the MSI which will clash with your already present msi session.
if you want to deploy VC 2005 with GPO you need to extract the MSI from the EXE and deploy that.
you cannot run 2 msi's together.
VC 2005 is an MSI wrapped inside an EXE. Therefore your method of wrapping the exe in an msi will not work.
As your initial msi will run, call the exe which in turn will call the MSI which will clash with your already present msi session.
if you want to deploy VC 2005 with GPO you need to extract the MSI from the EXE and deploy that.
Posted by:
Blue_Demon
15 years ago
Posted by:
spartacus
15 years ago
ORIGINAL: Blue_Demon
OK. I get what you're saying now. As it's an EXE, that was what was throwing me. I've tried running uniextract16.exe on the vcredist_sp1_x86.exe file but it cannot extract anything. The install runs through so quickly, I can't grab anything from the %TEMP% folder.
Any other possible way?
Try opening vcredist_sp1_x86.exe in WinZip. This should allow you to extract the file VCREDI~3.EXE. Then open the extracted VCREDI~3.EXE in WinZip and you should see the MSI and CAB files vcredist.msi and vcredis1.cab respectively.
Regards,
Spartacus
Posted by:
anonymous_9363
15 years ago
[font="tms rmn"]How does GPO handle the sequence of installs,Add the MSI (and don't forget the MST - use the 'Modifications' tab) to the GPO in the order in which they should be installed. Better yet, why not create a machine-based GPO for the VCRTs and assign it to 'Authorised Users'? That way, machines get the machine deployment before users log in.Oops! I already said that...
Posted by:
Blue_Demon
15 years ago
Guys, thanks for the help on this.
Got Univeral Extractor to extract the MSI and CAB file (no idea why it didn't work the other day). Have depolyed this pre-req and then followed up with the application install.
Works a treat on a machine install, is giving an error on a file as a user install, but I'll google the issue and work it out.
Unfortunately, this client doesn't have a conflict management database, or any other conflict management tools/procedures, so I think we might have some issues in pilot. Have to see how this one works out.
Got Univeral Extractor to extract the MSI and CAB file (no idea why it didn't work the other day). Have depolyed this pre-req and then followed up with the application install.
Works a treat on a machine install, is giving an error on a file as a user install, but I'll google the issue and work it out.
Unfortunately, this client doesn't have a conflict management database, or any other conflict management tools/procedures, so I think we might have some issues in pilot. Have to see how this one works out.
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.