- 1 year ago
Wix installer custom action for running dism failing
If you are experiencing issues with a WiX custom action that executes the dism
command, there are a few things you can check and troubleshoot:
Ensure that the
dism
command is available on the target machine: Make sure that thedism.exe
executable is installed and accessible on the machine where you are running the WiX installer. You can verify this by manually executing thedism
command from a command prompt.Specify the full path to the
dism
executable: In your WiX custom action, make sure to specify the full path to thedism.exe
executable, including the file extension (.exe
). For example:xml<CustomAction Id="RunDism" Execute="deferred" Return="ignore" Impersonate="no" ExeCommand=""[SystemFolder]dism.exe" /somecommand" />
Check the execution context and permissions: Ensure that the custom action is running with the appropriate permissions to execute the
dism
command. Depending on the operation you are performing withdism
, it may require administrative privileges. Make sure that the custom action is configured to run with elevated privileges, if necessary.Capture and inspect the custom action log: Enable logging for your custom action to capture any error messages or additional information that may help troubleshoot the issue. You can add the
MSILogFile
property to your command line or set theMsiLogging
property to a specific log level to get more detailed logs.For example, you can set
MSILogFile
property:bashmsiexec /i MyInstaller.msi /l*v install.log
Or set
MsiLogging
property:bashmsiexec /i MyInstaller.msi /l*v install.log MsiLogging="voicewarmup"
Review the log file for any specific errors or warnings related to the custom action execution.
Test the
dism
command outside of the custom action: To isolate the issue, try running thedism
command manually outside of the custom action. This will help determine if the issue is specific to the custom action or if there are any other factors affecting the execution of thedism
command.
By following these steps and investigating any error messages or log files, you should be able to identify and resolve any issues with running dism
through a WiX custom action.