-
Notifications
You must be signed in to change notification settings - Fork 176
Add environment variable with installer file path #1151
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
Changes from 9 commits
24cdd0c
b8b365f
247a620
f8da863
049b6d6
64aaf24
067f478
0247784
8cf48d3
b5cf2d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||
| ### Enhancements | ||||||||||
|
|
||||||||||
| An environment variable `INSTALLER_PATH` is now defined for `post_install` scripts and set to the path of the installer executable while the installer is running. | ||||||||||
| * EXE: An environment variable `INSTALLER_PLUGINSDIR` is now also defined, it serves the same purpose as the NSIS variable `PLUGINSDIR`. | ||||||||||
|
||||||||||
| An environment variable `INSTALLER_PATH` is now defined for `post_install` scripts and set to the path of the installer executable while the installer is running. | |
| * EXE: An environment variable `INSTALLER_PLUGINSDIR` is now also defined, it serves the same purpose as the NSIS variable `PLUGINSDIR`. | |
| * An environment variable `INSTALLER_PATH` is now defined for pre-install and post-install scripts, and set to the path of the installer executable while the installer is running. (#1151) | |
| * EXE: An environment variable `INSTALLER_PLUGINSDIR` is now also defined, it serves the same purpose as the NSIS variable `$PLUGINSDIR`. (#1151) |
Please always add the PR number (and issue number, not applicable here) to the new items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I keep forgetting that. Thanks for the reminder!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a default value? What we are trying to achieve here doesn't seem to be well-supported by Apple for
.pkginstallers, however, I found this and it worked for me when I tested locally. However, it's a poorly documented variable and might not always work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is, unfortunately, not unusual. This code may fail though with
set -u. Here is how I solved it for another variable:constructor/constructor/osx/run_user_script.sh
Lines 33 to 40 in dccf7d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a default variable makes sense here. If the location of the installer cannot be detected because the variable is not defined, then it shouldn't be set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the
0is necessary, I used the:-syntax as well (if [ -n "${PACKAGE_PATH:-}" ]; then) but this situation evaluates to an empty string if unset.