This commit is contained in:
lif 2026-02-03 23:30:07 +01:00 committed by GitHub
commit 2eb052a8f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,7 @@
---
'tauri-bundler': 'minor:feat'
'tauri-utils': 'minor:feat'
'tauri-cli': 'minor:feat'
---
Add `detachRetries` option to DMG configuration to customize the maximum number of attempts to detach the DMG volume (fix #14686).

View File

@ -130,6 +130,8 @@ Options:
execute hdiutil with sandbox compatibility and do not bless (not supported for APFS disk images)
--skip-jenkins
skip Finder-prettifying AppleScript, useful in Sandbox and non-GUI environments
--detach-retries <attempts>
set maximum number of attempts to detach the DMG volume (default: 3)
--version
show create-dmg version number
-h, --help
@ -264,6 +266,9 @@ while [[ "${1:0:1}" = "-" ]]; do
--skip-jenkins)
SKIP_JENKINS=1
shift;;
--detach-retries)
MAXIMUM_UNMOUNTING_ATTEMPTS="$2"
shift; shift;;
-*)
echo "Unknown option: $1. Run 'create-dmg --help' for help."
exit 1;;

View File

@ -179,6 +179,11 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result<
}
}
// Issue #14686 - Allow customizing detach retries for large DMGs
if let Some(detach_retries) = dmg_settings.detach_retries {
bundle_dmg_cmd.args(["--detach-retries", &detach_retries.to_string()]);
}
log::info!(action = "Running"; "bundle_dmg.sh");
// execute the bundle script

View File

@ -304,6 +304,9 @@ pub struct DmgSettings {
pub app_position: Position,
/// Position of application folder on window.
pub application_folder_position: Position,
/// Maximum number of attempts to detach the DMG volume before giving up.
/// Defaults to 3. Increase this value if you encounter "hdiutil: detach: timeout" errors.
pub detach_retries: Option<u32>,
}
/// The iOS bundle settings.

View File

@ -1604,6 +1604,7 @@ fn tauri_config_to_bundle_settings(
x: config.macos.dmg.application_folder_position.x,
y: config.macos.dmg.application_folder_position.y,
},
detach_retries: config.macos.dmg.detach_retries,
},
ios: IosSettings {
bundle_version: config.ios.bundle_version,

View File

@ -563,6 +563,11 @@ pub struct DmgConfig {
alias = "application-folder-position"
)]
pub application_folder_position: Position,
/// Maximum number of attempts to detach the DMG volume before giving up.
/// Defaults to 3. Increase this value if you encounter "hdiutil: detach: timeout" errors,
/// which can occur with large DMG files on CI environments with throttled CPUs.
#[serde(alias = "detach-retries")]
pub detach_retries: Option<u32>,
}
impl Default for DmgConfig {
@ -573,6 +578,7 @@ impl Default for DmgConfig {
window_size: dmg_window_size(),
app_position: dmg_app_position(),
application_folder_position: dmg_application_folder_position(),
detach_retries: None,
}
}
}