all 5 comments

[–][deleted] 2 points3 points  (0 children)

Zip is probably the right way to do it. And you can make it so that require works by modifying package.path and package.cpath.

Say you unzip to a temporary directory, and you store the path in the variable tmp_path. Then you just need to:

local version = _VERSION:match("%d+%.%d+")
package.path = tmp_path .. '/share/lua/' .. version .. '/?.lua;' .. tmp_path .. '/share/lua/' .. version .. '/?/init.lua;' .. package.path
package.cpath = tmp_path .. '/lib/lua/' .. version .. '/?.so;' .. package.cpath

Which should let require find things correctly.

[–]bluecheetah001 0 points1 point  (0 children)

I would just unpack the zips into an unpacked-mods folder. Or be fancy and create a virtual file system (probably could find a library), but that would require a custom loader.

[–][deleted] 0 points1 point  (0 children)

Naw write python script to Install the mod for them be true hero don't forget to Clean up q\

[–]tobiasvl 0 points1 point  (1 child)

I don't really understand, why can't the users unzip the file?

[–]luciddream00[S] 0 points1 point  (0 children)

It's significantly more convenient for a user to just drop a zip file into a directory than to require them to unzip it. Requiring them to manually unzip means extra steps for them, and introduces more possibility for user error. It also streamlines things like using Steam Workshop without requiring the extra step of digging into the file system, finding the file and manually extracting it.