winsw.csproj 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <PropertyGroup>
  4. <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  5. <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  6. <ProductVersion>9.0.21022</ProductVersion>
  7. <SchemaVersion>2.0</SchemaVersion>
  8. <ProjectGuid>{0DE77F55-ADE5-43C1-999A-0BC81153B039}</ProjectGuid>
  9. <OutputType>Exe</OutputType>
  10. <AppDesignerFolder>Properties</AppDesignerFolder>
  11. <RootNamespace>winsw</RootNamespace>
  12. <AssemblyName>WindowsService</AssemblyName>
  13. <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
  14. <FileAlignment>512</FileAlignment>
  15. <StartupObject>
  16. </StartupObject>
  17. <SignManifests>false</SignManifests>
  18. <SignAssembly>true</SignAssembly>
  19. <AssemblyOriginatorKeyFile>$(SolutionDir)..\winsw_key.snk</AssemblyOriginatorKeyFile>
  20. <FileUpgradeFlags>
  21. </FileUpgradeFlags>
  22. <UpgradeBackupLocation>
  23. </UpgradeBackupLocation>
  24. <OldToolsVersion>3.5</OldToolsVersion>
  25. <PublishUrl>publish\</PublishUrl>
  26. <Install>true</Install>
  27. <InstallFrom>Disk</InstallFrom>
  28. <UpdateEnabled>false</UpdateEnabled>
  29. <UpdateMode>Foreground</UpdateMode>
  30. <UpdateInterval>7</UpdateInterval>
  31. <UpdateIntervalUnits>Days</UpdateIntervalUnits>
  32. <UpdatePeriodically>false</UpdatePeriodically>
  33. <UpdateRequired>false</UpdateRequired>
  34. <MapFileExtensions>true</MapFileExtensions>
  35. <ApplicationRevision>0</ApplicationRevision>
  36. <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
  37. <IsWebBootstrapper>false</IsWebBootstrapper>
  38. <UseApplicationTrust>false</UseApplicationTrust>
  39. <BootstrapperEnabled>true</BootstrapperEnabled>
  40. <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
  41. <RestorePackages>true</RestorePackages>
  42. </PropertyGroup>
  43. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  44. <DebugSymbols>true</DebugSymbols>
  45. <DebugType>full</DebugType>
  46. <Optimize>false</Optimize>
  47. <OutputPath>bin\Debug\</OutputPath>
  48. <DefineConstants>TRACE;DEBUG</DefineConstants>
  49. <ErrorReport>prompt</ErrorReport>
  50. <WarningLevel>4</WarningLevel>
  51. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  52. </PropertyGroup>
  53. <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
  54. <DebugType>pdbonly</DebugType>
  55. <Optimize>true</Optimize>
  56. <OutputPath>bin\Release\</OutputPath>
  57. <DefineConstants>TRACE</DefineConstants>
  58. <ErrorReport>prompt</ErrorReport>
  59. <WarningLevel>4</WarningLevel>
  60. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  61. <DocumentationFile>
  62. </DocumentationFile>
  63. </PropertyGroup>
  64. <ItemGroup>
  65. <Reference Include="log4net">
  66. <HintPath>..\..\packages\log4net.2.0.3\lib\net20-full\log4net.dll</HintPath>
  67. </Reference>
  68. <Reference Include="System" />
  69. <Reference Include="System.Drawing" />
  70. <Reference Include="System.Management" />
  71. <Reference Include="System.Data" />
  72. <Reference Include="System.ServiceProcess" />
  73. <Reference Include="System.Windows.Forms" />
  74. <Reference Include="System.Xml" />
  75. </ItemGroup>
  76. <ItemGroup>
  77. <Compile Include="Main.cs">
  78. <SubType>Component</SubType>
  79. </Compile>
  80. <Compile Include="Properties\AssemblyInfo.cs" />
  81. <Compile Include="SigIntHelper.cs" />
  82. </ItemGroup>
  83. <ItemGroup>
  84. <Content Include="manifest.xml" />
  85. <Content Include="pom.xml">
  86. <SubType>Designer</SubType>
  87. </Content>
  88. <Content Include="winsw.xml">
  89. <SubType>Designer</SubType>
  90. </Content>
  91. </ItemGroup>
  92. <ItemGroup>
  93. <None Include="..\..\..\winsw_cert.pfx" />
  94. <None Include="packages.config">
  95. <SubType>Designer</SubType>
  96. </None>
  97. <None Include="$(AssemblyOriginatorKeyFile)" />
  98. </ItemGroup>
  99. <ItemGroup>
  100. <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
  101. <Visible>False</Visible>
  102. <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
  103. <Install>false</Install>
  104. </BootstrapperPackage>
  105. <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
  106. <Visible>False</Visible>
  107. <ProductName>.NET Framework 3.5 SP1</ProductName>
  108. <Install>true</Install>
  109. </BootstrapperPackage>
  110. </ItemGroup>
  111. <ItemGroup>
  112. <ProjectReference Include="..\..\Plugins\RunawayProcessKiller\RunawayProcessKiller.csproj">
  113. <Project>{57284b7a-82a4-407a-b706-ebea6bf8ea13}</Project>
  114. <Name>RunawayProcessKiller</Name>
  115. </ProjectReference>
  116. <ProjectReference Include="..\..\Plugins\SharedDirectoryMapper\SharedDirectoryMapper.csproj">
  117. <Project>{ca5c71db-c5a8-4c27-bf83-8e6daed9d6b5}</Project>
  118. <Name>SharedDirectoryMapper</Name>
  119. </ProjectReference>
  120. <ProjectReference Include="..\WinSWCore\WinSWCore.csproj">
  121. <Project>{9d0c63e2-b6ff-4a85-bd36-b3e5d7f27d06}</Project>
  122. <Name>WinSWCore</Name>
  123. </ProjectReference>
  124. </ItemGroup>
  125. <ItemGroup />
  126. <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  127. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  128. Other similar extension points exist, see Microsoft.Common.targets.
  129. <Target Name="BeforeBuild">
  130. </Target>
  131. <Target Name="AfterBuild">
  132. </Target>
  133. -->
  134. <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
  135. <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  136. <PropertyGroup>
  137. <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  138. </PropertyGroup>
  139. <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
  140. </Target>
  141. <!-- Merge plugins and other DLLs into winsw.exe -->
  142. <UsingTask TaskName="MSBuild.Community.Tasks.ILMerge" AssemblyFile="$(SolutionDir)\packages\MSBuildTasks.1.4.0.88\tools\MSBuild.Community.Tasks.dll" />
  143. <Target Name="AfterBuild">
  144. <ItemGroup>
  145. <MergeAsm Include="$(OutputPath)$(TargetFileName)" />
  146. <MergeAsm Include="$(OutputPath)WinSWCore.dll" />
  147. <MergeAsm Include="$(OutputPath)SharedDirectoryMapper.dll" />
  148. <MergeAsm Include="$(OutputPath)RunawayProcessKiller.dll" />
  149. <MergeAsm Include="$(OutputPath)log4net.dll" />
  150. </ItemGroup>
  151. <PropertyGroup>
  152. <MergedAssembly>$(ProjectDir)$(OutDir)winsw.exe</MergedAssembly>
  153. <CertificatePfxFile>$(AssemblyOriginatorKeyFile)</CertificatePfxFile>
  154. </PropertyGroup>
  155. <!-- Locate SN.EXE in Windows SDK, use the first found one-->
  156. <PropertyGroup>
  157. <SnPathTmpFile>$(OutputPath)sn-path.txt</SnPathTmpFile>
  158. </PropertyGroup>
  159. <GetFrameworkSdkPath>
  160. <Output TaskParameter="Path" PropertyName="WindowsSdkPath" />
  161. </GetFrameworkSdkPath>
  162. <Message Text="Using SDK from $(WindowsSdkPath)" Importance="high" />
  163. <Exec Command="WHERE /r &quot;$(WindowsSdkPath.TrimEnd('\\'))&quot; sn &gt; $(SnPathTmpFile)" />
  164. <ReadLinesFromFile File="$(SnPathTmpFile)">
  165. <Output TaskParameter="Lines" PropertyName="SNPath" />
  166. </ReadLinesFromFile>
  167. <Delete Files="$(SnPathTmpFile)" />
  168. <PropertyGroup>
  169. <SNPath>$([System.Text.RegularExpressions.Regex]::Replace('$(SNPath)', ';.*', ''))</SNPath>
  170. </PropertyGroup>
  171. <Error Condition="!Exists('$(SNPath)')" Text="Cannot find SN.EXE utility in $(WindowsSdkPath)" />
  172. <Message Text="Using SN.EXE utility from $(SNPath)" Importance="high" />
  173. <!-- Merge and re-sign assemblies -->
  174. <PropertyGroup>
  175. <ILMergePath>$(SolutionDir)packages\ilmerge.2.14.1208\tools</ILMergePath>
  176. <CertificateTmpPubFile>$(OutputPath)winsw_cert.pub</CertificateTmpPubFile>
  177. </PropertyGroup>
  178. <Message Text="Extracting public key from $(AssemblyOriginatorKeyFile)" />
  179. <Exec Command="&quot;$(SNPath)&quot; -p &quot;$(AssemblyOriginatorKeyFile)&quot; &quot;$(CertificateTmpPubFile)&quot;" />
  180. <Message Text="ILMerge @(MergeAsm) -&gt; $(MergedAssembly)" Importance="high" />
  181. <ILMerge ToolPath="$(ILMergePath)" InputAssemblies="@(MergeAsm)" OutputFile="$(MergedAssembly)" TargetKind="SameAsPrimaryAssembly" KeyFile="$(CertificateTmpPubFile)" DelaySign="true" />
  182. <Exec Command="&quot;$(SNPath)&quot; -R &quot;$(MergedAssembly)&quot; &quot;$(AssemblyOriginatorKeyFile)&quot;" />
  183. </Target>
  184. </Project>