Skip to content

Comments

Adding processing for new label property 'folderName', adds chemdoodle label#783

Closed
bartreardon wants to merge 0 commit intoInstallomator:mainfrom
bartreardon:main
Closed

Adding processing for new label property 'folderName', adds chemdoodle label#783
bartreardon wants to merge 0 commit intoInstallomator:mainfrom
bartreardon:main

Conversation

@bartreardon
Copy link
Collaborator

This update allows for cases where the app is within a folder within a DMG where the distribution requires the parent folder containing the app needs to be copied to the destination, not just the app itself (should also work for ZIP but I haven't come across an example where this would be required).

Example:
AppName.dmg when mounted contains a folder AppFolderName which contains the app bundle but also other related content (companion apps, settings etc)
When mounted the folder structure will be /Volumes/AppName/AppFolderName/AppName.app
This change will let you specify AppFolderName in the label. Verification will still occur on AppName.app after which AppFolderName and its contents will be copied into place.

Changes are:

  • New label property folderName
  • Update to installAppWithPath to take a folderPath argument. Will still perform all the same checks on $appPath but instead of ditto -v "$appPath" to install the app it performs ditto -v "$folderPath"
  • Function installFromDMG() updated to handle folderPath

As written, installFromDMG will always pass in two arguments to installAppWithPath. The check in installAppWithPath will verify if it has an actual value or "$dmgmount/ with no folder path by looking for a trailing /. Optionally could make installFromDMG only pass the argument if required but we are doing the verification anyway.

Also, this change will preserve removing of the app bundle if an earlier version exists, but does not remove the parent folder. This is partially intentional as there may be app configuration however it may be desirable to either allow (or explicitly disallow) removal of the parent folder during an update. In testing the current behaviour didn't present an issue though.

Included in the PR is a label for an app where this is the case (ChemDoodle) but the format would look something like:

applabel)
     name="AppName"
     type="dmg"
     downloadURL="https://some/url/AppName.dmg"
     expectedTeamID="ABC1234"
     folderName="AppFolderName"
     appName="${folderName}/AppName.app"
     appNewVersion=$(...)
     ;;

Tested with ChemDoodle and also verified this should not break any existing functionality (not in the labels I tested at least)

@scriptingosx scriptingosx added the feature New feature or request label Nov 24, 2022
@scriptingosx scriptingosx added this to the v11 milestone Nov 24, 2022
@bartreardon
Copy link
Collaborator Author

oh - it added the last commit to this pr....was hoping to make that a seperate pr. :/

@Theile
Copy link
Collaborator

Theile commented Nov 25, 2022

Wow, these last changes are for me. Correcting --moveable. I'm working on adding --overlayicon as well. You can revert the commit if you like. I got this. Thanks!

@bartreardon
Copy link
Collaborator Author

Can do 🙂 - although movable is a perfectly cromulent word so I'm going to add that in as a valid spelling of the argument.

@scriptingosx scriptingosx changed the title Adding processing for new label property 'folderName' Adding processing for new label property 'folderName', adds chemdoodle label Jan 6, 2023
@bartreardon
Copy link
Collaborator Author

Found a bug in the chemdoodle labels introduced as the vendor has updated their download page somewhat. the downloadURL should work correctly now.

@bartreardon
Copy link
Collaborator Author

I need to re-submit this PR - too many files got added to other branches and it was a pain to try and keep things in check.

@bartreardon
Copy link
Collaborator Author

oh wait - I don't need to as that is included here. didn't realise it was merged in ed83af9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants