How do I make a download system for simple exe files
I have a game that I want downloaded when a button is clicked. I've done this using the download attribute for images.
How would I do it for exe files, this is a very small game I'm talking about.
22 Replies
Anchor (
a
) tags have a download
attribute.You also don't need a download tag for files the browser doesn't support anyway
I get that, for images, but how do I get them to download a zip file, etc
from mdn:
The HTMLAnchorElement.download property is a string indicating that the linked resource is intended to be downloaded rather than displayed in the browser.meaning it's only necessary if it can be displayed in the browser. Zip and exe files cannot be displayed in the browser, so it's not necessary to add the download attribute to links to them.
okay, so the download attribute fits using a link for the zip file. Where would I store the zip file?
somewhere accessible to your webserver
same place as your HTML works just fine, or a
/downloads
subfolderI was thinking a Dropbox link might work
You legitimately do not need the download attribute unless it's a filetype that can be displayed in the browser. PDF, JPG, PNG, all would need a download attribute to download the file rather than show it in the browser. You do not need the download attribute for a file that cannot be displayed in the browser
have you tried that at all?
it depends on the way dropbox works, but it could in theory
No not yet, that's why I was gonna tinker with it today, as the Google drive method has been stopped by Google
I'm confused are you saying I should or shouldn't use the download attribute for a zip file
I'm sorry if I'm asking too many questions btw
you don't have to
then how would I get a download button?
how would I get the zip file downloaded
like this
if you link to a file the browser cannot display, it will offer to download it
ohhhhh thank you so much
instead of offering the entire exe file, offer an installer that downloads the needed files to the location the game will be installed in
then, you can use any storage you want, including google drive
it's a good idea to use an online store instead, like steam
if you want, even use gog or epic store or some other
this way, you skirt around the exe download by just pointing to the online stores
those have their own "seo" and pages to customize too
and show a lot more legitimacy than downloading a random exe from google drive, like how viruses are passed around
and you dont have to worry the use of bandwidth in your site
someone put a 3mb music file on a website, and was sent a bill of over 100k dollars because of illegitinate users just downloading the living crap out of it
oh, itch.io is a good place for your game too
and is less restrictive than the other stores
this is not the answer you want, but the answer you need
what about a zip file? I'm just helping someone get their customers to download their game; so I thought it would be a good to have the zip in my public file with an anchor tag with a download link
they used to use itch.io and don't want to anymore
that sounds sketchy beyond measure
I love your honesty 😭
but if it is for a single person, shoving on any storage service should be enough
why wouldn't i be honest?
but seriously, if i went to download a game and it came in a zip file, i would stop the download and avoid the website forever
many viruses are distributed pretending to be a game, and then you download the zip file and you're screwed
¿As opposed to an executable? The browser is likely to flag any of these formats as unsafe and require an override to download.
Really, your best bet would be to offer the software through some organization (like Steam or the Google Play Store) that vets software to try and help people avoid maliciousness. It'd definitely make people feel safer.
that's what i suggested
also, some games offer a download to then download the files, instead of a huge exe
There are some "single" files that are a little blob of shell script prepended to an archive of source files.
The
sh
script uncompresses it's own tailend after a user has agreed to a license or some other pre-install procedure.
It's also a characteristic of many worms & viruses which automatically attempt to infect other machines in the same network.
Many exploits have a side effect of shutting down the program you're attacking because you corrupt its memory space or something like that.
It means that the attacker has to transmit all the code necessary to complete the attack in one go, because the service won't be around anymore after the attack. (Until someone one notices it has died and reenables it.)i know, and there are lots of smaller viruses too
but now-a-days, the meta is to make the virus about 600-700mb in size, so antiviruses skip checking the file