(Tyr) fix flashing console window on windows (#105)

add requireAdmin in app manist
This commit is contained in:
Sijie.Sun 2024-05-11 12:02:15 +08:00 committed by GitHub
parent 0926820849
commit 65ac991d1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 595 additions and 680 deletions

View File

@ -12,20 +12,20 @@
"lint:fix": "eslint . --ignore-pattern src-tauri --fix" "lint:fix": "eslint . --ignore-pattern src-tauri --fix"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1", "@tauri-apps/api": "^1.5.5",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"primeflex": "^3.3.1", "primeflex": "^3.3.1",
"primeicons": "^7.0.0", "primeicons": "^7.0.0",
"primevue": "^3.52.0", "primevue": "^3.52.0",
"vue": "^3.4.26", "vue": "^3.4.27",
"vue-i18n": "^9.13.1", "vue-i18n": "^9.13.1",
"vue-router": "^4.3.2" "vue-router": "^4.3.2"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^2.16.1", "@antfu/eslint-config": "^2.17.0",
"@intlify/unplugin-vue-i18n": "^4.0.0", "@intlify/unplugin-vue-i18n": "^4.0.0",
"@tauri-apps/cli": "^1", "@tauri-apps/cli": "^1.5.13",
"@types/node": "^20.12.8", "@types/node": "^20.12.11",
"@types/uuid": "^9.0.8", "@types/uuid": "^9.0.8",
"@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue": "^5.0.4",
"@vue-macros/volar": "^0.19.0", "@vue-macros/volar": "^0.19.0",
@ -35,7 +35,7 @@
"postcss": "^8.4.38", "postcss": "^8.4.38",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.3",
"typescript": "^5.4.5", "typescript": "^5.4.5",
"unplugin-auto-import": "^0.17.5", "unplugin-auto-import": "^0.17.6",
"unplugin-vue-components": "^0.27.0", "unplugin-vue-components": "^0.27.0",
"unplugin-vue-macros": "^2.9.2", "unplugin-vue-macros": "^2.9.2",
"unplugin-vue-markdown": "^0.26.2", "unplugin-vue-markdown": "^0.26.2",
@ -45,6 +45,6 @@
"vite-plugin-vue-devtools": "^7.1.3", "vite-plugin-vue-devtools": "^7.1.3",
"vite-plugin-vue-layouts": "^0.11.0", "vite-plugin-vue-layouts": "^0.11.0",
"vue-i18n": "^9.13.1", "vue-i18n": "^9.13.1",
"vue-tsc": "^2.0.16" "vue-tsc": "^2.0.17"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,34 @@
fn main() { fn main() {
tauri_build::build() if !cfg!(debug_assertions) && cfg!(target_os = "windows") {
let mut windows = tauri_build::WindowsAttributes::new();
windows = windows.app_manifest(
r#"
<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>
</assembly>
"#,
);
tauri_build::try_build(tauri_build::Attributes::new().windows_attributes(windows))
.expect("failed to run build script");
} else {
tauri_build::build();
}
} }