Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including rootscript in IA package will break if url is present, but empty #86

Open
kbotnen opened this issue Jan 12, 2021 · 0 comments

Comments

@kbotnen
Copy link

kbotnen commented Jan 12, 2021

Stumbled upon this issue. It is only a problem if you bundle stuff into a package.

If you are downloading resources from an URL this does not apply!

if you bundle a rootscript in the package you have to do the following:

a: Remove the "url" parameter, even if it is empty

or

b: Include the "url" AND the "hash" parameter

This will not work

  "preflight": [
    {
      "file": "/Library/installapplications/scripts/root/05-preflight.py",
      "name": "Preflight",
      "type": "rootscript",
      "url": ""
    }
  ]

This will work

  "preflight": [
    {
      "file": "/Library/installapplications/scripts/root/05-preflight.py",
      "name": "Preflight",
      "type": "rootscript"
    }
  ]

This will also work

  "preflight": [
    {
      "file": "/Library/installapplications/scripts/root/05-preflight.py",
      "name": "Preflight",
      "type": "rootscript",
      "url": "",
      "hash": "a_generated_256_hash_value"
    }
  ]

The issue is easily solved by removing empty hashes from your json, which probably is a good habit anyway.

The confusion arrives since sometimes its allow with an empty hash, like this: which also will work:

"setupassistant": [`
    {
      "file": "/Library/installapplications/packages/DEPNotify-1.1.5.signed.pkg",
      "hash": "a_generated_256_hash_value",
      "name": "DEPNotify",
      "packageid": "menu.nomad.DEPNotify",
      "type": "package",
      "url": "",
      "version": "1.1.5"
    }
  ]

It might also be that the use of generatejson.py does avoid this issue, but if you handcraft your json you have to be careful.

I think this issue is best solved by archiving this issue as part of documentation of a cornercase. I will also try to make a general addition to the documentation (as a PR) about avoiding empty hashes in your jsonfile, in case of handcrafting or copy/paste from other sources.

K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant