|
28 | 28 | <ApplicationIcon>icons\gzip.ico</ApplicationIcon> |
29 | 29 | </PropertyGroup> |
30 | 30 | <ItemGroup> |
31 | | - <Compile Remove="publish\**" /> |
32 | | - <EmbeddedResource Remove="publish\**" /> |
33 | | - <None Remove="publish\**" /> |
34 | | - <Page Remove="publish\**" /> |
| 31 | + <Compile Remove="publish\**" /> |
| 32 | + <EmbeddedResource Remove="publish\**" /> |
| 33 | + <None Remove="publish\**" /> |
| 34 | + <Page Remove="publish\**" /> |
35 | 35 | </ItemGroup> |
36 | 36 |
|
37 | 37 | <ItemGroup> |
38 | | - <None Remove="icons\gzip-filled16.png" /> |
39 | | - <None Remove="icons\gzip.png" /> |
40 | | - |
| 38 | + <None Remove="icons\gzip-filled16.png" /> |
| 39 | + <None Remove="icons\gzip.png" /> |
| 40 | + |
41 | 41 | </ItemGroup> |
42 | 42 |
|
43 | 43 | <ItemGroup> |
44 | | - <EmbeddedResource Include="icons\gzip-filled16.png" /> |
| 44 | + <EmbeddedResource Include="icons\gzip-filled16.png" /> |
45 | 45 | </ItemGroup> |
46 | 46 |
|
47 | 47 | <ItemGroup> |
|
53 | 53 | </ItemGroup> |
54 | 54 |
|
55 | 55 | <ItemGroup> |
56 | | - <Resource Include="icons\gzip.png" /> |
| 56 | + <Resource Include="icons\gzip.png" /> |
57 | 57 | </ItemGroup> |
58 | 58 |
|
59 | 59 | <ItemGroup> |
60 | | - <Compile Update="Windows\BrotliSettings.xaml.cs"> |
61 | | - <SubType>Code</SubType> |
62 | | - </Compile> |
63 | | - <Compile Update="Windows\BZip2SettingsDialog.xaml.cs"> |
64 | | - <SubType>Code</SubType> |
65 | | - </Compile> |
66 | | - <Compile Update="Windows\DecompressDialog.xaml.cs"> |
67 | | - <SubType>Code</SubType> |
68 | | - </Compile> |
69 | | - <Compile Update="Windows\XZSettingsDialog.xaml.cs"> |
70 | | - <SubType>Code</SubType> |
71 | | - </Compile> |
72 | | - <Compile Update="Windows\ZstdSettingsDialog.xaml.cs"> |
73 | | - <SubType>Code</SubType> |
74 | | - </Compile> |
| 60 | + <Compile Update="Windows\BrotliSettings.xaml.cs"> |
| 61 | + <SubType>Code</SubType> |
| 62 | + </Compile> |
| 63 | + <Compile Update="Windows\BZip2SettingsDialog.xaml.cs"> |
| 64 | + <SubType>Code</SubType> |
| 65 | + </Compile> |
| 66 | + <Compile Update="Windows\DecompressDialog.xaml.cs"> |
| 67 | + <SubType>Code</SubType> |
| 68 | + </Compile> |
| 69 | + <Compile Update="Windows\XZSettingsDialog.xaml.cs"> |
| 70 | + <SubType>Code</SubType> |
| 71 | + </Compile> |
| 72 | + <Compile Update="Windows\ZstdSettingsDialog.xaml.cs"> |
| 73 | + <SubType>Code</SubType> |
| 74 | + </Compile> |
75 | 75 | </ItemGroup> |
76 | 76 |
|
77 | 77 | <ItemGroup> |
78 | | - <None Update="icons\gzip-filled.png"> |
79 | | - <Pack>True</Pack> |
80 | | - <PackagePath>\</PackagePath> |
81 | | - </None> |
| 78 | + <None Update="icons\gzip-filled.png"> |
| 79 | + <Pack>True</Pack> |
| 80 | + <PackagePath>\</PackagePath> |
| 81 | + </None> |
82 | 82 | </ItemGroup> |
83 | | - |
| 83 | + |
84 | 84 | <PropertyGroup Condition="'$(Platform)'=='x86'"> |
85 | 85 | <RuntimeIdentifier>win-x86</RuntimeIdentifier> |
86 | 86 | <PlatformTarget>x86</PlatformTarget> |
|
93 | 93 | <NppDir>$(NppDir64)</NppDir> |
94 | 94 | </PropertyGroup> |
95 | 95 |
|
| 96 | + |
| 97 | + |
| 98 | + <!-- ========================= |
| 99 | + SDK Discovery |
| 100 | + ========================= --> |
| 101 | + <Target Name="FindSdkVersion" BeforeTargets="Build"> |
| 102 | + <Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(MSBuildProjectDirectory)\Build\Find-SdkVersion.ps1"" ConsoleToMSBuild="true"> |
| 103 | + <Output TaskParameter="ConsoleOutput" PropertyName="WindowsSdkVersion" /> |
| 104 | + </Exec> |
| 105 | + |
| 106 | + <PropertyGroup> |
| 107 | + <WindowsSdkVersion>$([System.String]::Copy('$(WindowsSdkVersion)').Trim())</WindowsSdkVersion> |
| 108 | + <WindowsKitsRoot>$([System.String]::Copy('$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot10)').Trim())</WindowsKitsRoot> |
| 109 | + </PropertyGroup> |
| 110 | + </Target> |
| 111 | + |
| 112 | + <!-- ========================= |
| 113 | + Resource Properties |
| 114 | + ========================= --> |
96 | 115 | <PropertyGroup> |
97 | | - <!-- https://github.com/AaronRobinsonMSFT/DNNE/issues/197#issuecomment-2621208585 --> |
98 | 116 | <Win32Resources>$(MSBuildProjectDirectory)\$(BaseIntermediateOutputPath)$(DnneNativeBinaryName).res</Win32Resources> |
99 | 117 | <DnneLinkerUserFlags>$(Win32Resources)</DnneLinkerUserFlags> |
| 118 | + |
| 119 | + <VersionMajor>$([System.Version]::Parse('$(AssemblyVersion)').Major)</VersionMajor> |
| 120 | + <VersionMinor>$([System.Version]::Parse('$(AssemblyVersion)').Minor)</VersionMinor> |
| 121 | + <VersionBuild>$([System.Version]::Parse('$(AssemblyVersion)').Build)</VersionBuild> |
| 122 | + <VersionRevision>$([System.Version]::Parse('$(AssemblyVersion)').Revision)</VersionRevision> |
100 | 123 | </PropertyGroup> |
101 | 124 |
|
102 | | - <Target Name="CompileWin32Resources" BeforeTargets="CoreCompile" Condition="!Exists('$(Win32Resources)')"> |
103 | | - <Exec Command="rc.exe /fo $(Win32Resources) $(MSBuildProjectDirectory)\$(DnneNativeBinaryName).rc"/> |
| 125 | + <!-- ========================= |
| 126 | + RC Compilation |
| 127 | + ========================= --> |
| 128 | + <Target Name="CompileResources" BeforeTargets="CoreCompile" DependsOnTargets="FindSdkVersion"> |
| 129 | + |
| 130 | + <PropertyGroup> |
| 131 | + <RcExePath>$(WindowsKitsRoot)bin\$(WindowsSdkVersion)\x64\rc.exe</RcExePath> |
| 132 | + <WindowsSdkInclude>$(WindowsKitsRoot)Include\$(WindowsSdkVersion)\um;$(WindowsKitsRoot)Include\$(WindowsSdkVersion)\shared</WindowsSdkInclude> |
| 133 | + </PropertyGroup> |
| 134 | + |
| 135 | + <Exec Command=""$(RcExePath)" /I "$(WindowsSdkInclude)" /d VERSION_MAJOR=$(VersionMajor) /d VERSION_MINOR=$(VersionMinor) /d VERSION_BUILD=$(VersionBuild) /d VERSION_REVISION=$(VersionRevision) /d COMMENTS="\"$(Description)\"" /d COMPANY_NAME="\"$(Company)\"" /d FILE_DESCRIPTION="\"$(Description)\"" /d FILE_VERSION="\"$(AssemblyVersion)\"" /d INTERNAL_NAME="\"$(DnneNativeBinaryName).dll\"" /d LEGAL_COPYRIGHT="\"$(Copyright)\"" /d ORIGINAL_FILENAME="\"$(DnneNativeBinaryName).dll\"" /d PRODUCT_NAME="\"$(Product)\"" /d PRODUCT_VERSION="\"$(Version)\"" /fo "$(Win32Resources)" "$(MSBuildProjectDirectory)\Build\$(DnneNativeBinaryName).rc"" /> |
| 136 | + |
104 | 137 | </Target> |
105 | 138 |
|
106 | 139 | <Target Name="CopyFiles" AfterTargets="PostBuildEvent" Condition=" Exists('$(NppDir)\plugins') AND '$(NppDir)' != '' "> |
107 | 140 | <ItemGroup> |
108 | 141 | <Binaries Include="$(ProjectDir)$(OutDir)**\*.*" /> |
109 | 142 | </ItemGroup> |
110 | | - <RemoveDir Directories="$(NppDir)\plugins\CompressedFileViewer" /> <!-- Remove old files --> |
| 143 | + <RemoveDir Directories="$(NppDir)\plugins\CompressedFileViewer" /> |
| 144 | + <!-- Remove old files --> |
111 | 145 | <MakeDir Directories="$(NppDir)\plugins\CompressedFileViewer" /> |
112 | 146 | <Copy SourceFiles="@(Binaries)" DestinationFolder="$(NppDir)\plugins\CompressedFileViewer" /> |
113 | 147 | </Target> |
|
0 commit comments