Jump to content

This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.

[q] how to create a custom action to exec batch fi

2 replies to this topic


  • Members
  • 2 posts

Posted 10 June 2003 - 23:24

Hi, All,

I'm trying to create a custom action to execute the batch files using vsutdion professional 2002.

I added ** cmd.exe /C "c:\mypath\mybatch.bat" ** as the argument as the custom action. And put the custom action after commit.

However, msi gave an error when execute this custom action.

I've also tried cmd.exe as the name of custom action, and the rest as part of the arguments. Still, msi gave an error.

Here is the error given by msi in the verbose log:

MSI (s) (60:44): Executing op: ActionStart(Name=_9D1343CC_32B2_41F1_B177_9F9B0DE650E1,,)
Action 18:13:16: _9D1343CC_32B2_41F1_B177_9F9B0DE650E1.
MSI (s) (60:44): Executing op: CustomActionSchedule(Action=_9D1343CC_32B2_41F1_B177_9F9B0DE650E1,ActionType=1538,Source=BinaryData,Target=cmd.exe /C C:\Program Files\Dimensional Photonics\FringeMaster\AFI4000\Bin\set_permission.bat,)
MSI (s) (60:44): Executing op: ActionStart(Name=RegisterProduct,Description=Registering product,Template=)
Action 18:13:16: RegisterProduct. Registering product

here is the error given in the Event Log:
Product: FringeMaster -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action _9D1343CC_32B2_41F1_B177_9F9B0DE650E1, location: C:\WINDOWS\Installer\MSI295C.tmp, command: /C C:\Program Files\Dimensional Photonics\FringeMaster\AFI4000\Bin\set_permission.bat

For more information, see Help and Support Center at http://go.microsoft....link/events.asp.

Thanks for any help



  • Members
  • 2 posts

Posted 11 June 2003 - 17:28

the error message is telling you that the batch file did not execute correctly. There appears to be nothing wrong with the MSI.
Does the batch file have dependencies e.g. start-in folder?


  • Full Members
  • 85 posts

Posted 12 June 2003 - 00:18

The batch file is running however it is returning a non-zero return code and your custom action is not configured to ignore this (which I wouldn't do). I'd fix your batch file to return a non-zero return code only on error.
The easiest way to do this is to structure your batch file to run a command successfully when OK and one which will always fail on error... There is the "ERRORLEVEL" environment variable but can't remember if this worked for me or not and you might need to rename the batch file to ".cmd".
Dennis Bareis (dbareis@No.Spam.gmail.com)
Free MSI update/creation tool (MAKEMSI):