cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Tim_Mayert
Level 9

custom actions just refusing to work!!!

We have a couple custom actions that were first to just trigger some batch files, but they just did not seem to work.

I use a launch executable and I have it set for the following:
Working Directory: SystemFolder
Filename & Command line: "[SystemFolder]cmd.exe" /c "[LR_TC_BIN]sat-create-portal-db.bat"

Now I was thinking that this was not working because a file required by the bat file had to be in the same folder as the bat file, but since the working folder in this case is the SystemFolder it probably could not find the file and therefore failed.

So I took the contents of the bat file and created a custom actions from them as all it is doing in launching a PostgreSQL .exe file with command line.

So I use system search to locate the PostgresSQ .exe and then call a custom action that uses the Executable Property custom actions. So it looks like the following:
Executable Property: POSTGRESQL_BIN_DIR
Command Line

And the result of this custom action is:

Action 7:05:49: Create_Portal_Database_builtin_test.
MSI (s) (F0:50) [07:05:49:750]: Executing op: CustomActionSchedule(Action=Create_Portal_Database_builtin_test,ActionType=3122,Source=C:\Program Files\PostgreSQL\8.4\Bin\,Target="C:\Program Files\PostgreSQL\8.4\Bin\psql.exe" -U postgres < "C:\Program Files\SMART Technologies\SMART Administrative Tools\liferay-portal-6.0.1\tomcat-6.0.26\bin\sat-prep-portal-db.sql",)

MSI (s) (F0:50) [07:05:49:750]: Note: 1: 1721 2:
Create_Portal_Database_builtin_test 3: C:\Program Files\PostgreSQL\8.4\Bin\ 4: "C:\Program Files\PostgreSQL\8.4\Bin\psql.exe" -U postgres < "C:\Program Files\SMART Technologies\SMART Administrative Tools\liferay-portal-6.0.1\tomcat-6.0.26\bin\sat-prep-portal-db.sql"

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: Create_Portal_Database_builtin_test, location: C:\Program Files\PostgreSQL\8.4\Bin\, command: "C:\Program Files\PostgreSQL\8.4\Bin\psql.exe" -U postgres < "C:\Program Files\SMART Technologies\SMART Administrative Tools\liferay-portal-6.0.1\tomcat-6.0.26\bin\sat-prep-portal-db.sql"

So does anyone have any clues as to why these custom actions are failing, where as if I run them from the command line they work as expected?

Thanks for any help.
Labels (1)
0 Kudos
(3) Replies
Videstra
Level 7

My immediate reaction is that the quotes are probably causing you a problem. I think enclosing the [SystemFolder] inside the quotes is sending the litteral "[SystemFolder]" rather then the value of the variable [SystemFolder]...

"[SystemFolder]cmd.exe" /c "[LR_TC_BIN]sat-create-portal-db.bat"

Should be

[SystemFolder]cmd.exe /c [LR_TC_BIN]sat-create-portal-db.bat
0 Kudos
rguggisberg
Level 13

Tim,
I believe that you have the string quoted correctly as I am doing the same thing.
What OS are you running on? If you are running on Vista, Windows 7, or 2008 Server you will probably need to set 'In-Script Processing' to 'Deferred Execution in System Context' to avoid permissions problems.
0 Kudos
Tim_Mayert
Level 9

Thanks for the replys.

Yes I was calling the .bat files in Deferred in System Context, but after looking into these bat files I fould that they they were trying to find files relative to the location of the bat file and these were what was failing as this custom action was setting the working folder to be the system32 folder.

So I updated the bat file to cd to the location where the bat file resides and then it seems to work correctly now.

Thanks,
0 Kudos