Skip to content

Commit

Permalink
Merge pull request #9 from UiPath/fix/stub
Browse files Browse the repository at this point in the history
Update: Ensure we don't create stub for generated stub executables
  • Loading branch information
Obi-Dann authored Dec 7, 2020
2 parents f917372 + e44d14f commit 8f07707
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ local.properties

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
.vs

# User-specific files
*.suo
Expand Down
9 changes: 8 additions & 1 deletion src/Squirrel/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo ro
{
Contract.Requires(rootPath != null);

return rootPath.EnumerateFiles("*", SearchOption.AllDirectories);
return rootPath.GetAllFilesRecursively("*");
}

public static IEnumerable<FileInfo> GetAllFilesRecursively(this DirectoryInfo rootPath, string searchPattern)
{
Contract.Requires(rootPath != null);

return rootPath.EnumerateFiles(searchPattern, SearchOption.AllDirectories);
}

public static IEnumerable<string> GetAllFilePathsRecursively(string rootPath)
Expand Down
15 changes: 8 additions & 7 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,14 @@ public void Releasify(string package, string targetDir = null, string packagesDi

var rp = new ReleasePackage(file.FullName);
rp.CreateReleasePackage(Path.Combine(di.FullName, rp.SuggestedReleaseFileName), packagesDir, contentsPostProcessHook: pkgPath => {
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
.Where(x => x.Name.ToLowerInvariant().EndsWith(".exe"))
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();
new DirectoryInfo(pkgPath)
.GetAllFilesRecursively("*.exe")
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
.ToList()
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();
if (signingOpts == null) return;
Expand Down

0 comments on commit 8f07707

Please sign in to comment.