aboutsummaryrefslogtreecommitdiff
path: root/src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs')
-rw-r--r--src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs b/src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs
index 6891f8da..54afc2cf 100644
--- a/src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs
+++ b/src/test/msi/TestData/CustomActionTests/TestCA/CustomAction.cs
@@ -4,7 +4,9 @@ namespace WixToolsetTest.TestCA
4{ 4{
5 using System; 5 using System;
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.IO;
7 using System.Linq; 8 using System.Linq;
9 using System.Text;
8 using WixToolset.Dtf.WindowsInstaller; 10 using WixToolset.Dtf.WindowsInstaller;
9 11
10 public class CustomActions 12 public class CustomActions
@@ -14,6 +16,31 @@ namespace WixToolsetTest.TestCA
14 { 16 {
15 session.Log("Begin ImmediateCA"); 17 session.Log("Begin ImmediateCA");
16 18
19 var path = Path.Combine(Path.GetTempPath(), "ImmediateCA.txt");
20 WriteNow(path);
21
22 return ActionResult.Success;
23 }
24
25 [CustomAction]
26 public static ActionResult ExecuteImmediateCA(Session session)
27 {
28 session.Log("Begin ExecuteImmediateCA");
29
30 var path = Path.Combine(Path.GetTempPath(), "ExecuteImmediateCA.txt");
31 WriteNow(path);
32
33 return ActionResult.Success;
34 }
35
36 [CustomAction]
37 public static ActionResult ImpersonatedDeferredCA(Session session)
38 {
39 session.Log("Begin ImpersonatedDeferredCA");
40
41 var path = Path.Combine(Path.GetTempPath(), "ImpersonatedDeferredCA.txt");
42 WriteNow(path);
43
17 return ActionResult.Success; 44 return ActionResult.Success;
18 } 45 }
19 46
@@ -22,7 +49,18 @@ namespace WixToolsetTest.TestCA
22 { 49 {
23 session.Log("Begin DeferredCA"); 50 session.Log("Begin DeferredCA");
24 51
52 WriteNow(@"C:\Windows\Installer\DeferredCA.txt");
53
25 return ActionResult.Success; 54 return ActionResult.Success;
26 } 55 }
56
57 private static void WriteNow(string path)
58 {
59 using (var file = File.Create(path))
60 {
61 var now = Encoding.UTF8.GetBytes(DateTime.Now.ToString("o"));
62 file.Write(now, 0, now.Length);
63 }
64 }
27 } 65 }
28} 66}