| 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 | |
| 3 | namespace 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 | } |