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

Execute cmd but don't execute autostart programs #3815

Closed
wants to merge 9 commits into from
Closed

Execute cmd but don't execute autostart programs #3815

wants to merge 9 commits into from

Conversation

greg-hutchinson
Copy link
Contributor

@greg-hutchinson greg-hutchinson commented Jan 3, 2020

The way the current code works is that it has side effects when trying to execute a git command.
(This comes from the file git.ps1 in the lib directory).
(i.e current code
& "$env:COMSPEC" /c $cmd
)
Without the /d parameter, it also executes code that is in the windows autostart sections of the registry. 
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

by adding the /d switch
& "$env:COMSPEC" /d /c $cmd
no extra autorun programs will be executed.

Normally, this does not have any adverse effects (it is just possibly slower), however, if there is an error in the autostart entries, it ends up returning errors to scoop that get interpreted incorrectly. In my case, I also had invalid entries left in the autostart and was receiving the error message -

"The system cannot find the path specified". And scoop was failing.

I have seen this reported on several bugs as well.

Of course, there are several fixes to this - remove the entries from the registry, but I believe by adding the /d switch to the line below, will save scoop reporting errors that are non-related to scoop and it will run potentially faster when the autostart programs are time-consuming.

@greg-hutchinson
Copy link
Contributor Author

I think this would solve bug #3629

@greg-hutchinson
Copy link
Contributor Author

Just curious. Was there something else I should have done? This has been in pending review for some time now.

@r15ch13
Copy link
Member

r15ch13 commented May 19, 2020

Please rebase it to the develop branch.

@greg-hutchinson
Copy link
Contributor Author

greg-hutchinson commented May 20, 2020 via email

@r15ch13
Copy link
Member

r15ch13 commented May 21, 2020

Closed via #3993

@r15ch13 r15ch13 closed this May 21, 2020
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

Successfully merging this pull request may close these issues.

6 participants