Skip to content

Commit

Permalink
Merge branch 'hotfix/embedded-path'
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Gray committed Jan 21, 2015
2 parents 757d1be + a24251c commit c00794c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
6 changes: 1 addition & 5 deletions TuesPechkin.TestFormsApp/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public partial class MainForm : Form
new StandardConverter(
new PdfToolset(
new Win64EmbeddedDeployment(
new StaticDeployment(
Path.Combine(
Path.GetTempPath(),
Guid.NewGuid().ToString(),
"wkhtmltox.dll")))));
new TempFolderDeployment())));

private HtmlToPdfDocument Document = new HtmlToPdfDocument
{
Expand Down
34 changes: 21 additions & 13 deletions TuesPechkin/EmbeddedDeployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ public abstract class EmbeddedDeployment : IDeployment
{
public virtual string Path
{
get
get
{
if (!deployed)
{
foreach (var nameAndContents in GetContents())
{
var filename = System.IO.Path.Combine(
physical.Path,
nameAndContents.Key);
var path = System.IO.Path.Combine(physical.Path, PathModifier ?? string.Empty);

var path = System.IO.Path.GetDirectoryName(filename);
if (!deployed)
{
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}

if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
foreach (var nameAndContents in GetContents())
{
var filename = System.IO.Path.Combine(path, nameAndContents.Key);

if (!File.Exists(filename))
{
Expand All @@ -36,10 +34,20 @@ public virtual string Path
deployed = true;
}

// In 2.2.0 needs to return path
return physical.Path;
}
}

// Embedded deployments need to override this instead in 2.2.0
protected virtual string PathModifier
{
get
{
return this.GetType().Assembly.GetName().Version.ToString();
}
}

public EmbeddedDeployment(IDeployment physical)
{
if (physical == null)
Expand Down
2 changes: 1 addition & 1 deletion TuesPechkin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[assembly: AssemblyDescription(".NET wrapper for wkhtmltopdf; supports 32-bit, 64-bit, multi-threaded and IIS environments.")]
[assembly: AssemblyProduct("TuesPechkin")]
[assembly: AssemblyCopyright("Copyright 2014 Derek Gray")]
[assembly: AssemblyVersion("2.1.0")]
[assembly: AssemblyVersion("2.1.1")]

[assembly: ComVisible(false)]
[assembly: Guid("11f63696-7105-436d-9ec6-2fee54c40b11")]
3 changes: 3 additions & 0 deletions TuesPechkin/TuesPechkin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
<Compile Include="Document\WebSettings.cs" />
<Compile Include="Util\WinApiHelper.cs" />
</ItemGroup>
<ItemGroup>
<None Include="TuesPechkin.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
2 changes: 1 addition & 1 deletion TuesPechkin/TuesPechkin.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>TuesPechkin</id>
<version>2.1.0</version>
<version>2.1.1</version>
<title>TuesPechkin</title>
<authors>tuespetre</authors>
<owners>tuespetre</owners>
Expand Down

0 comments on commit c00794c

Please sign in to comment.