Skip to content

build: stop installing chocolatey, fixes #6636, fixes #6344 [skip buildkite]#7049

Merged
rfay merged 30 commits into
ddev:mainfrom
colans:6636-stop-installing-chocolatey
Apr 10, 2025
Merged

build: stop installing chocolatey, fixes #6636, fixes #6344 [skip buildkite]#7049
rfay merged 30 commits into
ddev:mainfrom
colans:6636-stop-installing-chocolatey

Conversation

@colans

@colans colans commented Mar 5, 2025

Copy link
Copy Markdown
Contributor

The Issue

We no longer need Chocolatey when installing inside WSL so let's remove it to prevent side effects that users are running into.

How This PR Solves The Issue

It removes the unnecessary dependency.

Manual Testing Instructions

  1. Run the script to install DDEV.
  2. Ensure that there are no errors caused by Chocolatey not being installed.
  3. Ensure that DDEV works.

Automated Testing Overview

TBD

Release/Deployment Notes

TBD

@rfay

rfay commented Mar 5, 2025

Copy link
Copy Markdown
Member

Making progress!

  • When we don't install chocolatey, we need to remove the choco install features
  • We need to replace those with an alternate installation technique (ddev.exe, mkcert.exe, and gsudo.exe still need to be installed on the Windows side
  • This needs to be done to both the Docker CE install script and the Docker Desktop install script

I don't know how to do automated testing on this, and we currently don't have any.

@colans

colans commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

Yup, the first two of those are what I'm working on now (trying to figure out how to do this stuff in Powershell as I come from the Linux world).

Didn't know about that 3rd item so I'll look into that too!

@colans

colans commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

@rfay : Where should I stick these EXEs after downloading?

@colans

colans commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

Where should I stick these EXEs after downloading?

I just created a new DDEV directory in Program Files.

What's left:

  • Installing mkcert, and
  • Doing the other script.

@colans

colans commented Mar 5, 2025

Copy link
Copy Markdown
Contributor Author

I just created a new DDEV directory in Program Files.

In the end, I just ended up with a mkcert directory because the other apps use installers. We're not actually placing the binaries anywhere; the installers take care of that.

Anyway, just took this out of draft; it's ready for review.

@colans colans marked this pull request as ready for review March 5, 2025 22:24
@colans colans requested a review from a team as a code owner March 5, 2025 22:24

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm afraid I misled you and didn't think properly about mkcert and gsudo, and you're doing the right thing with the installer. So mkcert/gsudo get installed by the installer (I think).

You'll find lots of examples of how to download latest stable version of a package.

Please make sure this handles the architecture correctly. It should be able to handle windows amd64 and arm64.

Comment thread scripts/install_ddev_wsl2_docker_desktop.ps1 Outdated
Comment thread scripts/install_ddev_wsl2_docker_desktop.ps1 Outdated
Comment thread scripts/install_ddev_wsl2_docker_desktop.ps1 Outdated
Comment thread scripts/install_ddev_wsl2_docker_desktop.ps1 Outdated
@rfay rfay changed the title build: stop installing chocolatey, fixes #6636 build: stop installing chocolatey, fixes #6636 [skip buildkite] Mar 6, 2025
@rfay

rfay commented Mar 6, 2025

Copy link
Copy Markdown
Member

Please use [skip buildkite] in your commit messages (if you remember, no harm done if you don't) since this doesn't run any tests on buildkite. I'm not sure why they ran anyway, some rule must be wrong.

@rfay rfay force-pushed the 6636-stop-installing-chocolatey branch from 91a1362 to d2d851b Compare March 6, 2025 17:43
@rfay

rfay commented Mar 6, 2025

Copy link
Copy Markdown
Member

Rebased this so you won't get messed up by changes to these scripts that went into upstream/main - make sure you get the latest version before continuing, thanks.

@colans

colans commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

Next up is fetching the correct architecture...

@colans

colans commented Mar 7, 2025

Copy link
Copy Markdown
Contributor Author

@rfay Ready for your review again:

  • Apps that the installer pulls in are no longer installed explicitly.
  • The release is no longer hard-coded.
  • The architecture is no longer hard-coded.
  • Code is now the same for both scripts.

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking pretty great, looking forward to test drive.

@rfay

rfay commented Mar 11, 2025

Copy link
Copy Markdown
Member

Sorry I haven't gotten to manually test yet, will get there. I just haven't spent a day with spare time on WSL2 in the last bit. As you know from your work, it's a lot of work to test.

One thing I've been thinking about... it may not need to run in admin PS, true? Depends on what the behavior or the DDEV installer is in this situation.

@rfay rfay force-pushed the 6636-stop-installing-chocolatey branch from d6a27b2 to 7e3b0d7 Compare March 11, 2025 13:37
@rfay

rfay commented Mar 11, 2025

Copy link
Copy Markdown
Member

Rebased

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested both of these scripts and they worked fine.

There are a couple of things to be done:

  • Currently, this runs the ddev installer and people have to step through it. I think that's OK, but if we're going to leave it like that we need to change the installer to not have that "open release notes" at the end by default, because that opens a browser that hides what happens from there.
  • What do you think about running the installer in silent mode like chocolatey does? Run the installer with /S /C
  • I'm pretty sure this no longer needs to be run in admin Powershell, do you agree? Perhaps the silent mode conflicts with that idea. But if it doesn't need to be run in silent mode then the doc has to be improved.

Awesome work, just what I was hoping for!

@colans

colans commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing! I was away last week so will catch up on the above soon.

@rfay

rfay commented Mar 18, 2025

Copy link
Copy Markdown
Member

Thank you for working on this, it's going to be really great. I apologize for requesting other things here, but we want to make this as easy to use as possible.

@colans

colans commented Mar 25, 2025

Copy link
Copy Markdown
Contributor Author

Currently, this runs the ddev installer and people have to step through it. I think that's OK, but if we're going to leave it like that we need to change the installer to not have that "open release notes" at the end by default, because that opens a browser that hides what happens from there.

How do you think we should implement this? If it's running from either of the Windows installers, skip that step? Is this context available to the installer?

What do you think about running the installer in silent mode like chocolatey does? Run the installer with /S /C

I don't like running things in silent mode because then you can't see what's happening, and if something goes wrong, then you don't know what went wrong. Maybe Windows users are accustomed to this, but it drives me nuts. (I run Ansible playbooks with "-vv" so that's my bias; I like to know what's going on.)

I'm pretty sure this no longer needs to be run in admin Powershell, do you agree? Perhaps the silent mode conflicts with that idea. But if it doesn't need to be run in silent mode then the doc has to be improved.

When you tested it, did you try it without? I haven't had a chance to get back into this yet. Let's have at least one of us try it without, and see if it works. That should be good enough of a test, right? If so, we update the docs. Otherwise, I think we can drop this one.

@rfay

rfay commented Mar 25, 2025

Copy link
Copy Markdown
Member

How do you think we should implement this? If it's running from either of the Windows installers, skip that step? Is this context available to the installer?

I think all you have to do is this, but I'm on mac right now need to check the build. make windows will build the windows installer:

diff --git a/winpkg/ddev.nsi b/winpkg/ddev.nsi
index 0103c38b3..bf540987d 100644
--- a/winpkg/ddev.nsi
+++ b/winpkg/ddev.nsi
@@ -226,6 +226,7 @@ Var ICONS_GROUP
 
 ; Finish page
 !define MUI_FINISHPAGE_SHOWREADME "${PRODUCT_RELEASE_NOTES_URL}"
+!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Review the release notes"
 !define MUI_FINISHPAGE_LINK "${PRODUCT_PROJECT} (${PRODUCT_PROJECT_URL})"
 !define MUI_FINISHPAGE_LINK_LOCATION ${PRODUCT_PROJECT_URL}

I don't like running things in silent mode because then you can't see what's happening, and if something goes wrong, then you don't know what went wrong. Maybe Windows users are accustomed to this, but it drives me nuts. (I run Ansible playbooks with "-vv" so that's my bias; I like to know what's going on.)

Agreed, although choco installs are classically that way. If we add a statement like "Press return to continue the DDEV WIndows-side installer, which is only used to update the hosts file, just accept the defaults" then they won't be surprised.

When you tested it, did you try it without? I haven't had a chance to get back into this yet. Let's have at least one of us try it without, and see if it works. That should be good enough of a test, right? If so, we update the docs. Otherwise, I think we can drop this one.

I have not tested it that way yet, but have high hopes.

@rfay

rfay commented Mar 25, 2025

Copy link
Copy Markdown
Member

I did the NSIS (ddev.nsi) fix in

So you don't have to think about that. Tested locally and it works. Please consider whether silent-install is worth considering since we only are installing this in order to edit hostnames (when doing WSL2)

@rfay rfay force-pushed the 6636-stop-installing-chocolatey branch from 7e3b0d7 to 3bf49b0 Compare March 26, 2025 16:47
@rfay

rfay commented Mar 26, 2025

Copy link
Copy Markdown
Member

Rebased; the fix to the Windows DDEV installer is now in HEAD and will be in release hopefully on Friday.

@rfay rfay changed the title build: stop installing chocolatey, fixes #6636 [skip buildkite] build: stop installing chocolatey, fixes #6636, fixes #6344 [skip buildkite] Apr 9, 2025
@rfay

rfay commented Apr 9, 2025

Copy link
Copy Markdown
Member

My first guess is that the silent installation skips mkcert; here's what I see with non-silent:

image image image

@rfay

rfay commented Apr 9, 2025

Copy link
Copy Markdown
Member

Here's the reason:

ddev/winpkg/ddev.nsi

Lines 500 to 505 in 4f00610

Section "mkcert" SecMkcert
; Install in non choco mode only
${IfNot} ${Chocolatey}
SectionIn 1 2
SetOutPath "$INSTDIR"
SetOverwrite try

@rfay

rfay commented Apr 9, 2025

Copy link
Copy Markdown
Member

For some reason the installer can't be pre-emptively removed. Can you take a look at this @colans and maybe see if it can be installed with a unique name, or escalate, or something?

PS C:\Users\randy\workspace\ddev.windows\scripts> .\install_ddev_wsl2_docker_inside.ps1
Detected OS architecture: AMD64; using DDEV installer: amd64
The latest ddev/ddev version is v1.24.4.
Downloading from https://github.com/ddev/ddev/releases/download/v1.24.4/ddev_windows_amd64_installer.v1.24.4.exe...
Remove-Item : Cannot remove item C:\Users\randy\AppData\Local\Temp\ddev-installer.exe: Access to the path
'C:\Users\randy\AppData\Local\Temp\ddev-installer.exe' is denied.
At C:\Users\randy\workspace\ddev.windows\scripts\install_ddev_wsl2_docker_inside.ps1:87 char:1
+ Remove-Item $DdevInstallerPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\randy\...v-installer.exe:FileInfo) [Remove-Item], UnauthorizedAccess
   Exception
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
   

@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown

@colans

colans commented Apr 9, 2025

Copy link
Copy Markdown
Contributor Author

Having unique installer names is a good move so deleting is no longer our problem. I usually go with something like filename-timestamp.ext, but GUIDs work too. 😉 Thanks for figuring it out!

@rfay

rfay commented Apr 9, 2025

Copy link
Copy Markdown
Member

I think it might work now, your review is appreciated. Apparently the mkcert wasn't installed immediately; it now waits for completion. No idea why.

It also now works with the current released installer; but the uninstall won't uninstall without the complaint until the next release (it tries to remove the directory when there's still a file in it). But the new installer does remove successfully.

I'm not sure if there might be a way for the script to get the installer that is the same commit hash, but that sounds exotic.

@github-actions

github-actions Bot commented Apr 9, 2025

Copy link
Copy Markdown

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested install_ddev_wsl2_docker_inside.ps1 - works fine.

I didn't test install_ddev_wsl2_docker_desktop.ps1 (My VM with Dockrt Desktop is broken, internet doesn't work, so I need to recreate it from scratch.)

Comment thread docs/content/users/install/ddev-installation.md Outdated
@github-actions

Copy link
Copy Markdown

@rfay

rfay commented Apr 10, 2025

Copy link
Copy Markdown
Member

Fingers crossed! Thanks for the great work here @colans !

@rfay rfay merged commit 0c9f41e into ddev:main Apr 10, 2025
@rfay

rfay commented Apr 10, 2025

Copy link
Copy Markdown
Member

I didn't think about the fact that people will be using the stable docs, but getting this script already (from main). So they'll think they have to run it with admin privs, but of course @colans checked it that way and it worked. Hopefully it will be OK!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants