Skip to content

Commit 510c2f0

Browse files
committed
use LibZ.Tool to inject dll files
1 parent 1264e06 commit 510c2f0

File tree

4 files changed

+34
-57
lines changed

4 files changed

+34
-57
lines changed

FqHashForWin/FqHashForWin.csproj

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<Target Name="AfterResolveReferences">
5-
<ItemGroup>
6-
<EmbeddedResource Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Extension)' == '.dll'">
7-
<LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName>
8-
</EmbeddedResource>
9-
</ItemGroup>
10-
</Target>
114
<PropertyGroup>
125
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
136
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -21,6 +14,21 @@
2114
<WarningLevel>4</WarningLevel>
2215
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
2316
<Deterministic>true</Deterministic>
17+
<PublishUrl>publish\</PublishUrl>
18+
<Install>true</Install>
19+
<InstallFrom>Disk</InstallFrom>
20+
<UpdateEnabled>false</UpdateEnabled>
21+
<UpdateMode>Foreground</UpdateMode>
22+
<UpdateInterval>7</UpdateInterval>
23+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
24+
<UpdatePeriodically>false</UpdatePeriodically>
25+
<UpdateRequired>false</UpdateRequired>
26+
<MapFileExtensions>true</MapFileExtensions>
27+
<ApplicationRevision>0</ApplicationRevision>
28+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
29+
<IsWebBootstrapper>false</IsWebBootstrapper>
30+
<UseApplicationTrust>false</UseApplicationTrust>
31+
<BootstrapperEnabled>true</BootstrapperEnabled>
2432
</PropertyGroup>
2533
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2634
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -45,7 +53,7 @@
4553
<ApplicationIcon>sandcastle1.ico</ApplicationIcon>
4654
</PropertyGroup>
4755
<PropertyGroup>
48-
<StartupObject>FqHashForWin.Program</StartupObject>
56+
<StartupObject>FqHashForWin.App</StartupObject>
4957
</PropertyGroup>
5058
<ItemGroup>
5159
<Reference Include="ICSharpCode.SharpZipLib, Version=1.2.0.246, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
@@ -92,7 +100,6 @@
92100
</Compile>
93101
</ItemGroup>
94102
<ItemGroup>
95-
<Compile Include="Program.cs" />
96103
<Compile Include="Properties\AssemblyInfo.cs">
97104
<SubType>Code</SubType>
98105
</Compile>
@@ -122,5 +129,21 @@
122129
<ItemGroup>
123130
<Resource Include="sandcastle1.ico" />
124131
</ItemGroup>
132+
<ItemGroup>
133+
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
134+
<Visible>False</Visible>
135+
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
136+
<Install>true</Install>
137+
</BootstrapperPackage>
138+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
139+
<Visible>False</Visible>
140+
<ProductName>.NET Framework 3.5 SP1</ProductName>
141+
<Install>false</Install>
142+
</BootstrapperPackage>
143+
</ItemGroup>
125144
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
145+
<PropertyGroup>
146+
<PostBuildEvent>set LIBZ=$(SolutionDir)packages\LibZ.Tool.1.2.0.0\tools\libz.exe
147+
%25LIBZ%25 inject-dll --assembly FqHashForWin.exe --include *.dll --move</PostBuildEvent>
148+
</PropertyGroup>
126149
</Project>

FqHashForWin/MainWindow.xaml.cs

+1
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ private void BgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventA
451451
if (e.Error != null)
452452
{
453453
statusLabel1.Content = "Error";
454+
MessageBox.Show("There was an error! " + e.Error.ToString());
454455
}
455456
else
456457
{

FqHashForWin/Program.cs

-48
This file was deleted.

FqHashForWin/packages.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="LibZ.Tool" version="1.2.0.0" targetFramework="net472" />
34
<package id="SharpZipLib" version="1.2.0" targetFramework="net472" />
45
<package id="WindowsAPICodePack-Core" version="1.1.1" targetFramework="net472" />
56
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net472" />

0 commit comments

Comments
 (0)