Skip to content

Commit 78d028d

Browse files
committed
Updated ILMerge.bat& Post-Build Event to support .net 4.0
1 parent 8e12148 commit 78d028d

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

DynamicDiskPartitioner/DynamicDiskPartitioner.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,10 @@
3939
<ReferencePath Remove="@(ReferencePath)" Condition="'%(FileName)' == 'Utilities'" />
4040
</ItemGroup>
4141
</Target>
42+
43+
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release' And '$(TargetFramework)' != 'netcoreapp3.1'">
44+
<Exec Command="&quot;C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\mt.exe&quot; -nologo -manifest &quot;$(ProjectDir)Properties\DynamicDiskPartitioner.exe.manifest&quot; -outputresource:&quot;$(TargetPath)&quot;" />
45+
<Exec Command="&quot;$(ProjectDir)ILMerge\ILMerge.bat&quot; $(TargetFramework)" WorkingDirectory="$(ProjectDir)ILMerge" />
46+
</Target>
4247

4348
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
IF ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles%\Microsoft\ILMerge"
2+
IF NOT ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles(x86)%\Microsoft\ILMerge"
3+
set binaryPath=%CD%\..\bin\Release
4+
set outputPath=%CD%\..\bin\ILMerge
5+
IF NOT EXIST "%outputPath%" MKDIR "%outputPath%"
6+
%ilmergePath%\ilmerge /ndebug /target:winexe /out:"%outputPath%\DynamicDiskPartitioner.exe" "%binaryPath%\DynamicDiskPartitioner.exe" "%binaryPath%\Utilities.dll" "%binaryPath%\DiskAccessLibrary.dll" "%binaryPath%\DiskAccessLibrary.Win32.dll" "%binaryPath%\DiskAccessLibrary.FileSystems.Abstractions.dll"
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
set binaryPath=%CD%\..\bin\Release
2-
set outputPath=%CD%\..\bin\ILMerge
3-
IF NOT EXIST "%outputPath%" MKDIR "%outputPath%"
41
IF ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles%\Microsoft\ILMerge"
52
IF NOT ["%programfiles(x86)%"]==[""] SET ilmergePath="%programfiles(x86)%\Microsoft\ILMerge"
6-
%ilmergePath%\ilmerge /ndebug /target:winexe /out:"%outputPath%\DynamicDiskPartitioner.exe" "%binaryPath%\DynamicDiskPartitioner.exe" "%binaryPath%\Utilities.dll" "%binaryPath%\DiskAccessLibrary.dll" "%binaryPath%\DiskAccessLibrary.Win32.dll" "%binaryPath%\DiskAccessLibrary.FileSystems.Abstractions.dll"
3+
4+
set TargetFramework=%1
5+
if %TargetFramework%==net20 set TargetPlaform=2.0
6+
if %TargetFramework%==net40 set TargetPlaform=4.0
7+
set binaryPath=%CD%\..\bin\Release\%TargetFramework%
8+
set outputPath=%CD%\..\bin\ILMerge\%TargetFramework%
9+
IF NOT EXIST "%outputPath%" MKDIR "%outputPath%"
10+
%ilmergePath%\ilmerge /targetplatform=%TargetPlaform% /ndebug /target:winexe /out:"%outputPath%\DynamicDiskPartitioner.exe" "%binaryPath%\DynamicDiskPartitioner.exe" "%binaryPath%\Utilities.dll" "%binaryPath%\DiskAccessLibrary.dll" "%binaryPath%\DiskAccessLibrary.Win32.dll" "%binaryPath%\DiskAccessLibrary.FileSystems.Abstractions.dll"

0 commit comments

Comments
 (0)