Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: installer/src/installer-lib/test/custom-action-fail.cpp

Issue 6202981292703744: Whole installer (Closed)
Patch Set: Created June 24, 2014, 7:27 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: installer/src/installer-lib/test/custom-action-fail.cpp
===================================================================
new file mode 100644
--- /dev/null
+++ b/installer/src/installer-lib/test/custom-action-fail.cpp
@@ -0,0 +1,29 @@
+/**
+ * \file close_application.cpp
+ */
+
+#include "session.h"
+
+//-------------------------------------------------------
+// Fail
+//-------------------------------------------------------
+/**
+ * A custom action that always and immediately fails.
+ * Use during testing to ensure that the installer terminates.
+ *
+ * \param[in] session_handle
+ * Windows installer session handle
+ *
+ * \return
+ * An integer interpreted as a custom action return value.
+ *
+ * \sa
+ * - MSDN [Custom Action Return Values](http://msdn.microsoft.com/en-us/library/aa368072%28v=vs.85%29.aspx)
+ */
+extern "C" UINT __stdcall
+fail( MSIHANDLE session_handle )
+{
+ // Instantiate the session object in order to get begin/end log entries.
+ Immediate_Session session( session_handle, "fail" ) ;
+ return ERROR_INSTALL_FAILURE ;
+}

Powered by Google App Engine
This is Rietveld