#1
Posted 10 April 2015 - 10:36 AM
I am planning to add a feature into the app store that will allow you to package a whole directory and save it, of course it needs to be packaged as one file and then when it is run it will decompress all files.
Now I have tried the following:
Installer Maker (SGunner) -> This errored and didn't work.
Craft Compress -> Everytime I attempted to run the file to unpackage it it just errored saying there was a / character.
Packman -> Doesn't even download. Just errors.
If anyone has made or has a decent program that is reliable and able to package everything in a folder, this being multiple files or even more folders with files in. This would be very helpful thank you!
Cheers
#3
Posted 10 April 2015 - 10:44 AM
If you are just looking for a packager then you can't go wrong with Bomb Bloke's Package. You might also want to read through this. Packman works fine on my computer so it is strange that it is broken.
#4
Posted 10 April 2015 - 10:55 AM
Bomb Bloke, on 10 April 2015 - 10:43 AM, said:
I have to ask can this actually package everything and save it to file? or does it have to upload to pastebin?:s
SquidDev, on 10 April 2015 - 10:44 AM, said:
If you are just looking for a packager then you can't go wrong with Bomb Bloke's Package. You might also want to read through this. Packman works fine on my computer so it is strange that it is broken.
No it needs to all be done in program (lua)
#5
Posted 10 April 2015 - 11:19 AM
SquidDev, on 10 April 2015 - 10:44 AM, said:
That is to say, Grin doesn't implement compression at all - it does the opposite.
DannySMc, on 10 April 2015 - 10:55 AM, said:
If you load it as an API you can make it do pretty much whatever you want it to.
Edited by Bomb Bloke, 10 April 2015 - 11:19 AM.
#6
Posted 10 April 2015 - 11:26 AM
Bomb Bloke, on 10 April 2015 - 11:19 AM, said:
SquidDev, on 10 April 2015 - 10:44 AM, said:
That is to say, Grin doesn't implement compression at all - it does the opposite.
DannySMc, on 10 April 2015 - 10:55 AM, said:
If you load it as an API you can make it do pretty much whatever you want it to.
Awesome thank you, would you be okay with it being used in my app store?
#7
Posted 10 April 2015 - 11:35 AM
#9
Posted 10 April 2015 - 01:09 PM
DannySMc, on 10 April 2015 - 10:36 AM, said:
I am planning to add a feature into the app store that will allow you to package a whole directory and save it, of course it needs to be packaged as one file and then when it is run it will decompress all files.
Now I have tried the following:
Installer Maker (SGunner) -> This errored and didn't work.
Craft Compress -> Everytime I attempted to run the file to unpackage it it just errored saying there was a / character.
Packman -> Doesn't even download. Just errors.
If anyone has made or has a decent program that is reliable and able to package everything in a folder, this being multiple files or even more folders with files in. This would be very helpful thank you!
Cheers
Use Compress. It saves a folder structure into a single file. When you run the file it will extract itself to the desired path. YAY. Be sure to try it.
#11
Posted 10 April 2015 - 01:54 PM
SquidDev, on 10 April 2015 - 01:44 PM, said:
Err how do I run it?:s or do anything with it?:s
#12
Posted 10 April 2015 - 02:12 PM
DannySMc, on 10 April 2015 - 01:54 PM, said:
SquidDev, on 10 April 2015 - 01:44 PM, said:
Err how do I run it?:s or do anything with it?:s
Its slightly broken as it only works from root directory so you'll need to patch it. You just run it and it produces a file called build which when run, runs a file called startup. You can always change it so it is more customisable. It packages an entire virtual file system so you can run build --extract to extract it, or build to run the program. It was written to package bedrock files but should work with anything.
Just putting it out there: Read the source Luke.
Edited by SquidDev, 10 April 2015 - 02:12 PM.
#13
Posted 10 April 2015 - 02:29 PM
SquidDev, on 10 April 2015 - 02:12 PM, said:
DannySMc, on 10 April 2015 - 01:54 PM, said:
SquidDev, on 10 April 2015 - 01:44 PM, said:
Err how do I run it?:s or do anything with it?:s
Its slightly broken as it only works from root directory so you'll need to patch it. You just run it and it produces a file called build which when run, runs a file called startup. You can always change it so it is more customisable. It packages an entire virtual file system so you can run build --extract to extract it, or build to run the program. It was written to package bedrock files but should work with anything.
Just putting it out there: Read the source Luke.
Ahh never mind then
#14
Posted 10 April 2015 - 04:29 PM
DannySMc, on 10 April 2015 - 10:36 AM, said:
Craft Compress is my program, its on hold right now. Bug reports are still fine, I just won't be doing any new features any time soon
So it didn't like the '/' character? If you get a chance could you post a bug report with the error and the file you tried to compress?
I've been having problems, but as far as I know its just with nested multi line strings ( [[ ]] )
#15
Posted 10 April 2015 - 04:33 PM
#16
Posted 10 April 2015 - 05:01 PM
Here it is:
local tArgs = {}
local savetable = {}
function compact(path)
local file
for k, v in ipairs(fs.list(path)) do
if fs.isDir(path.."/"..v) then
compact(path.."/"..v)
elseif fs.exists(path.."/"..v) then
file = fs.open(path.."/"..v, "r")
if file then
savetable[path.."/"..v] = file.readAll()
file.close()
end
end
end
end
if tArgs > 1 then
print("Serializing...")
compact(tArgs[1])
print("Saving to File...")
local file = fs.open(tArgs[2], "w")
file.write(textutils.serialize(savetable))
file.close()
else
print("Usage: merge <folder merge="" to=""> <file path="">")
end
</file></folder>Here is the code to uncompress a file.
local function createFolderForFile(path)
local curpath = path
local startHere = 1
while true do
local nextSlash = string.find(string.sub(path, startHere, -1), "/")
if not nextSlash then return end
nextSlash = nextSlash + startHere
local folderToCreate = string.sub(curpath, 0, nextSlash - 1)
if not fs.isDir(folderToCreate) then
local ok, err = pcall(fs.makeDir, folderToCreate)
if not ok then
if string.find(err, "Out of space") then
error("Out of space.")
end
end
end
startHere = nextSlash
end
end
function uncompact(location)
local handle = fs.open(location, "r")
folderStructureS = handle.readAll()
handle.close()
local folderStructure = textutils.unserialize(folderStructureS)
for k, v in pairs(folderStructure) do
createFolderForFile(k)
local file = fs.open(k, "w")
if file then
file.write(v)
local ok, err = pcall(file.close)
if not ok then
if string.find(err, "Out of space") then
outOfSpaceError()
end
end
end
sleep()
end
end
if tArgs > 0 then
print("Unserializing...")
uncompact(Args[1])
else
print("Usage: unmerge <file path to uncompact>")
end
Edited by Tag365, 10 April 2015 - 05:09 PM.
#18
Posted 10 April 2015 - 06:18 PM
Bomb Bloke, on 10 April 2015 - 11:19 AM, said:
Well to be fair, Grin supports DEFLATE in the zip files, which can do some substantial compression. Even with the base64 inflation, the 300kb JVML folder is only 180kb in its Grin-downloadable release form
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











