forked from activescott/lessmsi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
751 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ | |
// Authors: | ||
// Scott Willeke ([email protected]) | ||
// | ||
|
||
using System; | ||
using System.Collections; | ||
using System.IO; | ||
using Microsoft.Tools.WindowsInstallerXml.Msi; | ||
|
@@ -196,7 +198,12 @@ The directory names in this column may be formatted as short filename | long fil | |
ArrayList rootDirectoriesList = new ArrayList(); | ||
foreach (MsiDirectory dir in directoriesByDirID.Values) | ||
{ | ||
if (dir.DirectoryParent == null || dir.DirectoryParent.Length == 0) | ||
// If the value of the Directory_Parent column is null... | ||
var isRoot = string.IsNullOrEmpty(dir.DirectoryParent); | ||
// ...or is equal to the Directory column, the DefaultDir column specifies the name of a root source directory. - https://msdn.microsoft.com/en-us/library/windows/desktop/aa368295(v=vs.85).aspx | ||
if (!isRoot && string.Equals(dir.Directory, dir.DirectoryParent, StringComparison.InvariantCulture)) | ||
isRoot = true; | ||
if (isRoot) | ||
{ | ||
rootDirectoriesList.Add(dir); | ||
continue; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Permission is hereby granted, free of charge, to any person obtaining | ||
// a copy of this software and associated documentation files (the | ||
// "Software"), to deal in the Software without restriction, including | ||
// without limitation the rights to use, copy, modify, merge, publish, | ||
// distribute, sublicense, and/or sell copies of the Software, and to | ||
// permit persons to whom the Software is furnished to do so, subject to | ||
// the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be | ||
// included in all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
// | ||
// Copyright (c) 2017 Scott Willeke (http://scott.willeke.com) | ||
// | ||
// Authors: | ||
// Scott Willeke ([email protected]) | ||
// | ||
using System.Runtime.InteropServices; | ||
|
||
namespace LessMsi.OleStorage | ||
{ | ||
internal static class NativeMethods | ||
{ | ||
[DllImport("ole32.dll")] | ||
internal static extern int StgIsStorageFile([MarshalAs(UnmanagedType.LPWStr)]string pwcsName); | ||
|
||
} | ||
} |
Oops, something went wrong.