mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-29 14:04:19 +03:00
fix: build on windows
This commit is contained in:
parent
7209fdf732
commit
dd83217301
@ -73,6 +73,7 @@ pub fn target_triple() -> crate::Result<String> {
|
||||
/// `${exe_dir}/../lib/${exe_name}`.
|
||||
///
|
||||
/// On MacOS, it's `${exe_dir}../Resources` (inside .app).
|
||||
#[allow(unused_variables)]
|
||||
pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<PathBuf> {
|
||||
let exe = std::env::current_exe()?;
|
||||
let exe_dir = exe.parent().expect("failed to get exe directory");
|
||||
@ -86,8 +87,12 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<Path
|
||||
return Ok(exe_dir.to_path_buf());
|
||||
}
|
||||
|
||||
if cfg!(target_os = "linux") {
|
||||
if curr_dir.ends_with("/data/usr/bin") {
|
||||
#[allow(unused_mut)]
|
||||
let mut res = Err(crate::Error::UnsupportedPlatform);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
res = if curr_dir.ends_with("/data/usr/bin") {
|
||||
// running from the deb bundle dir
|
||||
Ok(exe_dir.join(format!("../lib/{}", package_info.package_name())))
|
||||
} else if let Some(appdir) = &env.appdir {
|
||||
@ -103,10 +108,13 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<Path
|
||||
"/usr/lib/{}",
|
||||
package_info.package_name()
|
||||
)))
|
||||
}
|
||||
} else if cfg!(target_os = "macos") {
|
||||
Ok(exe_dir.join("../Resources"))
|
||||
} else {
|
||||
Err(crate::Error::UnsupportedPlatform)
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
res = Ok(exe_dir.join("../Resources"));
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
@ -677,6 +677,7 @@ impl<R: Runtime> WindowManager<R> {
|
||||
let local_app_data = resolve_path(
|
||||
&self.inner.config,
|
||||
&self.inner.package_info,
|
||||
self.inner.state.get::<crate::Env>().inner(),
|
||||
&self.inner.config.tauri.bundle.identifier,
|
||||
Some(BaseDirectory::LocalData),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user