I have a Mac application in the form of example.app that is actually a folder containing the programs resources (binaries, etc.). I want to have the user click a button and download the whole folder and all of its contents.
I've tried the following
<a href='theFolder.app' download='theFolder' >Download</a>
This does not work. I am willing to implement PHP, JavaScript or Python, I just want something that works.
If you want the user to download your application, why don't you use GitHub releases and host your application there and then get a download URL from there?
For example:
Open this link and after selecting the application type you want and then hover on the download button, you will see that the download link is from GitHub releases.

Easy peasy!!!
😉
Maybe create .zip of the folder.app and do the same.
Other hacks
P.S github release
Sarath KCM
I found a way to zip it and make it available for download in browser itself here, without using any backend server code. So you can store your binaries and your website in any static file server, or even in github and make this work.
It might lead to prerfomance issues in some clients, but assuming that the client machine can run your Electron application, this shouldn't cause much issues in the browser.