|
|
|
|
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<OutputType>WinExe</OutputType>
|
|
|
|
|
<TargetFramework>net9.0-windows</TargetFramework>
|
|
|
|
|
<Nullable>disable</Nullable>
|
|
|
|
|
<UseWPF>true</UseWPF>
|
|
|
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
|
|
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
|
|
|
|
<Deterministic>true</Deterministic>
|
|
|
|
|
<PlatformTarget>x86</PlatformTarget>
|
|
|
|
|
<Platforms>AnyCPU;x86</Platforms>
|
|
|
|
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
|
|
|
|
|
|
|
|
<!-- 단일 파일 배포 및 정제 설정 -->
|
|
|
|
|
<PublishSingleFile>true</PublishSingleFile>
|
|
|
|
|
<!-- SelfContained=true: 대상 PC의 .NET 런타임 설치 여부와 무관하게 실행 가능 -->
|
|
|
|
|
<SelfContained>true</SelfContained>
|
|
|
|
|
<!-- 네이티브 DLL들도 단일 EXE 안에 내장하여 추출 방식으로 처리 -->
|
|
|
|
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
|
|
|
|
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
|
|
|
|
<ApplicationIcon>EOL.ico</ApplicationIcon>
|
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.14.2075">
|
|
|
|
|
<EmbedInteropTypes>true</EmbedInteropTypes>
|
|
|
|
|
</PackageReference>
|
|
|
|
|
<PackageReference Include="System.IO.Ports" Version="9.0.0" />
|
|
|
|
|
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<Resource Include="EOL.ico" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<None Update="Database.ini">
|
|
|
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
|
|
|
</None>
|
|
|
|
|
<None Update="Sensor.ini">
|
|
|
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
|
|
|
</None>
|
|
|
|
|
<None Update="PCI-Dask.dll">
|
|
|
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
|
|
|
</None>
|
|
|
|
|
<None Update="LoginOptions.json">
|
|
|
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
|
|
|
</None>
|
|
|
|
|
<None Update="EOL.ico">
|
|
|
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
|
|
|
</None>
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<!-- 빌드 후 Native DLL을 libs 하위 폴더로 복사 (XCopy 플랫폼 의존성 배제) -->
|
|
|
|
|
<Target Name="CopyDllToLibs" AfterTargets="Build">
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<NativeDlls Include="$(TargetDir)PCI-Dask.dll" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
<MakeDir Directories="$(TargetDir)libs" Condition="!Exists('$(TargetDir)libs')" />
|
|
|
|
|
<Copy SourceFiles="@(NativeDlls)" DestinationFolder="$(TargetDir)libs\" SkipUnchangedFiles="true" />
|
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
|
<!-- Visual Studio IDE 게시 엔진이 파편 파일들(exe, pdb, libs)을 게시 폴더로 복사하는 것을 방지 -->
|
|
|
|
|
<Target Name="FilterFilesToPublish" AfterTargets="ComputeFilesToPublish">
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
|
<!-- Publish 단계 완료 후 Native DLL을 libs 하위 폴더로 복사 (FolderPublish 실행 전에 수행) -->
|
|
|
|
|
<Target Name="CopyDllToPublish" BeforeTargets="FolderPublish" AfterTargets="Publish">
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<PublishNativeDlls Include="$(MSBuildProjectDirectory)\PCI-Dask.dll" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
<MakeDir Directories="$(PublishDir)libs" Condition="!Exists('$(PublishDir)libs')" />
|
|
|
|
|
<Copy SourceFiles="@(PublishNativeDlls)" DestinationFolder="$(PublishDir)libs\" SkipUnchangedFiles="true" />
|
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
|
<!-- C:\LeakTest\ 단일 설치 패키지 패키징 Target (게시 폴더 C:\Users\COMPUTER1\Downloads\ 에 오직 LeakTestSetup.exe 1개만 보존) -->
|
|
|
|
|
<Target Name="FolderPublish" DependsOnTargets="Publish" AfterTargets="Publish;AfterPublish;FileSystemPublish">
|
|
|
|
|
<PropertyGroup>
|
|
|
|
|
<TempDeployFolder>$(MSBuildProjectDirectory)\bin\Release\net9.0-windows\win-x86\temp_deploy\</TempDeployFolder>
|
|
|
|
|
<PublishBackupDir>$(MSBuildProjectDirectory)\bin\Release\net9.0-windows\win-x86\publish_backup\</PublishBackupDir>
|
|
|
|
|
<SafePublishDir>$(MSBuildProjectDirectory)\bin\Release\net9.0-windows\win-x86\publish\</SafePublishDir>
|
|
|
|
|
</PropertyGroup>
|
|
|
|
|
<Message Text="Preparing isolated packaging environment at $(TempDeployFolder)..." Importance="high" />
|
|
|
|
|
|
|
|
|
|
<!-- 1. 임시 수집 폴더 클린업 및 생성 -->
|
|
|
|
|
<RemoveDir Directories="$(TempDeployFolder)" />
|
|
|
|
|
<MakeDir Directories="$(TempDeployFolder)" />
|
|
|
|
|
|
|
|
|
|
<!-- 2. 게시 바이너리 및 필수 설정 파일 수집 이관 -->
|
|
|
|
|
<Copy SourceFiles="$(PublishDir)leak_test_project.exe" DestinationFolder="$(TempDeployFolder)" Condition="Exists('$(PublishDir)leak_test_project.exe')" />
|
|
|
|
|
<Copy SourceFiles="$(TargetDir)leak_test_project.exe" DestinationFolder="$(TempDeployFolder)" Condition="!Exists('$(PublishDir)leak_test_project.exe') And Exists('$(TargetDir)leak_test_project.exe')" />
|
|
|
|
|
<Copy SourceFiles="$(TargetDir)leak_test_project.dll.config" DestinationFolder="$(TempDeployFolder)" Condition="Exists('$(TargetDir)leak_test_project.dll.config')" />
|
|
|
|
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\Database.ini" DestinationFolder="$(TempDeployFolder)" />
|
|
|
|
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\LoginOptions.json" DestinationFolder="$(TempDeployFolder)" />
|
|
|
|
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\EOL.ico" DestinationFolder="$(TempDeployFolder)" />
|
|
|
|
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\Sensor.ini" DestinationFolder="$(TempDeployFolder)" Condition="Exists('$(MSBuildProjectDirectory)\Sensor.ini')" />
|
|
|
|
|
<Copy SourceFiles="$(MSBuildProjectDirectory)\PCI-Dask.dll" DestinationFolder="$(TempDeployFolder)" />
|
|
|
|
|
<Copy SourceFiles="$(TargetDir)Microsoft.Data.SqlClient.SNI.dll" DestinationFolder="$(TempDeployFolder)" />
|
|
|
|
|
|
|
|
|
|
<!-- 3. [WiX Toolset 단일 MSI 설치 파일 자동 빌드] -->
|
|
|
|
|
<Message Text="Compiling single installer MSI via WiX Toolset..." Importance="high" />
|
|
|
|
|
<Exec Command="wix build "$(MSBuildProjectDirectory)\..\leak_test_project.Setup\Product.wxs" -d PublishSourceDir="$(TempDeployFolder)." -o "$(TempDeployFolder)LeakTestSetup.msi"" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
|
|
|
|
|
|
|
|
|
<!-- 4. [WiX Toolset 단일 EXE 설치 파일 자동 빌드] -->
|
|
|
|
|
<Message Text="Compiling single installer EXE via WiX Toolset Bundle..." Importance="high" />
|
|
|
|
|
<Exec Command="wix build "$(MSBuildProjectDirectory)\..\leak_test_project.Setup\Bundle.wxs" -d PublishSourceDir="$(TempDeployFolder)." -d MsiPath="$(TempDeployFolder)LeakTestSetup.msi" -o "$(TempDeployFolder)LeakTestSetup.exe" -ext WixToolset.BootstrapperApplications.wixext/5.0.2" WorkingDirectory="$(MSBuildProjectDirectory)" />
|
|
|
|
|
|
|
|
|
|
<!-- 5. 완성된 LeakTestSetup.exe 단일 파일 대피 -->
|
|
|
|
|
<RemoveDir Directories="$(PublishBackupDir)" />
|
|
|
|
|
<MakeDir Directories="$(PublishBackupDir)" />
|
|
|
|
|
<Copy SourceFiles="$(TempDeployFolder)LeakTestSetup.exe" DestinationFolder="$(PublishBackupDir)" />
|
|
|
|
|
|
|
|
|
|
<!-- 6. 임시 수집 디렉터리 완전 소거 -->
|
|
|
|
|
<RemoveDir Directories="$(TempDeployFolder)" />
|
|
|
|
|
|
|
|
|
|
<!-- 7. 게시 폴더(PublishDir 및 SafePublishDir) 하위의 프로젝트 관련 파편 파일 및 libs 폴더 정밀 완전 삭제 -->
|
|
|
|
|
<Message Text="Purging publish output directory and leaving only LeakTestSetup.exe..." Importance="high" />
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<!-- SafePublishDir 정화 -->
|
|
|
|
|
<FilesToPurge Include="$(SafePublishDir)leak_test_project.exe;$(SafePublishDir)leak_test_project.pdb;$(SafePublishDir)leak_test_project.dll;$(SafePublishDir)leak_test_project.dll.config;$(SafePublishDir)PCI-Dask.dll;$(SafePublishDir)Microsoft.Data.SqlClient.SNI.dll;$(SafePublishDir)Database.ini;$(SafePublishDir)LoginOptions.json;$(SafePublishDir)EOL.ico;$(SafePublishDir)Sensor.ini;$(SafePublishDir)LeakTestSetup.msi;$(SafePublishDir)LeakTestSetup.wixpdb" />
|
|
|
|
|
<!-- PublishDir 정화 (C:\Users\COMPUTER1\Downloads\ 게시 폴더) -->
|
|
|
|
|
<FilesToPurge Include="$(PublishDir)leak_test_project.exe;$(PublishDir)leak_test_project.pdb;$(PublishDir)leak_test_project.dll;$(PublishDir)leak_test_project.dll.config;$(PublishDir)PCI-Dask.dll;$(PublishDir)Microsoft.Data.SqlClient.SNI.dll;$(PublishDir)Database.ini;$(PublishDir)LoginOptions.json;$(PublishDir)EOL.ico;$(PublishDir)Sensor.ini;$(PublishDir)LeakTestSetup.msi;$(PublishDir)LeakTestSetup.wixpdb" Condition="'$(PublishDir)' != ''" />
|
|
|
|
|
</ItemGroup>
|
|
|
|
|
<Delete Files="@(FilesToPurge)" />
|
|
|
|
|
|
|
|
|
|
<!-- libs 및 부속 언어 폴더 완전 삭제 -->
|
|
|
|
|
<RemoveDir Directories="$(SafePublishDir)libs;$(SafePublishDir)cs;$(SafePublishDir)de;$(SafePublishDir)es;$(SafePublishDir)fr;$(SafePublishDir)it;$(SafePublishDir)ja;$(SafePublishDir)ko;$(SafePublishDir)pl;$(SafePublishDir)pt-BR;$(SafePublishDir)ru;$(SafePublishDir)tr;$(SafePublishDir)zh-Hans;$(SafePublishDir)zh-Hant" />
|
|
|
|
|
<RemoveDir Directories="$(PublishDir)libs;$(PublishDir)cs;$(PublishDir)de;$(PublishDir)es;$(PublishDir)fr;$(PublishDir)it;$(PublishDir)ja;$(PublishDir)ko;$(PublishDir)pl;$(PublishDir)pt-BR;$(PublishDir)ru;$(PublishDir)tr;$(PublishDir)zh-Hans;$(PublishDir)zh-Hant" Condition="'$(PublishDir)' != ''" />
|
|
|
|
|
|
|
|
|
|
<!-- 8. 대피시켰던 단일 설치 EXE 파일 1개만 게시 폴더로 이관 -->
|
|
|
|
|
<Copy SourceFiles="$(PublishBackupDir)LeakTestSetup.exe" DestinationFolder="$(SafePublishDir)" />
|
|
|
|
|
<Copy SourceFiles="$(PublishBackupDir)LeakTestSetup.exe" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != '' And '$(PublishDir)' != '$(SafePublishDir)'" />
|
|
|
|
|
|
|
|
|
|
<!-- 9. 대피 임시 폴더 정리 -->
|
|
|
|
|
<RemoveDir Directories="$(PublishBackupDir)" />
|
|
|
|
|
|
|
|
|
|
<Message Text="Single Installer LeakTestSetup.exe successfully generated at $(PublishDir)LeakTestSetup.exe" Importance="high" />
|
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
|
|
</Project>
|