├── .gitignore ├── ChangeLog ├── Makefile ├── README.md ├── dmg2dir ├── docs ├── en.1 └── fr.1 └── po └── fr.po /.gitignore: -------------------------------------------------------------------------------- 1 | *~ -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | Version 3.1.1 - 2018-09-10 : 2 | * Fix error on installation 3 | 4 | 5 | Version 3.1.0 - 2018-09-10 : 6 | 7 | * Fix creation of ISO > 4GB 8 | * Fix some errors with udisks2 (mount/unmount/loop-delete) 9 | * Fix DEBUG environment variable 10 | * Remove --force option 11 | * Replace -w option by -vv 12 | * Improve options parsing with getopt 13 | * Improve dependencies checking 14 | * Add support for loop devices with more than one partition 15 | * Add --overwrite-img/--overwrite-dir/--overwrite-iso options 16 | 17 | 18 | Version 3.0.3 - 2018-03-29 : 19 | 20 | * Fix bug with tmpdir 21 | * Fix redirection to /dev/null 22 | 23 | 24 | Version 3.0.2 - 2015-02-28 : 25 | 26 | * Add man-pages (English and French) 27 | 28 | 29 | Version 3.0.1 - 2014-04-10 : 30 | 31 | * Fix bug with unprintable characters 32 | 33 | 34 | Version 3.0.0 - 2014-05-17 : 35 | 36 | * Full rewrite of script 37 | * Support for translations (using PO files) 38 | * Remove --media and --about options 39 | * Script shows more informations by default 40 | * Add option --quiet, and rename option --vverbose in --+verbose 41 | * Remove ugly function trackerror() for little functions check*() 42 | * Suppress function initialize() 43 | 44 | Version 2.4.0 - 2014-05-13 : 45 | 46 | * Add possibility to generate ISO from directory 47 | 48 | 49 | Version 2.3.0 - 2013-10-09 : 50 | 51 | * Add possibility to use dyld (experimental) 52 | 53 | 54 | Version 2.2.3 - 2013-08-16 : 55 | 56 | * Fix little bugs 57 | 58 | 59 | Version 2.2.2 - 2013-07-18 : 60 | 61 | * Improve tracing errors 62 | 63 | 64 | Version 2.2.1 - 2013-07-15 : 65 | 66 | * Fix errors 10 & 11 67 | 68 | 69 | Version 2.2.0 - 2013-07-15 : 70 | 71 | * Add french language 72 | 73 | 74 | Version 2.1.0 - 2013-07-14 : 75 | 76 | * Improve verbose mode 77 | * Add option 'Very verbose' 78 | * Add debug mode 79 | 80 | 81 | Version 2.0.0 - 2013-07-11 : 82 | 83 | * Add more functions and arguments 84 | * Make a cleaner script 85 | 86 | 87 | Version 1.1.0 - 2013-07-07 : 88 | 89 | * Add more tracing errors 90 | 91 | 92 | Version 1.0.0 - 2013-07-07 : 93 | 94 | * Initial Release, basic script 95 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DESTDIR= 2 | PREFIX=/usr/local 3 | bindir=$(PREFIX)/bin 4 | localedir=$(PREFIX)/share/locale 5 | mandir=$(PREFIX)/share/man 6 | MSGFMT := $(shell command -v msgfmt 2> /dev/null) 7 | GZIP := $(shell command -v gzip 2> /dev/null) 8 | INSTALL := $(shell command -v install 2> /dev/null) 9 | 10 | 11 | all: po man 12 | 13 | po: 14 | ifndef MSGFMT 15 | $(error "'msgfmt' command is missing. Please install gettext.") 16 | endif 17 | $(MSGFMT) po/fr.po -o po/dmg2dir_fr.mo 18 | 19 | man: 20 | ifndef GZIP 21 | $(error "'gzip' command is missing. Please install gzip.") 22 | endif 23 | $(GZIP) -f -k -c docs/en.1 > docs/dmg2dir_en.1.gz 24 | $(GZIP) -f -k -c docs/fr.1 > docs/dmg2dir_fr.1.gz 25 | 26 | clean: 27 | @rm -v po/*.mo 28 | @rm -v docs/*.1.gz 29 | 30 | install: po man 31 | ifndef INSTALL 32 | $(error "'install' command is missing. Please install coreutils.") 33 | endif 34 | $(INSTALL) -Dvm755 dmg2dir $(DESTDIR)$(bindir)/dmg2dir 35 | $(INSTALL) -Dvm644 po/dmg2dir_fr.mo $(DESTDIR)$(localedir)/fr/LC_MESSAGES/dmg2dir.mo 36 | $(INSTALL) -Dvm644 docs/dmg2dir_en.1.gz $(DESTDIR)$(mandir)/man1/dmg2dir.1.gz 37 | $(INSTALL) -Dvm644 docs/dmg2dir_fr.1.gz $(DESTDIR)$(mandir)/fr/man1/dmg2dir.1.gz 38 | sed -i 's|@TEXTDOMAINDIR@|$(localedir)|g' $(DESTDIR)$(bindir)/dmg2dir 39 | 40 | uninstall: 41 | @rm -v $(bindir)/dmg2dir 42 | @rm -v $(localedir)/fr/LC_MESSAGES/dmg2dir.mo 43 | @rm -v $(mandir)/man1/dmg2dir.1.gz 44 | @rm -v $(mandir)/fr/man1/dmg2dir.1.gz 45 | 46 | .PHONY: po man clean install 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DMG2DIR 2 | 3 | DMG2DIR is a Bash script which can **extract a macOS application** from a DMG file. DMG files are HFS+ disk image. 4 | 5 | The DMG file can be extracted to a directory or converted to an ISO file. 6 | 7 | ## Dependencies 8 | 9 | - gettext 10 | - translate strings 11 | - https://www.gnu.org/software/gettext 12 | 13 | - _hfsplus_ module 14 | - Allow to mount IMG file (an HFS+ disk image) 15 | - `modinfo hfsplus` 16 | 17 | - dmg2img 18 | - Convert DMG file to IMG file 19 | - http://vu1tur.eu.org/tools/ 20 | 21 | - udisks2 22 | - Mount IMG file 23 | - http://www.freedesktop.org/wiki/Software/udisks/ 24 | 25 | - cdrtools/cdrkit (optionnal) 26 | - Make an ISO file (provides command genisoimage) 27 | - http://cdrecord.org 28 | 29 | - Darling (optionnal) 30 | - Run the macOS application 31 | - http://www.darlinghq.org 32 | 33 | ## Installation 34 | 35 | To install DMG2DIR on your system: 36 | 37 | ``` 38 | # make install 39 | ``` 40 | 41 | You can change default PREFIX by using: 42 | 43 | ``` 44 | # make PREFIX=/absolute_path install 45 | ``` 46 | 47 | ## Usage 48 | 49 | From a shell, type following command: 50 | 51 | ``` 52 | $ dmg2dir [OPTIONS] dmg_file.dmg 53 | ``` 54 | 55 | Use argument `--help` to see all options, or read the man-page with `man dmg2dir`. 56 | -------------------------------------------------------------------------------- /dmg2dir: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################################################# 4 | # ENVIRONMENT # 5 | ################################################################################################# 6 | [[ -n $DEBUG ]] && [[ $DEBUG != 0 ]] && set -x 7 | 8 | export TEXTDOMAINDIR=@TEXTDOMAINDIR@ 9 | export TEXTDOMAIN=dmg2dir 10 | prgname="dmg2dir" 11 | issueurl="https://github.com/X0rg/dmg2dir/issues" 12 | siteurl="https://github.com/X0rg" 13 | udiskcmd=$(command -v udisksctl) 14 | geniso=$(command -v genisoimage) 15 | darling=$(command -v dyld) 16 | version="3.1.1" 17 | critical=0 18 | fail=false 19 | 20 | name= # -n 21 | savepath= # -p 22 | tmpdir="/tmp/$prgname" # -t 23 | run=false # -r 24 | iso=false # -i 25 | noappdir=false # -d 26 | quiet= # -q 27 | verbose1= # -v 28 | verbose2= # -vv 29 | overwriteimg=false # --overwrite-img 30 | overwritedir=false # --overwrite-dir 31 | overwriteiso=false # --overwrite-iso 32 | 33 | 34 | ################################################################################################# 35 | # COMMONS FUNCTIONS # 36 | ################################################################################################# 37 | msg() { 38 | local str="$1" 39 | 40 | if ! [[ -n "$quiet" ]]; then 41 | shift 42 | printf "\033[1;32m==>\033[0;1m $(gettext -s "$str")\033[0m\n" "$@" 43 | fi 44 | } 45 | 46 | msgverbose1() { 47 | local str="$1" 48 | 49 | if [[ -n "$verbose1" ]]; then 50 | shift 51 | printf "\033[1;34m ->\033[0m $(gettext -s "$str")\n" "$@" 52 | fi 53 | } 54 | 55 | msgverbose2() { 56 | local str="$1" 57 | 58 | if [[ -n "$verbose2" ]]; then 59 | shift 60 | printf " $(gettext -s "$str")\n" "$@" 61 | fi 62 | } 63 | 64 | msgwarning() { 65 | local str="$1" 66 | 67 | shift 68 | printf "\033[1;33m$(gettext -s "$str")\033[0m\n" "$@" 69 | } 70 | 71 | msgerror() { 72 | local error="$1" 73 | local str="$2" 74 | 75 | if ! $fail; then 76 | fail=true 77 | shift 78 | shift 79 | 80 | printf "\033[1;31m$(gettext -s "$str")\033[0m" "$@" 81 | printf "\033[1;31m$(gettext -s ' (error %i).')\033[0m\n" "$error" 82 | 83 | # Clean 84 | $iso && rm -rf $verbose1 "$vtree" 85 | 86 | if [[ $critical == 2 ]] ; then 87 | for part in ${loop}p*; do 88 | umountpart $part 89 | done 90 | fi 91 | 92 | if [[ $critical > 0 ]] ; then 93 | delloop 94 | fi 95 | fi 96 | 97 | exit $error 98 | } 99 | 100 | usage() { 101 | gettext -es "Usage: %s [OPTIONS] dmg_file.dmg" 102 | gettext -es "Options:" 103 | gettext -es "\t-n, --name\t\tCustom name for application directory" 104 | gettext -es "\t-p, --path\t\tCustom path for application directory" 105 | gettext -es "\t-t, --tmp\t\tCustom temporary directory" 106 | gettext -es "\t-r, --run\t\tAttempt to run extracted application (using Darling)" 107 | gettext -es "\t-i, --iso\t\tGenerate an ISO file from IMG file (using Genisoimage)" 108 | gettext -es "\t-d, --iso-only\t\tSame as --iso, without creating application directory" 109 | gettext -es "\t-q, --quiet\t\tBe silent" 110 | gettext -es "\t-v, --verbose\t\tBe verbose (-vv for very verbose)" 111 | gettext -es "\t-V, --version\t\tDisplay script version and exit" 112 | gettext -es "\t-h, --help\t\tDisplay this help and exit" 113 | gettext -es "\t --overwrite-img\t\tOverwrite existing IMG file" 114 | gettext -es "\t --overwrite-dir\t\tOverwrite existing application directory" 115 | gettext -es "\t --overwrite-iso\t\tOverwrite existing ISO file" 116 | printf "$(gettext -s '\nPlease report issues here: %s.\n')" "$issueurl" 117 | } 118 | 119 | version() { 120 | echo -e "$prgname $version" 121 | echo -e "Copyleft 2018." 122 | echo -e "$siteurl" 123 | } 124 | 125 | 126 | ################################################################################################# 127 | # VERIFIES FUNCTIONS # 128 | ################################################################################################# 129 | checkdep() { 130 | local command="$1" 131 | local depname="$2" 132 | local code="$3" 133 | 134 | if [[ -z "$command" ]]; then 135 | msgerror "$code" "Dependency %s is required" "$depname" 136 | fi 137 | } 138 | 139 | checkfile() { 140 | local file="$1" 141 | local code="$2" 142 | 143 | if [[ ! -f "$file" ]]; then 144 | msgerror "$code" "File %s doesn't exist" "$file" 145 | fi 146 | } 147 | 148 | checkvar() { 149 | local var="$1" 150 | local code="$2" 151 | 152 | if [[ -z "$var" ]]; then 153 | msgerror "$code" "Variable is empty" 154 | fi 155 | } 156 | 157 | checkdir() { 158 | local directory="$1" 159 | local code="$2" 160 | 161 | if [[ ! -d "$directory" ]]; then 162 | msgerror "$code" "Directory %s doesn't exist" "$directory" 163 | elif [[ -z "$(ls -A $directory)" ]]; then 164 | msgerror "$code" "Directory %s is empty" "$directory" 165 | fi 166 | } 167 | 168 | checkret() { 169 | local ret="$1" 170 | local code="$2" 171 | 172 | if [[ $ret != 0 ]]; then 173 | msgerror "$code" "Command fails" 174 | fi 175 | } 176 | 177 | 178 | ################################################################################################# 179 | # MAIN FUNCTIONS # 180 | ################################################################################################# 181 | convertdmg() { 182 | msgverbose1 "Converting %s to %s" "$filetoconvert" "$tmpdir/$name.img" 183 | dmg2img $quiet $verbose1 $verbose2 -i "$filetoconvert" -o "$tmpdir/$name.img" 184 | checkret "$?" 10 185 | checkfile "$tmpdir/$name.img" 11 186 | } 187 | 188 | addloop() { 189 | msgverbose1 "Setting up loop device for file %s" "$tmpdir/$name.img" 190 | loop=$($udiskcmd loop-setup --no-user-interaction --read-only --file "$tmpdir/$name.img") 191 | checkvar "$loop" 20 192 | msgverbose2 "$loop" 193 | critical=1 194 | 195 | msgverbose1 "Retrieving loop device name" 196 | loop=${loop%.} 197 | loop=${loop#*/dev/loop} 198 | checkvar "$loop" 21 199 | loop="/dev/loop$loop" 200 | msgverbose2 "$loop" 201 | } 202 | 203 | mountpart() { 204 | local part=$1 205 | local mountpoint=$(findmnt --noheadings --output TARGET $part) 206 | 207 | if [[ -z "$mountpoint" ]]; then 208 | msgverbose1 "Mounting loop device partition %s" "$part" 209 | $udiskcmd mount --block-device $part > $output 210 | mountpoint=$(findmnt --noheadings --output TARGET $part) 211 | else 212 | msgverbose1 "Skip mounting of loop device partition %s" "$part" 213 | fi 214 | checkvar "$mountpoint" 30 215 | msgverbose2 "$mountpoint" 216 | critical=2 217 | mountpoints+=([$part]="$mountpoint") 218 | 219 | if $iso; then 220 | local label=$(basename "$mountpoint") 221 | msgverbose1 "Creating virtual tree %s" "$tmpdir/$name/$label" 222 | ln -sf $verbose1 "$mountpoint" "$tmpdir/$name/$label" 223 | fi 224 | } 225 | 226 | copydir() { 227 | local part=$1 228 | local mountpoint=${mountpoints[$part]} 229 | 230 | msgverbose1 "Copying files from %s to application directory" "$mountpoint" 231 | cp -Rau $verbose1 "$mountpoint" "$appdir" 232 | checkdir "$appdir" 40 233 | } 234 | 235 | convertiso() { 236 | [[ -n "$quiet" ]] && local genisoquiet="-quiet" 237 | 238 | msgverbose1 "Generating ISO file from virtual tree %s" "$vtree" 239 | $geniso $genisoquiet $verbose1 -V "$name" -iso-level 3 -UDF -R -probe -g -posix-L -o "$appdir.iso" "$vtree" 240 | checkfile "$appdir.iso" 50 241 | } 242 | 243 | umountpart() { 244 | local part=$1 245 | 246 | msgverbose1 "Unmounting loop device partition %s" "$part" 247 | $udiskcmd unmount --no-user-interaction --force --block-device $part > $output 248 | checkret "$?" 60 249 | critical=1 250 | } 251 | 252 | delloop() { 253 | if [[ -f $loop* ]]; then 254 | msgverbose1 "Deleting loop device %s" "$loop" 255 | $udiskcmd loop-delete --no-user-interaction --block-device $loop > $output 256 | checkret "$?" 70 257 | fi 258 | critical=0 259 | } 260 | 261 | launcher() { 262 | msgverbose1 "Searching for executable in application directory" 263 | find "$appdir"/*/*.app/Contents/MacOS -exec file '{}' \; | grep "Mach-O" | grep "executable" | cut -f1 -d: | while IFS= read -r executable; do 264 | msgverbose1 "Found file %s, launch it with dyld" "$executable" 265 | dyld "$executable" 266 | done 267 | } 268 | 269 | 270 | ################################################################################################# 271 | # MAIN # 272 | ################################################################################################# 273 | # Args 274 | OPTS=`getopt -o n:p:t:ridqvwVh --long name:,path:,tmp:,run,iso,iso-only,quiet,verbose,version,help,overwrite-img,overwrite-dir,overwrite-iso -n $prgname -- "$@"` 275 | if [[ $? != 0 ]]; then 276 | msgerror 1 "Failed parsing options" 277 | fi 278 | 279 | eval set -- "$OPTS" 280 | while true; do 281 | case "$1" in 282 | -n|--name) shift; name="$1";; 283 | -p|--path) shift; savepath="$1";; 284 | -t|--tmp) shift; tmpdir="$1";; 285 | -r|--run) checkdep "$darling" "Darling" 1; run=true;; 286 | -i|--iso) checkdep "$geniso" "cdrtools/cdrkit" 1; iso=true;; 287 | -d|--iso-only) checkdep "$geniso" "cdrtools/cdrkit" 1; iso=true; noappdir=true;; 288 | -q|--quiet) quiet="-s";; 289 | -v|--verbose) unset quiet; [[ -z $verbose1 ]] && verbose1="-v" || verbose2="-V";; 290 | -V|--version) version; exit 0;; 291 | -h|--help) usage; exit 0;; 292 | --overwrite-img) overwriteimg=true;; 293 | --overwrite-dir) overwritedir=true;; 294 | --overwrite-iso) overwriteiso=true;; 295 | --) shift; break;; 296 | *) gettext -es "Internal error"; exit 1;; 297 | esac 298 | shift 299 | done 300 | 301 | # Prerequisites 302 | msg "Checking prerequisites..." 303 | filetoconvert="$1" 304 | if [[ -z "$filetoconvert" ]]; then 305 | usage 306 | exit 1 307 | fi 308 | if [[ ! -f "$filetoconvert" ]]; then 309 | msgerror 2 "File %s doesn't exist" "$filetoconvert" 310 | fi 311 | checkdep "$udiskcmd" "udisks2" 1 312 | 313 | # Variables 314 | msg "Setting variables..." 315 | declare -A mountpoints 316 | [[ -z "$name" ]] && name=$(basename "$filetoconvert" .dmg) 317 | [[ -z "$savepath" ]] && savepath=$(dirname "$filetoconvert") 318 | [[ -z "$verbose2" ]] && output="/dev/null" || output="/dev/stdout" 319 | appdir="$savepath/$name" 320 | vtree="$tmpdir/$name" 321 | 322 | if ! $noappdir && ! $overwritedir && [[ -e "$appdir" ]]; then 323 | msgerror 3 "Directory %s already exists. Use --overwrite-dir to overwrite it" "$appdir" 324 | fi 325 | if $iso && ! $overwriteiso && [[ -e "$appdir.iso" ]]; then 326 | msgerror 4 "File %s already exists. Use --overwrite-iso to overwrite it" "$appdir.iso" 327 | fi 328 | 329 | # Temporary directories 330 | msg "Making temporary working directories..." 331 | mkdir -p $verbose1 "$tmpdir" 332 | $iso && mkdir -p $verbose1 "$vtree" 333 | 334 | # Conversion 335 | msg "Converting DMG file to an IMG file..." 336 | if [[ ! -f "$tmpdir/$name.img" ]] || $overwriteimg; then 337 | convertdmg 338 | else 339 | msgwarning "File %s already exists. Skipping conversion. Use --overwrite-img to overwrite it." "$tmpdir/$name.img" 340 | fi 341 | 342 | # Mount 343 | msg "Setting loop device..." 344 | addloop 345 | for part in ${loop}p*; do 346 | mountpart $part 347 | done 348 | 349 | # Extraction (directory) 350 | if ! $noappdir; then 351 | msg "Extracting files to %s..." "$appdir" 352 | mkdir -p $verbose1 "$appdir" 353 | for part in ${loop}p*; do 354 | copydir $part 355 | done 356 | fi 357 | 358 | # Extraction (ISO) 359 | if $iso; then 360 | msg "Creating ISO file %s..." "$appdir.iso" 361 | convertiso 362 | fi 363 | 364 | # Clean 365 | msg "Cleaning..." 366 | $iso && rm -rf $verbose1 "$vtree" 367 | for part in ${loop}p*; do 368 | umountpart $part 369 | done 370 | delloop 371 | 372 | # Run 373 | if $run && ! $noappdir; then 374 | msg "Trying to run extracted application with Darling..." 375 | launcher 376 | fi 377 | 378 | exit 0 379 | 380 | # Written by Xorg (https://github.com/X0rg/dmg2dir). Copyleft 2018. 381 | -------------------------------------------------------------------------------- /docs/en.1: -------------------------------------------------------------------------------- 1 | .\" Manpage for dmg2dir (English). 2 | .TH DMG2DIR 1 "September 2018" "3.1.0" "DMG2DIR manual" 3 | .SH NAME 4 | dmg2dir \- extract macOS applications from DMG file. 5 | .SH SYNOPSIS 6 | \fBdmg2dir\fR [\fIOPTIONS\fR] dmg_file.dmg 7 | .SH DESCRIPTION 8 | DMG2DIR is a shell script which extract macOS application from a DMG file. Without any option, DMG file will be extracted in a directory (called application directory). 9 | .SH OPTIONS 10 | .B \-n, \-\-name 11 | .RS 4 12 | Custom name for application directory. 13 | Set application directory name. If not specified, default value is the name of DMG file. 14 | .RE 15 | .PP 16 | .B \-p, \-\-path 17 | .RS 4 18 | Custom path for application directory. 19 | Set where to save files. If not specified, default value is the same directory as DMG file. 20 | .RE 21 | .PP 22 | .B \-t, \-\-tmp 23 | .RS 4 24 | Custom temporary directory. 25 | Set where to save temporary files. Default value is \fI/tmp/dmg2dir\fR. 26 | \fBWarning:\fR large files can saturate memory if \fI/tmp\fR is mounted as \fBtmpfs\fR. 27 | .RE 28 | .PP 29 | .B \-r, \-\-run 30 | .RS 4 31 | Attempt to run extracted application. 32 | If \fBDarling\fR is installed, try to run the extracted application. 33 | \fBNote:\fR Cannot be used with \fB--iso-only\fR. 34 | .RE 35 | .PP 36 | .B \-i, \-\-iso 37 | .RS 4 38 | Generate an ISO file from IMG file. 39 | If \fBGenisoimage\fR is installed, convert DMG file to an ISO file besides the application directory. 40 | .RE 41 | .PP 42 | .B \-d, \-\-iso-only 43 | .RS 4 44 | Same as \fB--iso\fR, without creating application directory. 45 | If \fBGenisoimage\fR is installed, convert DMG file to an ISO file. No application directory will be created. 46 | .RE 47 | .PP 48 | .B \-q, \-\-quiet 49 | .RS 4 50 | Be silent. 51 | Run without printing anything. 52 | .RE 53 | .PP 54 | .B \-v, \-\-verbose 55 | .RS 4 56 | Be verbose. 57 | Print more output during processing. 58 | Use \fB-vv\fR to increase verbosity. 59 | .RE 60 | .PP 61 | .B \-V, \-\-version 62 | .RS 4 63 | Display script version and exit. 64 | .RE 65 | .PP 66 | .B \-h, \-\-help 67 | .RS 4 68 | Display help and exit. 69 | .RE 70 | .PP 71 | .B \-\-overwrite-img 72 | .RS 4 73 | Overwrite existing IMG file. 74 | Replace IMG file if it already exists, otherwise skip extraction. 75 | .RE 76 | .PP 77 | .B \-\-overwrite-dir 78 | .RS 4 79 | Overwrite existing application directory. 80 | Replace application directory if it already exists. 81 | Use \fB--name\fR or \fB--path\fR if you want to extract DMG file without overwriting application directory. 82 | .RE 83 | .PP 84 | .B \-\-overwrite-iso 85 | .RS 4 86 | Overwrite existing ISO file. 87 | Replace ISO file if it already exists. 88 | Use \fB--name\fR or \fB--path\fR if you want to extract DMG file without overwriting ISO file. 89 | .RE 90 | .SH EXIT STATUS 91 | .B 0 92 | Successful program execution. 93 | .RE 94 | .PP 95 | .B !0 96 | Failed program execution. 97 | .SH ENVIRONMENT 98 | .B DEBUG 99 | .RS 4 100 | If $\fBDEBUG\fR is set, print every command executed. 101 | .RE 102 | .SH BUGS 103 | Please report bugs by opening a new issue here: \fIhttps://github.com/X0rg/dmg2dir/issues\fR. 104 | .SH AUTHOR 105 | Xorg (https://github.com/X0rg/dmg2dir) 106 | -------------------------------------------------------------------------------- /docs/fr.1: -------------------------------------------------------------------------------- 1 | .\" Manpage for dmg2dir (French). 2 | .TH DMG2DIR 1 "Septembre 2018" "3.1.0" "Manuel de DMG2DIR" 3 | .SH NOM 4 | dmg2dir \- extraire les applications macOS depuis un fichier DMG. 5 | .SH SYNOPSIS 6 | \fBdmg2dir\fR [\fIOPTIONS\fR] fichier_dmg.dmg 7 | .SH DESCRIPTION 8 | DMG2DIR est un script shell qui extrait les applications macOS depuis un fichier DMG. Sans option, le fichier DMG sera extrait dans ub répertoire (appelé répertoire de l'application). 9 | .SH OPTIONS 10 | .B \-n, \-\-name 11 | .RS 4 12 | Nom personnalisé du répertoire de l'application. 13 | Définit le nom répertoire de l'application. Si ce paramètre n'est pas spécifié, la valeur par défaut est le nom du fichier DMG. 14 | .RE 15 | .PP 16 | .B \-p, \-\-path 17 | .RS 4 18 | Chemin personnalisé pour le répertoire de l'application. 19 | Définit où sauvegarder les fichiers. Si ce paramètre n'est pas spécifié, la valeur par défaut est le même répertoire que le fichier DMG. 20 | .RE 21 | .PP 22 | .B \-t, \-\-tmp 23 | .RS 4 24 | Répertoire temporaire personnalisé. 25 | Définit où sauvegarder les fichies temporaires. La valeur par défaut est \fI/tmp/dmg2dir\fR. 26 | \fBAttention :\fR les fichiers volumineux peuvent saturer la mémoire si \fI/tmp\fR est monté en tant que \fBtmpfs\fR. 27 | .RE 28 | .PP 29 | .B \-r, \-\-run 30 | .RS 4 31 | Tente d'exécuter l'application extraite. 32 | Si \fBDarling\fR est installé, essaye d'exécuter l'application extraite. 33 | \fBNote :\fR Ne peut pas être utilisé avec \fB--iso-only\fR. 34 | .RE 35 | .PP 36 | .B \-i, \-\-iso 37 | .RS 4 38 | Génère un fichier ISO à partir du fichier IMG. 39 | Si \fBGenisoimage\fR est installé, convertit le fichier DMG en un fichier ISO en plus du répertoire de l'application. 40 | .RE 41 | .PP 42 | .B \-d, \-\-iso-only 43 | .RS 4 44 | Comme \fB--iso\fR, sans créer le répertoire de l'application. 45 | Si \fBGenisoimage\fR est installé, convertit le fichier DMG en un fichier ISO. Le répertoire de l'application ne sera pas créé. 46 | .RE 47 | .PP 48 | .B \-q, \-\-quiet 49 | .RS 4 50 | S'exécute silencieusement. 51 | S'exécute sans rien afficher. 52 | .RE 53 | .PP 54 | .B \-v, \-\-verbose 55 | .RS 4 56 | S'exécute verbeusement. 57 | Affiche plus de sortie durant le traitement. 58 | Utilisez \fB-vv\fR pour augmenter la verbosité. 59 | .RE 60 | .PP 61 | .B \-V, \-\-version 62 | .RS 4 63 | Affiche la version du script et quitte. 64 | .RE 65 | .PP 66 | .B \-h, \-\-help 67 | .RS 4 68 | Affiche l'aide et quitte. 69 | .RE 70 | .PP 71 | .B \-\-overwrite-img 72 | .RS 4 73 | Écrase le fichier IMG existant. 74 | Remplace le fichier IMG s'il existe déjà, autrement saute l'extraction. 75 | .RE 76 | .PP 77 | .B \-\-overwrite-dir 78 | .RS 4 79 | Écrase le répertoire de l'application existant. 80 | Remplace le répertoire de l'application s'il existe déjà. 81 | Utilisez \fB--name\fR ou \fB--path\fR si vous voulez extraire le fichier DMG sans écraser le répertoire de l'application. 82 | .RE 83 | .PP 84 | .B \-\-overwrite-iso 85 | .RS 4 86 | Écrase le fichier ISO existant. 87 | Remplace le fichier ISO s'il existe déjà. 88 | Utilisez \fB--name\fR ou \fB--path\fR si vous voulez extraire le fichier DMG sans écraser le fichier ISO. 89 | .RE 90 | .SH CODE DE RETOUR 91 | .B 0 92 | Programme exécuté sans erreur. 93 | .RE 94 | .PP 95 | .B !0 96 | Programme exécuté avec erreur. 97 | .SH ENVIRONNEMENT 98 | .B DEBUG 99 | .RS 4 100 | Si $\fBDEBUG\fR est définie, affiche toutes les commandes exécutées. 101 | .RE 102 | .SH BOGUES 103 | Merci de raporter les bogues en ouvrant un nouveau problème ("\fBNew issue\fR") ici : \fIhttps://github.com/X0rg/dmg2dir/issues\fR. 104 | .SH AUTEUR 105 | Xorg (https://github.com/X0rg/dmg2dir) 106 | -------------------------------------------------------------------------------- /po/fr.po: -------------------------------------------------------------------------------- 1 | ################################################################################################# 2 | # COMMONS FUNCTIONS # 3 | ################################################################################################# 4 | msgid " (error %i)." 5 | msgstr " (erreur %i)." 6 | 7 | msgid "Usage: %s [OPTIONS] dmg_file.dmg" 8 | msgstr "Usage : %s [OPTIONS] fichier_dmg.dmg" 9 | 10 | msgid "Options:" 11 | msgstr "Options :" 12 | 13 | msgid "\t-n, --name\t\tCustom name for application directory" 14 | msgstr "\t-n, --name\t\tNom personnalisé du répertoire de l'application" 15 | 16 | msgid "\t-p, --path\t\tCustom path for application directory" 17 | msgstr "\t-p, --path\t\tChemin personnalisé pour le répertoire de l'application" 18 | 19 | msgid "\t-t, --tmp\t\tCustom temporary directory" 20 | msgstr "\t-t, --tmp\t\tRépertoire temporaire personnalisé" 21 | 22 | msgid "\t-r, --run\t\tAttempt to run extracted application (using Darling)" 23 | msgstr "\t-r, --run\t\tTente d'exécuter l'application extraite (en utilisant Darling)" 24 | 25 | msgid "\t-i, --iso\t\tGenerate an ISO file from IMG file (using Genisoimage)" 26 | msgstr "\t-i, --iso\t\tGénère un fichier ISO à partir du fichier IMG (en utilisant Genisoimage)" 27 | 28 | msgid "\t-d, --iso-only\t\tSame as --iso, without creating application directory" 29 | msgstr "\t-d, --iso-only\t\tComme --iso, sans créer le répertoire de l'application" 30 | 31 | msgid "\t-q, --quiet\t\tBe silent" 32 | msgstr "\t-q, --quiet\t\tS'exécute silencieusement" 33 | 34 | msgid "\t-v, --verbose\t\tBe verbose (-vv for very verbose)" 35 | msgstr "\t-v, --verbose\t\tS'exécute verbeusement (-vv pour très verbeux)" 36 | 37 | msgid "\t-V, --version\t\tDisplay script version and exit" 38 | msgstr "\t-V, --version\t\tAffiche la version du script et quitte" 39 | 40 | msgid "\t-h, --help\t\tDisplay this help and exit" 41 | msgstr "\t-h, --help\t\tAffiche cette aide et quitte" 42 | 43 | msgid "\t --overwrite-img\t\tOverwrite existing IMG file" 44 | msgstr "\t --overwrite-img\t\tÉcrase le fichier IMG existant" 45 | 46 | msgid "\t --overwrite-dir\t\tOverwrite existing application directory" 47 | msgstr "\t --overwrite-img\t\tÉcrase le répertoire de l'application existant" 48 | 49 | msgid "\t --overwrite-iso\t\tOverwrite existing ISO file" 50 | msgstr "\t --overwrite-img\t\tÉcrase le fichier ISO existant" 51 | 52 | msgid "\nPlease report issues here: %s." 53 | msgstr "\nMerci de rapporter les problèmes ici : %s." 54 | 55 | 56 | ################################################################################################# 57 | # VERIFIES FUNCTIONS # 58 | ################################################################################################# 59 | msgid "Dependency %s is required" 60 | msgstr "La dépendance %s est requise" 61 | 62 | msgid "File %s doesn't exist" 63 | msgstr "Le fichier %s n'existe pas" 64 | 65 | msgid "Variable is empty" 66 | msgstr "La variable est vide" 67 | 68 | msgid "Directory %s doesn't exist" 69 | msgstr "Le répertoire %s n'existe pas" 70 | 71 | msgid "Directory %s is empty" 72 | msgstr "Le répertoire %s est vide" 73 | 74 | msgid "Command fails" 75 | msgstr "La commande a échouée" 76 | 77 | 78 | ################################################################################################# 79 | # MAIN FUNCTIONS # 80 | ################################################################################################# 81 | msgid "Converting %s to %s" 82 | msgstr "Conversion de %s en %s" 83 | 84 | msgid "Setting up loop device for file %s" 85 | msgstr "Mise en place du périphérique loop pour le fichier %s" 86 | 87 | msgid "Retrieving loop device name" 88 | msgstr "Récupération du nom du périphérique loop" 89 | 90 | msgid "Mounting loop device partition %s" 91 | msgstr "Montage de la partition %s du périphérique loop" 92 | 93 | msgid "Skip mounting of loop device partition %s" 94 | msgstr "Saute le montage de la partition %s du périphérique loop" 95 | 96 | msgid "Creating virtual tree %s" 97 | msgstr "Création de l'arbre virtuel %s" 98 | 99 | msgid "Copying files from %s to application directory" 100 | msgstr "Copie les fichiers depuis %s vers le répertoire de l'application" 101 | 102 | msgid "Generating ISO file from virtual tree %s" 103 | msgstr "Génération du fichier ISO à partir de l'arbre virtuel %s" 104 | 105 | msgid "Unmounting loop device partition %s" 106 | msgstr "Démontage de la partition %s du périphérique loop" 107 | 108 | msgid "Deleting loop device %s" 109 | msgstr "Suppression du périphérique loop %s" 110 | 111 | msgid "Searching for executable in application directory" 112 | msgstr "Recherche un exécutable dans le répertoire de l'application" 113 | 114 | msgid "Found file %s, launch it with dyld" 115 | msgstr "Fichier %s trouvé, lancement avec dyld" 116 | 117 | 118 | ################################################################################################# 119 | # MAIN # 120 | ################################################################################################# 121 | msgid "Failed parsing options" 122 | msgstr "Échec lors de l'analyse des options" 123 | 124 | msgid "Internal error" 125 | msgstr "Erreur interne" 126 | 127 | msgid "Checking prerequisites..." 128 | msgstr "Vérification des pré-requis..." 129 | 130 | msgid "Setting variables..." 131 | msgstr "Prépare des variables..." 132 | 133 | msgid "Directory %s already exists. Use --overwrite-dir to overwrite it" 134 | msgstr "Le répertoire %s existe déjà. Utilisez --overwrite-dir pour l'écraser" 135 | 136 | msgid "File %s already exists. Use --overwrite-iso to overwrite it" 137 | msgstr "Le fichier %s existe déjà. Utilisez --overwrite-iso pour l'écraser" 138 | 139 | msgid "Making temporary working directories..." 140 | msgstr "Création des répertoires de travail temporaires..." 141 | 142 | msgid "Converting DMG file to an IMG file..." 143 | msgstr "Conversion du fichier DMG en un fichier IMG..." 144 | 145 | msgid "File %s already exists. Skipping conversion. Use --overwrite-img to overwrite it." 146 | msgstr "Le fichier %s existe déjà. Saute la conversion. Utilisez --overwrite-img pour l'écraser." 147 | 148 | msgid "Setting loop device..." 149 | msgstr "Prépare le périphérique loop..." 150 | 151 | msgid "Extracting files to %s..." 152 | msgstr "Extraction des fichiers vers %s..." 153 | 154 | msgid "Creating ISO file %s..." 155 | msgstr "Création du fichier ISO %s..." 156 | 157 | msgid "Cleaning..." 158 | msgstr "Nettoyage..." 159 | 160 | msgid "Trying to run extracted application with Darling..." 161 | msgstr "Essaye d'exécuter le fichier binaire avec Darling..." 162 | --------------------------------------------------------------------------------