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

Set INSTALLER_UNATTENDED for user scripts #885

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Oct 29, 2024

Description

Closes #882

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Oct 29, 2024
@jaimergp
Copy link
Contributor Author

@mrclary - can you give this branch a try? You can check for INSTALLER_UNATTENDED in your scripts.

@jaimergp jaimergp marked this pull request as ready for review October 30, 2024 07:38
@jaimergp jaimergp requested a review from a team as a code owner October 30, 2024 07:38
Copy link
Contributor

@marcoesters marcoesters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a very useful feature. I unfortunately have no idea how to do this for pkg installers either. Luckily, they are rarely installed via the command line.

Formatting aside, I only have one comment.

@@ -3,6 +3,7 @@ if not "%INSTALLER_NAME%" == "Scripts" exit 1
if not "%INSTALLER_VER%" == "X" exit 1
if not "%INSTALLER_PLAT%" == "win-64" exit 1
if not "%INSTALLER_TYPE%" == "EXE" exit 1
if "%INSTALLER_UNATTENDED%" == "" exit 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the tests are run in batch/headless/silent mode, should we assert that the value be 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try :)

Suggested change
if "%INSTALLER_UNATTENDED%" == "" exit 1
if not "%INSTALLER_UNATTENDED%" == "1" exit 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand this to the other bat file and the sh scripts ([[ "${INSTALLER_UNATTENDED}" == "1" ]] || exit 1 or something) and I think we have a good test here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops you are right, I forgot the other files. Added some additional tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be passing.

constructor/nsis/main.nsi.tmpl Outdated Show resolved Hide resolved
constructor/nsis/main.nsi.tmpl Outdated Show resolved Hide resolved
@jaimergp
Copy link
Contributor Author

Since the tests are run in batch/headless/silent mode, should we assert that the value be 1?

Looks like that worked!

@jaimergp jaimergp merged commit 447e0f2 into conda:main Oct 30, 2024
20 checks passed
@jaimergp jaimergp deleted the identify-silent-mode branch October 30, 2024 22:39
@mrclary
Copy link

mrclary commented Nov 3, 2024

Thanks @jaimergp @marcoesters 🚀

mrclary added a commit to mrclary/spyder that referenced this pull request Nov 6, 2024
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
mrclary added a commit to mrclary/spyder that referenced this pull request Nov 6, 2024
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
mrclary added a commit to mrclary/spyder that referenced this pull request Nov 7, 2024
With conda/constructor#885, batch/silent mode installs will automatically set INSTALLER_UNATTENDED environment variable accessible by user scripts. Until the next constructor version (>3.9.3) users may set either CI=1 or INSTALLER_UNATTENDED=1 at the commandline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Ability to send option flags to post-install script
4 participants