When run manually, the working directory doesn't make any difference to the script itself, and as long as the registry key exists and points to the correct file, this script works perfectly on multiple computers (Win 7, Win 8.1, Win 10). My setup package bundles another custom setup which is used to configure the base folder structure (amongst other things) for multiple other packages, so I've left this bundled setup to extract my new script file, simply locating and executing it from the wrapping setup.
My custom actions are configured as "Launch File" with the following settings:
- File to launch: [APPDIR]scripts\scheduler-update.cmd
- Command line: -u "key" "value"
- Working directory: %TEMP%
- (on) Hide program's window
- (on) Run as Administrator
- (on) Wait for custom action to finish before proceeding
- Before "Finish execution" with deferred execution time
- After "Finish execution" with immediate execution time
- Not setting a "Working directory"
Code: Select all
Action 11:30:29: SchedulerAddMysqlUser.
Action start 11:30:29: SchedulerAddMysqlUser.
CustomAction SchedulerAddMysqlUser returned actual error code 1 (note this may not be 100% accurate if translation happened inside sandbox)
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 SchedulerAddMysqlUser, location: C:\Windows\Installer\MSI9078.tmp, command: /RunAsAdmin /HideWindow /dir %TEMP% "C:\NortechSystems\scripts\scheduler-update.cmd" -a "mysqluser" "null"
MSI (s) (90:58) [11:30:31:256]: Product: CountIT -- 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 SchedulerAddMysqlUser, location: C:\Windows\Installer\MSI9078.tmp, command: /RunAsAdmin /HideWindow /dir %TEMP% "C:\NortechSystems\scripts\scheduler-update.cmd" -a "mysqluser" "null"
Action ended 11:30:31: SchedulerAddMysqlUser. Return value 3.
What am I doing wrong here?