12 ms·
If you add a .CMD file as the first entry in a .ZIP, with compression set to "none", you can rename and run the .ZIP as a .CMD, because the PK header will be tr
by 13of40 4y ago
If you add a .CMD file as the first entry in a .ZIP, with compression set to "none", you can rename and run the .ZIP as a .CMD, because the PK header will be treated as a nonexistent command and execution will continue after that. With a little imagination and some PowerShell I've made that into a self-extracting archive. It's a dirty hack, but I've had it working in production for years now. I want to see if I can make the batch file chimeric so it can run in a linux shell as well. Maybe that'll to be my lazy Sunday afternoon?
- mdaniel 4y ago> I can make the batch file chimeric so it can run in a linux shell as well. Maybe that'll to be my lazy Sunday afternoon? You may want to draw inspiration from the latest incarnation of JetBrains build bootstrapping script: https://github.com/JetBrains/intellij-community/blob/idea/223.8836.41/installers.cmd https://github.com/JetBrains/intellij-community/blob/idea/22...
- nigrioid 4y agoReally neat. You've probably already seen them, but redbean and APE take a similar idea further: https://redbean.dev/ https://redbean.dev/ https://justine.lol/ape.html https://justine.lol/ape.html
- sebazzz 4y agoIf you run a "cls" as first command in the batch file no one would notice the invalid command of the PK header either (and not get possibly confused).
- 13of40 4y agoRight now I'm just using the PowerShell part to move the cursor up and to the left and delete it. You can still see the PK$#@($!!!1 for a nanosecond, but that just gives it character in my opinion.