homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
301 stars 28 forks source link

Need to unmount DMG if RecipeRobot mounted it but gives up #87

Open SmithersJr opened 9 years ago

SmithersJr commented 9 years ago

Dragging the [OneDrive for Business for Mac Preview DMG](https://download.microsoft.com/download/D/9/8/D98389DB-5946-412C-A0A6-44808C19F99C/OneDriveForBusinessMacPreview.dmg, https://www.microsoft.com/en-us/download/confirmation.aspx?id=45519) to Recipe Robot fails:


                      -----------------------------------
                     |   Welcome to Recipe Robot v1.0.   |
                      -----------------------------------
                                \   _[]_
                                 \  [oo]
                                   d-||-b
                                     ||
                                   _/  \_

Processing /Users/username/Downloads/OneDriveForBusinessMacPreview.dmg ...
Input path looks like a disk image.
    Successfully mounted disk image
Checking whether package is signed...
    Package is signed
Getting developer from pkg signature...
    Developer is: Microsoft Corporation
Getting package signature authority names...
    3 authority names recorded
Expanding package to look for clues...
    Package expanded to: /Users/username/Library/Caches/Recipe Robot/2015-12-04_13-24-42_705123/expanded
Getting information from PackageInfo file...
    Bundle identifier: com.microsoft.pkg.OneDriveBusinessMac
    Install location: /Applications
    Install filename: Applications
Extracting the package payload to see if we can find an app...
    Did not find an app in the package payload
[ERROR] I wasn't able to determine the name of this app, so I can't make any recipes.
[ERROR] 
                                    _[]_
                                    [xx]
                                   q-||-p
                                     ||
                                   _/  \_



The problem is that Recipe Robot cleans up its cache but doesn't unmount the DMG (which is not visible in Finder). So, the user can't open the DMG until they umount /Volumes/OneDriveBusinessMacInstaller/.

homebysix commented 8 years ago

Under normal circumstances, if the dmg inspection completes successfully, the disk image should be unmounted. (As instructed here.) However, I think the problem you've discovered relates to the fact that Recipe Robot is unable to find an app in the downloaded dmg file. Right now, that's a fatal error, but it doesn't throw the standard LogLevel.ERROR because there's hope that someday we'll detect things other than apps. (A pkg file that installs a QuickLook plugin for example.)

I'll keep this issue open to remind me that when we improve the pkg inspection engine, we should make sure to tie up the loose ends when errors occur.

Thanks!