<downloadSharpZipLibPropsImported>true</downloadSharpZipLibPropsImported>\r
</PropertyGroup>\r
\r
+ <PropertyGroup>\r
+ <SharpZipLibVersion Condition=" '$(SharpZipLibVersion)' == '' ">1.1.0</SharpZipLibVersion>\r
+ <SharpZipLibDir>$(BaseDir)libs\SharpZipLib.$(SharpZipLibVersion)</SharpZipLibDir>\r
+ <SharpZipLibCADir>$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264</SharpZipLibCADir>\r
+ </PropertyGroup>\r
+\r
<!--\r
Download Target.\r
Name must be unique.\r
\r
<Target Name="SharpZipLibDownloadTarget" BeforeTargets="Build" DependsOnTargets="7za">\r
<DownloadPackageTask\r
- package="http://files.freeswitch.org/downloads/libs/ICSharpCode.SharpZipLib.dll.bz2"\r
- expectfileordirectory="$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\ICSharpCode.SharpZipLib.dll"\r
- outputfolder=""\r
- outputfilename=""\r
- extractto="$(BaseDir)w32\Setup\CustomActions\Setup.CA.DownloadOpenH264\"\r
+ package="https://github.com/icsharpcode/SharpZipLib/releases/download/v$(SharpZipLibVersion)/SharpZipLib.$(SharpZipLibVersion).nupkg"\r
+ expectfileordirectory="$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll"\r
+ outputfolder="$(BaseDir)libs\"\r
+ outputfilename="SharpZipLib.$(SharpZipLibVersion).nupkg"\r
+ extractto="$(SharpZipLibDir)"\r
archivecontains="binary"\r
/>\r
+ <!-- Place the net45 build where the custom action's <HintPath> expects it. -->\r
+ <Copy Condition="!Exists('$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll')"\r
+ SourceFiles="$(SharpZipLibDir)\lib\net45\ICSharpCode.SharpZipLib.dll"\r
+ DestinationFiles="$(SharpZipLibCADir)\ICSharpCode.SharpZipLib.dll"\r
+ />\r
</Target>\r
\r
</Project>\r
<extractto />
<moveafter />
<archivecontains />
- </ParameterGroup>
+ <arctool />
+ </ParameterGroup>
<Task>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.Build.Framework" />
public string extractto { get; set; }
public string moveafter { get; set; }
public string archivecontains { get; set; }
+ public string arctool { get; set; }
internal static bool FileOrDirectoryExists(string name)
{
private void Extract(string filename, string extracttofolder)
{
- string arctool = Path.Combine(new string[] { basedir, "libs", "win32", "7za1701.exe" });
+ // Use the caller-supplied extraction tool when set (the 7za bootstrap
+ // passes 7zr.exe to unpack the full 7za.exe out of the "extra" package);
+ // otherwise fall back to that bootstrapped 7za.exe for every other package.
+ string tool = (arctool != null && arctool.Trim() != "")
+ ? arctool
+ : Path.Combine(new string[] { basedir, "libs", "win32", "7za", "7za.exe" });
string args = " x \"" + filename + "\" -y -o\"" + extracttofolder + "\"";
Log.LogMessage(MessageImportance.High,
- "arctool : " + arctool);
+ "arctool : " + tool);
Log.LogMessage(MessageImportance.High,
"args : " + args);
Log.LogMessage(MessageImportance.High,
- "WorkingDirectory : " + Path.GetDirectoryName(arctool));
+ "WorkingDirectory : " + Path.GetDirectoryName(tool));
var proc = new Process
{
StartInfo = new ProcessStartInfo
{
- FileName = arctool,
+ FileName = tool,
Arguments = args,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
- WorkingDirectory = Path.GetDirectoryName(arctool)
+ WorkingDirectory = Path.GetDirectoryName(tool)
}
};
</Task>
</UsingTask>
- <Target Name="7za" BeforeTargets="Build">
- <DownloadPackageTask
- package="http://files.freeswitch.org/downloads/win32/7za1701.exe"
- expectfileordirectory="$(BaseDir)libs/win32/7za1701.exe"
- outputfolder="$(BaseDir)libs/win32/"
- outputfilename="7za1701.exe"
+ <PropertyGroup>
+ <SevenZipVersion Condition=" '$(SevenZipVersion)' == '' ">26.02</SevenZipVersion>
+ <SevenZipBaseUrl Condition=" '$(SevenZipBaseUrl)' == '' ">https://github.com/ip7z/7zip/releases/download/$(SevenZipVersion)</SevenZipBaseUrl>
+ <SevenZipExtra Condition=" '$(SevenZipExtra)' == '' ">7z$(SevenZipVersion.Replace('.',''))-extra</SevenZipExtra>
+ </PropertyGroup>
+
+ <Target Name="7za" BeforeTargets="Build">
+ <!-- Step 1: download 7zr.exe. As an .exe it is stored as-is, not extracted. -->
+ <DownloadPackageTask
+ package="$(SevenZipBaseUrl)/7zr.exe"
+ expectfileordirectory="$(BaseDir)libs/win32/7zr.exe"
+ outputfolder="$(BaseDir)libs/win32/"
+ outputfilename="7zr.exe"
extractto=""
/>
- </Target>
+ <!-- Step 2: download the extra package and unpack the full 7za.exe from it
+ with 7zr.exe (the default 7za.exe does not exist yet at this point). -->
+ <DownloadPackageTask
+ package="$(SevenZipBaseUrl)/$(SevenZipExtra).7z"
+ expectfileordirectory="$(BaseDir)libs/win32/7za/7za.exe"
+ outputfolder="$(BaseDir)libs/win32/"
+ outputfilename="$(SevenZipExtra).7z"
+ extractto="$(BaseDir)libs/win32/7za"
+ archivecontains="binary"
+ arctool="$(BaseDir)libs/win32/7zr.exe"
+ />
+ </Target>
<PropertyGroup>
<downloadpackagetask_Imported>true</downloadpackagetask_Imported>