Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src-tauri/app.release.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10/11 and Windows Server 2016/2019/2022 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 and Windows Server 2012 R2 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 and Windows Server 2012 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 and Windows Server 2008 R2 -->
<supportedOS Id="{35138b9a-5d96-4fbe-8c42-49cde32c5b20}"/>
</application>
</compatibility>
</assembly>
28 changes: 27 additions & 1 deletion src-tauri/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,33 @@ fn main() {
maybe_embed_webview2_fixed_runtime();
#[cfg(target_os = "macos")]
maybe_build_macos_dock_helper();
tauri_build::build()
build_tauri();
}

/// 빌드 프로필에 따라 tauri-build를 실행합니다.
/// 릴리즈 빌드에서는 Windows 관리자 권한을 요청하는 manifest를 적용하고,
/// 개발 서버(tauri dev)에서는 기본 설정을 사용합니다.
fn build_tauri() {
#[cfg(target_os = "windows")]
{
println!("cargo:rerun-if-changed=app.release.manifest");
let profile = std::env::var("PROFILE").unwrap_or_default();
if profile == "release" {
let manifest_path = std::path::Path::new("app.release.manifest");
if manifest_path.exists() {
let manifest = std::fs::read_to_string(manifest_path)
.expect("app.release.manifest 읽기 실패");
tauri_build::try_build(
tauri_build::Attributes::new().windows_attributes(
tauri_build::WindowsAttributes::new().app_manifest(manifest),
),
)
.expect("tauri 빌드 실패");
return;
}
}
}
tauri_build::build();
}

#[cfg(target_os = "macos")]
Expand Down