macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
286 stars 62 forks source link

Including userscript in IA package will not work #85

Open kbotnen opened 3 years ago

kbotnen commented 3 years ago

Hi,

Not sure if it should be a priority to do anything with this, or just add as a NB to the documentation.

This will not work, scenario 1:

    {
      "file": "/Library/installapplications/userscripts/depnotify_user_launcher.py",
      "hash": "sha256_hash_goes_here",
      "name": "DEPNotify User Launcher",
      "type": "userscript"
    }

This will work, scenario 2:

  {
      "file": "/Library/installapplications/userscripts/depnotify_user_launcher.py",
      "hash": "sha256_hash_goes_here",
      "name": "DEPNotify User Launcher",
      "type": "userscript",
      "url": "https://raw.githubusercontent.com/erikng/installapplicationsdemo/master/installapplications/scripts/user/depnotify_user_launcher.py"
    }

The difference is that in scenario 1, everything is included in the InstallApplication.pkg, in scenario 2, it is downloaded from the Internet.

In scenario 1, the userscripts folder does exist at the time installapplications.py is checking for existance of needed folders (lines: 474-479), which will bypass the creation of the folder /var/tmp/installapplications (which again is needed for /var/tmp/installapplications/.userscript).

K

erikng commented 3 years ago

Interesting find. When I first wrote this tool, I honestly did not envision it having everything bundled - that kind of goes against what most people experience as they debug and iterate.

It running bundled was a happy accident. I'm happy to merge a PR that addresses this, but it's a very low priority for me to write and test a solution here.