Skip to content

Commit c00794c

Browse files
author
Derek Gray
committed
Merge branch 'hotfix/embedded-path'
2 parents 757d1be + a24251c commit c00794c

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

TuesPechkin.TestFormsApp/MainForm.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ public partial class MainForm : Form
1414
new StandardConverter(
1515
new PdfToolset(
1616
new Win64EmbeddedDeployment(
17-
new StaticDeployment(
18-
Path.Combine(
19-
Path.GetTempPath(),
20-
Guid.NewGuid().ToString(),
21-
"wkhtmltox.dll")))));
17+
new TempFolderDeployment())));
2218

2319
private HtmlToPdfDocument Document = new HtmlToPdfDocument
2420
{

TuesPechkin/EmbeddedDeployment.cs

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@ public abstract class EmbeddedDeployment : IDeployment
1010
{
1111
public virtual string Path
1212
{
13-
get
13+
get
1414
{
15-
if (!deployed)
16-
{
17-
foreach (var nameAndContents in GetContents())
18-
{
19-
var filename = System.IO.Path.Combine(
20-
physical.Path,
21-
nameAndContents.Key);
15+
var path = System.IO.Path.Combine(physical.Path, PathModifier ?? string.Empty);
2216

23-
var path = System.IO.Path.GetDirectoryName(filename);
17+
if (!deployed)
18+
{
19+
if (!Directory.Exists(path))
20+
{
21+
Directory.CreateDirectory(path);
22+
}
2423

25-
if (!Directory.Exists(path))
26-
{
27-
Directory.CreateDirectory(path);
28-
}
24+
foreach (var nameAndContents in GetContents())
25+
{
26+
var filename = System.IO.Path.Combine(path, nameAndContents.Key);
2927

3028
if (!File.Exists(filename))
3129
{
@@ -36,10 +34,20 @@ public virtual string Path
3634
deployed = true;
3735
}
3836

37+
// In 2.2.0 needs to return path
3938
return physical.Path;
4039
}
4140
}
4241

42+
// Embedded deployments need to override this instead in 2.2.0
43+
protected virtual string PathModifier
44+
{
45+
get
46+
{
47+
return this.GetType().Assembly.GetName().Version.ToString();
48+
}
49+
}
50+
4351
public EmbeddedDeployment(IDeployment physical)
4452
{
4553
if (physical == null)

TuesPechkin/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[assembly: AssemblyDescription(".NET wrapper for wkhtmltopdf; supports 32-bit, 64-bit, multi-threaded and IIS environments.")]
77
[assembly: AssemblyProduct("TuesPechkin")]
88
[assembly: AssemblyCopyright("Copyright 2014 Derek Gray")]
9-
[assembly: AssemblyVersion("2.1.0")]
9+
[assembly: AssemblyVersion("2.1.1")]
1010

1111
[assembly: ComVisible(false)]
1212
[assembly: Guid("11f63696-7105-436d-9ec6-2fee54c40b11")]

TuesPechkin/TuesPechkin.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
<Compile Include="Document\WebSettings.cs" />
8888
<Compile Include="Util\WinApiHelper.cs" />
8989
</ItemGroup>
90+
<ItemGroup>
91+
<None Include="TuesPechkin.nuspec" />
92+
</ItemGroup>
9093
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9194
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
9295
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

TuesPechkin/TuesPechkin.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package>
33
<metadata>
44
<id>TuesPechkin</id>
5-
<version>2.1.0</version>
5+
<version>2.1.1</version>
66
<title>TuesPechkin</title>
77
<authors>tuespetre</authors>
88
<owners>tuespetre</owners>

0 commit comments

Comments
 (0)