summaryrefslogtreecommitdiff
path: root/src/tools/heat/DirectoryHelper.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-08-16 18:11:54 -0700
committerRob Mensching <rob@firegiant.com>2022-08-16 23:21:06 -0700
commit94e722baab4e848a615812a45fecc8322335d1f0 (patch)
tree8b1124ba75f3b1fc55981113660407c903d45543 /src/tools/heat/DirectoryHelper.cs
parentda5cc586114e537461b239a882c5bbea470d812d (diff)
downloadwix-94e722baab4e848a615812a45fecc8322335d1f0.tar.gz
wix-94e722baab4e848a615812a45fecc8322335d1f0.tar.bz2
wix-94e722baab4e848a615812a45fecc8322335d1f0.zip
Update heat to use StandardDirectory element
Fixes 6631
Diffstat (limited to 'src/tools/heat/DirectoryHelper.cs')
-rw-r--r--src/tools/heat/DirectoryHelper.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/tools/heat/DirectoryHelper.cs b/src/tools/heat/DirectoryHelper.cs
new file mode 100644
index 00000000..61a3d664
--- /dev/null
+++ b/src/tools/heat/DirectoryHelper.cs
@@ -0,0 +1,42 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Harvesters
4{
5 using WixToolset.Data.WindowsInstaller;
6 using Wix = WixToolset.Harvesters.Serialize;
7
8 internal static class DirectoryHelper
9 {
10 public static Wix.DirectoryBase CreateDirectory(string id)
11 {
12 if (WindowsInstallerStandard.IsStandardDirectory(id))
13 {
14 return new Wix.StandardDirectory()
15 {
16 Id = id
17 };
18 }
19
20 return new Wix.Directory()
21 {
22 Id = id
23 };
24 }
25
26 public static Wix.DirectoryBase CreateDirectoryReference(string id)
27 {
28 if (WindowsInstallerStandard.IsStandardDirectory(id))
29 {
30 return new Wix.StandardDirectory()
31 {
32 Id = id
33 };
34 }
35
36 return new Wix.DirectoryRef()
37 {
38 Id = id
39 };
40 }
41 }
42}