mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Minor fixes for msbuild task
This commit is contained in:
@@ -83,7 +83,8 @@ public class PackTask : MSBuildAsyncTask
|
||||
{
|
||||
//System.Diagnostics.Debugger.Launch();
|
||||
HelperFile.ClearSearchPaths();
|
||||
HelperFile.AddSearchPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..", "..", "vendor");
|
||||
var searchPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "..", "..", "vendor"));
|
||||
HelperFile.AddSearchPath(searchPath);
|
||||
|
||||
if (VelopackRuntimeInfo.IsWindows) {
|
||||
var options = this.ToWinPackOptions();
|
||||
|
||||
@@ -184,6 +184,10 @@ public class WindowsPackCommandRunner : PackageBuilder<WindowsPackOptions>
|
||||
|
||||
private void CreateExecutableStubForExe(string exeToCopy, string targetStubPath)
|
||||
{
|
||||
if (!File.Exists(exeToCopy)) {
|
||||
throw new ArgumentException($"Cannot create StubExecutable for '{exeToCopy}' because it does not exist.");
|
||||
}
|
||||
|
||||
try {
|
||||
Utility.Retry(() => File.Copy(HelperFile.StubExecutablePath, targetStubPath, true));
|
||||
Utility.Retry(() => {
|
||||
|
||||
@@ -115,7 +115,7 @@ public static class HelperFile
|
||||
|
||||
var result = files.FirstOrDefault();
|
||||
if (result == null && throwWhenNotFound)
|
||||
throw new Exception($"Could not find '{toFind}'.");
|
||||
throw new Exception($"HelperFile could not find '{toFind}'.");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public abstract class PackageBuilder<T> : ICommand<T>
|
||||
throw new UserInfoException($"To build packages for {SupportedTargetOs.GetOsLongName()}, " +
|
||||
$"the target rid must be {SupportedTargetOs} (actually was {options.TargetRuntime?.BaseRID}).");
|
||||
|
||||
Log.Info("Beginning to package release.");
|
||||
Log.Info($"Beginning to package Velopack release {options.PackVersion}.");
|
||||
Log.Info("Releases Directory: " + options.ReleaseDir.FullName);
|
||||
|
||||
var releaseDir = options.ReleaseDir;
|
||||
@@ -86,8 +86,8 @@ public abstract class PackageBuilder<T> : ICommand<T>
|
||||
);
|
||||
}
|
||||
|
||||
MainExeName = mainExeName;
|
||||
MainExePath = mainExePath;
|
||||
MainExeName = Path.GetFileName(mainExePath);
|
||||
|
||||
using var _1 = Utility.GetTempDirectory(out var pkgTempDir);
|
||||
TempDir = new DirectoryInfo(pkgTempDir);
|
||||
|
||||
Reference in New Issue
Block a user