Folders inside a package?

Post Reply
Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Folders inside a package?

Post by Nyyrazzilyss »

I intend to make another script release publicly available this week, and just tried assembling a test package for it.

This package though has 83 images with it. I have them currently stored in a directory, but when I tried using the package manager to add them to the package it fails to create it. I then manually tried adding the folder to the zip file created if I hadn't included them, but installation of the package fails (It just says installing... etc, but never goes further).

Searching around, I found an old item indicating files need to be held in the top level (not a folder). Is this correct? I'd really rather have them held in a subfolder: I've only got around a hundred images at this time, but I would expect i'm going to end with closer to a thousand. Additionally, I have them all held in a '64px' directory (representing image size) - At some point i'll redo them all at a higher resolution, and would be much easier if I was just pointing the script at a '128px' directory if the computer supported that resolution.

For the time being I did move everything to the top level directory, and was able to successfully build and install the package. It's really only a temporary fix.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Folders inside a package?

Post by Vadi »

The xmls to install need to be at root level, and your images can have any levels of nesting.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Folders inside a package?

Post by Nyyrazzilyss »

Good to hear that it *should* be possible. The followup to that then, is it perhaps broken? With the .xml file at the root directory, i'd attempted to place .png files inside a '64px' directory. The package manager wouldn't package, after manually adding the folder to the zipfile the package couldn't be installed. Is anyone successfully adding folders to packages? (windows/ 3.0-delta)

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Folders inside a package?

Post by Akaya »

Just packaged some images in a folder and it works great.

Something to keep in mind though... when you zip a package together and then install it, an extra folder is created in your directory with the name of the zip file. This folder isn't present when originally writing the image paths in your script.
Code: [show] | [select all] lua
my_path = getMudletHomeDir() .. "/my_image.png" 
becomes...
Code: [show] | [select all] lua
my_path = getMudletHomeDir() .. "/MY_FOLDER/my_image.png"

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Folders inside a package?

Post by Nyyrazzilyss »

I just tried again, and still failing: Am I missing a step? I'm using win7 / 3.0-delta

1) I'm selecting the package exporter, give it a filename and selecting a save location for it.

2) The window now open, i'm selecting aliases/scripts/triggers (those are the only ones I want included).

3) I'm selecting the add files button, and in the folder it opens ( that currently shows a single file named config.lua) I copy a single folder named '64px' that contains around 100 png images.

4) I click Export, the window disappears (no error message, etc) but the file is never created.

I also attempted not including the 64px directory at all, and the zipfile successfully created that way I added the '64px' directory to the top level of the .zip - When I tried to use the package manager to install that file, it just hung at 'Installing'

Thanks

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Folders inside a package?

Post by SlySven »

I'm looking at the unpacking packages code at the moment and the behaviour is a little not quite as I expected. Would you be willing to point me at a copy of that last attempt that you say just hangs? It would need to be by the end of Monday 2015/05/25 - I'm going to be away for a couple of weeks but I would like to sort this in a (putative) 3.0.0-epsilon preview...

My E-Mail sent via PM.

Post Reply