Open mrclary opened 5 months ago
@jaimergp, also, do you know of a way to display or save the install log from NSIS when executing the installer from the command line?
GHA on Windows runs as an administrator account, so constructor, conda-standalone and menuinst will run in sudo mode, believing it's an all-users install. I've observed the same behavior in napari and gave up because it does work locally. Maybe we can allow overrides at some point but for now that's the known behavior.
For the logs, you need to build your installers with the logging build of nsis. See https://github.com/conda/constructor/blob/d934f13d103359d0d208108fa53ccf529d143cd7/dev/extra-requirements-windows.txt#L1.
GHA on Windows runs as an administrator account, so constructor, conda-standalone and menuinst will run in sudo mode, believing it's an all-users install. I've observed the same behavior in napari and gave up because it does work locally. Maybe we can allow overrides at some point but for now that's the known behavior.
I see, thank you. So menuinst
will install the shortcut based on its current privileges; .nonadmin
only tells menuinst
whether or not to elevate those privileges. I'll update our workflow accordingly. I'm just glad to know that there wasn't a bug 😁.
For the logs, you need to build your installers with the logging build of nsis. See https://github.com/conda/constructor/blob/d934f13d103359d0d208108fa53ccf529d143cd7/dev/extra-requirements-windows.txt#L1.
Thank you! 🙏 😊 I was not aware of that! Is there a flag I need to use on the command line? Or will it automatically send logs to stdout? to log file?
You will find a install.log
file in the target location. You don't have to do anything else. It's not perfect but it's something. This is how we use it in the constructor test suite.
You will find a
install.log
file in the target location. You don't have to do anything else.
start /wait Spyder-6.0.0a4.dev150-Windows-x86_64.exe /S
Hmm... I can't find the log file... What am I missing?
That should be enough, I think?
This is how we run it in CI, in case it helps. Maybe specify /D=some-path
to make sure where to expect the file.
This is how we run it in CI, in case it helps. Maybe specify
/D=some-path
to make sure where to expect the file.
I tried that as well. However, I'm running it locally right now, so maybe it needs admin privileges for some reason? I'll test that also...
That should be enough, I think?
Found the issue. The environment variable NSIS_USING_LOG_BUILD=1
also needs to be set prior to the build.
https://github.com/conda/constructor/blob/d934f13d103359d0d208108fa53ccf529d143cd7/constructor/winexe.py#L352
@jaimergp, thanks for all your help on this! I really appreciate all the work you and others have done on upgrading constructor
and menuinst
. It is a great help to the Spyder project.
Aaah, yes, I remember now. Sorry about that obscure detail 😬 I'll add it to the documentation.
@jaimergp, when uninstalling, the uninstaller requests the user to restart now or later. This seems to be a result of failing to remove the install.log
from the base environment directory. Is this a bug?
I can add some more perspective about that log file and why we (on the Anaconda side) don't use it in production:
constructor
allows), it will write the log file before the installer checks if the directory is empty, which makes the installer fail. That can of course be fixed by excluding that file.%USERPROFILE%
, which is not ideal (and would be a red flag for me as a user).@jaimergp, when uninstalling, the uninstaller requests the user to restart now or later. This seems to be a result of failing to remove the install.log from the base environment directory. Is this a bug?
This is not a bug. NSIS
, which is the backend of the installers, calls all logs install.log
. So, this is the log of the uninstaller. It is marked for deletion and should be removed on reboot.
I can add some more perspective about that log file and why we (on the Anaconda side) don't use it in production:
- If you install into an empty directory (which the current implementation of
constructor
allows), it will write the log file before the installer checks if the directory is empty, which makes the installer fail. That can of course be fixed by excluding that file.- When you hit "Browse" in the GUI to change the destination path, the installer will write the log file into
%USERPROFILE%
, which is not ideal (and would be a red flag for me as a user).@jaimergp, when uninstalling, the uninstaller requests the user to restart now or later. This seems to be a result of failing to remove the install.log from the base environment directory. Is this a bug?
This is not a bug.
NSIS
, which is the backend of the installers, calls all logsinstall.log
. So, this is the log of the uninstaller. It is marked for deletion and should be removed on reboot.
Hmm...thanks @marcoesters, I will reconsider using the NSIS log version. My motivation was to provide some debugging information for developers, but if it will cause more problems for end users it may be counterproductive.
For CIs, enabling logging could be okay because these corner cases don't apply there/are easily fixable.
What I do is enable logging for dev builds of installers and integration testing. I only disable logging for production.
Checklist
What happened?
@jaimergp, when testing the Windows installers for Spyder,
menuinst
creates the shortcut for_mode=system
rather than_mode=user
, but only on CI. This does not occur for macOS or Linux./InstallationType=JustMe /NoRegistry=1
flags). See this run. When I ssh into the workflow, I see that.nonadmin
is present in both the base and target prefixes./NoRegistry=1
) with the same successful result. See this run without test.What could be causing the problem on CI?
Conda Info
See https://github.com/spyder-ide/spyder/actions/runs/7589583691/job/20674537112
Conda Config
See https://github.com/spyder-ide/spyder/actions/runs/7589583691/job/20674537112
Conda list
See https://github.com/spyder-ide/spyder/actions/runs/7589583691/job/20674537112
Additional Context
No response