You face many problems, which others have given an idea about.
Consider this problem. Why in Gods name would your legitimate users want to download any document that they know in advance contains code that will execute, and could delete files on their computer if it runs.
"Please trust me that I didn't make a mistake with my code, that I've considered every possibility at the clients and and it will never get it wrong. It will always get it 100% right. My coding is flawless. It will always know if the machine its on, is valid, however your systems are configured, whatever platforms and IPs you use, however they might vary dynamically. Nobody has ever, or could ever, hack my website or file store, or modify my code in a subtle way that causes mischief. It will never open a vulnerability for denial of service or damage if exploited. And you can trust totally that I never added advert tracking or anything negative, and never would."
Would I ever use your service? Would you get positive reviews? One answer: I wouldn't touch your downloads if you were the last service on the planet and the only thing between me and a severe problem.
Let's now add to that, most systems wouldn't allow your documents to run freely, anyway, exactly because of the scope for arbitrary damage.