chocolatey/boxstarter

Error when user denies execution from Boxstarter is uncaught

Redsandro opened this issue ยท 8 comments

Windows will pop up a dialog asking permission for the second command window that Boxstarter opens. The exception that's thrown when the user denies this permission is uncaught.

image

Is it possible to catch this, and display in some nice bright text:

"You denied permission to run Boxstarter. Packages X Y Z will not be installed."

I get this always when I run boxstarter for the first time. Eg if I click on this link http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/laurentkempe/Cacao/master/PrepareMyCacao.ps1

I click on a link in Edge
I say run the click once installer that it downloads
It downloads and installs boxstarter
Then opens new command line window like above and crashes

Then I click the link second time
Run the click once
Without downloading or installing anything it starts executing the script bringing up UAC, by clicking yes it installs everything from the script.

I am running it on freshly installed Windows 10 x64 build 1803 Pro edition.

gep13 commented

@martinskuta @laurentkempe would either of you be able to check that it wasn't this issue that you are running into?

https://stackoverflow.com/questions/50379742/clickonce-app-doesnt-start-with-windows-1803

As a workaround you can install boxstarter locally and then refer it to the same scripts you're attempting to run.
In an elevated PowerShell Window run:
CINST Boxstarter
Install-BoxstarterPackage [PATH_TO_SCRIPT]

would either of you be able to check that it wasn't this issue that you are running into?

Yeah @gep13 it might have been my issue for sure! on @martinskuta VM we have seen the exception described in that issue, but let's try it again next week and we let you know

As a workaround you can install boxstarter locally and then refer it to the same scripts you're attempting to run.

Thanks @yodurr exactly what I did at the end. But clicking on an hyperlink on a webpage is so much fun ๐Ÿ˜„

@martinskuta @laurentkempe would either of you be able to check that it wasn't this issue that you are running into?
https://stackoverflow.com/questions/50379742/clickonce-app-doesnt-start-with-windows-1803

Yep it is that, when I changed Check app and files OFF as described in the stackoverflow thread, everything ran properly.

One of my 1803 machines is not reproducing this bug anymore. Anyone else seeing a change in behavior?

I think we should close this issue - I'm not having this problem anymore.

Closing as requested