This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- .bat files problem
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
01:35 AM
.bat files problem
hi ,i'am trying to execute a *.bat file in installshield 2009,but don't know how....
need your help
thank you very much in advance
need your help
thank you very much in advance
(6) Replies
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
02:17 AM
LaunchAppAndWait(*.bat","",WAIT);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
03:18 AM
thanks
i know using the function launchappandwait(), do i have to endit the scripts?
but in installshield2009 i can't find the entrance to the scripts
do u know how?
i know using the function launchappandwait(), do i have to endit the scripts?
but in installshield2009 i can't find the entrance to the scripts
do u know how?
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
09:13 AM
IS2009 support LaunchAppandwait(). You don’t have to edit it.
If you can’t use *.bat directly, try this,
LaunchAppAndWaitInitStartupInfo ( );
LaunchApplication( SystemFolder^"cmd.exe", "/c fullpath\\yourfile.bat","",SW_HIDE,15000, LAAW_OPTION_WAIT );
if (LAAW_PARAMETERS.nLaunchResult!=0) then
Messagebox (“error”, SEVERE);
endif;
SW_HIDE hides the CMD prompt. I successfully used this script in my project.
If you can’t use *.bat directly, try this,
LaunchAppAndWaitInitStartupInfo ( );
LaunchApplication( SystemFolder^"cmd.exe", "/c fullpath\\yourfile.bat","",SW_HIDE,15000, LAAW_OPTION_WAIT );
if (LAAW_PARAMETERS.nLaunchResult!=0) then
Messagebox (“error”, SEVERE);
endif;
SW_HIDE hides the CMD prompt. I successfully used this script in my project.
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
09:24 AM
If you use Basic MSI,you can try CA 50. I have given the entries from CA table; exepath is a property, value of the property is cmd.exe. [#myname.bat] is first column in file table i.e. file. It will return the file name with fullpath.
Action Type Source Target
CA4 50 exepath /c call "[#myname.bat]"
Action Type Source Target
CA4 50 exepath /c call "[#myname.bat]"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
09:46 PM
thanks for your help!
am a beginner ,now i already know how to use launchappandwait(),but dont know the way to add my .bat file to my project
i mean,in the CustomActions view of IS2009,it only show adding "New DLL,New EXE,New VBScript"
how will i do now?
thanks in advance 🙂
am a beginner ,now i already know how to use launchappandwait(),but dont know the way to add my .bat file to my project
i mean,in the CustomActions view of IS2009,it only show adding "New DLL,New EXE,New VBScript"
how will i do now?
thanks in advance 🙂
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 09, 2009
10:24 PM
I thought you are going to install *.bat file. Now it looks like you want to run *.bat which is not part of the installation.
There are multiple ways; I used the one of the method below;
1. Add the *.bat in “support files” which is under “behavior and logic”
2. Create an IS custom action;
MsiGetProperty(hMSI, "SUPPORTDIR", szSupportDir, nLength);
szpath = szSupportDir^"Your.bat";
LongPathToQuote(szpath,TRUE);
LaunchApplication( SystemFolder^"cmd.exe", "/c "+szpath,"", SW_HIDE,5000, LAAW_OPTION_WAIT );
For topics like Creating CA…etc... IS help covers a lot.
There are multiple ways; I used the one of the method below;
1. Add the *.bat in “support files” which is under “behavior and logic”
2. Create an IS custom action;
MsiGetProperty(hMSI, "SUPPORTDIR", szSupportDir, nLength);
szpath = szSupportDir^"Your.bat";
LongPathToQuote(szpath,TRUE);
LaunchApplication( SystemFolder^"cmd.exe", "/c "+szpath,"", SW_HIDE,5000, LAAW_OPTION_WAIT );
For topics like Creating CA…etc... IS help covers a lot.