问题描述:

When trying to debug the installation process of a msi installer using CDB as,

cdb -g -G -logo c:\log.log c:\temp\abc.msi

I get the following error saying

"Cannot execute abc.msi", Win32 error On193

"%1 is not a valid Win32 application."

Debuggee initialization failed, Win32 error On193

"%1 is not a valid Win32 application"

There are no spaces in the path to the installer either.

网友答案:

You can use Image File Execution Options (IFEO) to have the OS launch a debugger and then have the debugger launch the debuggee. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options create a key called msiexec.exe. In that new key create a REG_SZ value named Debugger and set that to <path_to_cdb> -g -G -logo c:\log.log c:\temp\abc.msi

Note: I normally use this with windbg.exe instead of cdb.exe. I think cdb.exe may need a command prompt already so try with windbg.exe or ntsd.exe.

Note2: You may want to remove the -g option so that you have a chance to set some breakpoints before execution begins.

You can find more info on IFEO in the debugger.chm help file that comes with Debugging Tools for Windows.

相关阅读:
Top