Background
OEMS, Sys Admins etc. often use OPK or WAIK for mass installation. During this they often ship some pre-installed applications. The installations of such applications happen when Windows installation enters in Audit Mode
Question
Using c#, how do I detect that Windows is currently in Audit Mode?
You need to check the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\Statefor something other than
IMAGE_STATE_COMPLETEHKEY_LOCAL_MACHINE\System\SetupforAuditInProgressEDIT – as per comment:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBEcould provide some information in this regard too…For details see see