addon does not have correct structure? - add-on

I'm editing the skin of kodi but the problem is that i edit it and compressed it into zip after that I try to add on kodi from zip file it gives me the error "Addon does not have correct structure" I think it is the way I'm turning it back into a .zip, because even if I just unzip the skin and then without changing anything turn it back into a zip it still gives me that error, so I'm just wondering does anybody know what I'm doing wrong or do I need to use a special tool to make the plugin into a zip
I'm using openelec 6.0 on a raspberry pi 3

You will need to set it up like this:
zip (name doesn't matter)
folder with plugin name (ie plugin.program.hello.world)
plugin files including addon.xml, LICENSE.txt, changelog.txt, icon.png, etc
You don't need a special tool but you may be inadvertently compressing the zip. You could try Keka

Related

Repack extracted .img file that I just extracted with binwalk

I used "binwalk" to extract an image file and I got what I needed as a directory hierarchy. So I made my changes and now I want to repack it and get the .img file back out of it.
Is there a solution?
I found a solution to accomplish this, I used imgRePacker_203 to get my image extracted.
If you could not find imgRePacker_203 online, then I have created a Git repo on my Github account and I included that tool with many other tools related to work with .img files. Also there is a very useful video on which you can get all links here:
https://github.com/AhmadVakil/Image-file-tools
https://www.youtube.com/watch?v=3zm91DfdkIo
Note: This solution is worked with ALLWINNER, and Whatsminer image that upgrade or downgrade the firmware of ASIC miner's control board. Hope you find it useful for other problems and extracting other images.

Unzip .app file without it turning into folders

A company I work with have an issue where a zipped .app file is resolving into its bundled folders once unzipped.
What is the best way to compress an .app so that it can be decompressed without that it resolves into folders, that is the want it to remain a single .app file?
Use another format than zip? Compress it in binary?
Thanks in advance
You shouldn't be having any problems with this. As I'L'I points out, an application on the Mac is a bundle of folders. It's just that the Finder presents it to the user as a single entity.
Zipping and unzipping the bundle won't change this. The Finder recognises the .app extension and acts accordingly. It is not necessary to set what used to be called the 'bundle' bit on the top-level folder. That would get lost by round-tripping the app through a .zip file, but that's not important anymore.
So the real question is, how are you inspecting the unzipped copy of your app? If it's via the command line, or some other tool that doesn't know (or care) that apps are really bundles then you will indeed get the behaviour you describe, even with the original.
I couldn't find any way to break the Finder's 'single entity' view of an app, even if I deliberately damaged it but maybe you have found a way. If so, I'd be interested to know how you did it.

Oneway sync of Windows folders

I have a folder where I don't want to modify any existing files in.
But I want to be able to add and remove files easily and recognize these files easily.
I thought in something like a SymLink but I want one folder where only the added files are shown and then the source folder with all files.
Is there anything like this? Or do you have a better idea?
Okay I found SyncToy from microsoft.
It has an echo mode which does what I wanted.

develop a firefox extension in place (not via encoding to xpi first)?

Developing an extension for Mozilla Firefox I wonder if there is an "easier way" to what I do right now. Currently I do:
Create a folder - in which to develop - for example myextension
Inside this folder: Create and Edit the Files (like install.rdf, chrome.manifest, xul files. Basically all the other structure of a Firefox extension (no problem here))
Zip-compress the content of the myextension to a ZIP-file (i.e. named myextension.zip)
Rename myextension.zip to myextension.xpi
Install the xpi-file-firefox-extension then in firefox
Restart Firefox
Test the extention
After each edit to the codebase of the extension I need to undergo the process of 3. zip-compress, 4. Rename, 5. install XPI file to firefox, 6 restart browser.
Of course I could automate some of this but still I wonder if there is another way to develop the firefox extension directly in the running firefox profile folder .
The extensions I know are stored in the Firefox profile folder as:
firefox/profile/extensions/nameofextension.xpi
I cannot remember well, but I think that there was a way to have the extension being stored unzipped as a folder there too? This way I would still need to restart after edits but not do all the laboursome zipping-renaming-installing.
Any ideas?
It is possible to setup a directory to "in-place-edit" a firefox extension. By this the effort between editing and testing of the Firefox-extension can be reduced.
I have found the good explanation on the blog https://blog.mozilla.org/addons/2009/01/28/how-to-develop-a-firefox-extension/
Here I want to give the principal steps necessary to achieve the "in-place-edit"
Step 1: You have to find your profile directory of Firefox.
For example in Linux this would often be often something like this:
~/.mozilla/firefox/#%#%.default/
Step 2: Go to this profile directory
Step 3: If you already have any extensions installed (like for example adblock+ or noscript), then inside this profile directory you will find a folder named extensions. If you do not have yet any additional extension installed, it might be easy to simply install any, only to have the **extensions" folder be setup for you.
Step 4: In this extensions folder you can create a new directory (let us name it "myextensions_1"), which shall contain the stuff of your plugin. This stuff would be the ordinary things like the install.rdf, chrome.manifest files and the content,skin,locale subdirectories. In effect all the stuff you would normaly zip up to become the XPI file.
Step 5. Create a file that is equal to the content of the <em:id> tag that you used in your ìnstall.rdf file. So if you used <em:id>myextensionname#author.org</em:id> you need to create a file named myextensionname#author.org. Inside this file you will write the location of the "in-place-edit-extension-folder" we created before. In our example this we would have
the file myextensionname#author.org
which contains only the text ~/.mozilla/firefox/#%#%.default/extensions/myextensions_1
Of course the text depends on the location of the folder you use for your plugin.
If you did all things correctly - and maybe double-checked with the instructions of the link above - you can restart or "newly start" firefox. The browser will ask you if you want to allow the usage of the plugin myextensionname#author.org, which you can conceed.
Now you can edit in the folder ~/.mozilla/firefox/#%#%.default/extensions/myextensions_1 and need not to worry about zipping-up -> renaming -> installing.
You simple restart Firefox and the edits to your extensions code will become available.
This will allow you swifter and faster developing "in-place".
Note: this is a shameless self-plug - I am talking about an extension I created myself.
Developing an extension in place is possible but has so many issues (mostly caching of all kinds) that it really isn't a good option. Still, you can simplify your development cycle a lot. For that you need to install the Extension Auto-Installer add-on in your Firefox. Then you can put a batch file (assuming that you are developing on Windows) into your extension directory along the lines of:
zip -r test.xpi * -xi *.bat *.xpi
wget --post-file=test.xpi http://localhost:8888/
del test.xpi
The required command line tools are all preinstalled on Unix-based systems, for Windows you can easily download them: zip, wget.
Then you will only need to run that batch file to update your extension in Firefox. If your extension isn't restartless then Firefox will restart automatically. So this replaces your steps 3 to 6.

Creating a file bundle on OSX

For an application I would like to store a collection of files together, and have them appear in the filesystem as a single file so its easy to manage. I am currently storing everything in a folder.
I would like to keep things accessible so you can manually edit the inside contents if neccesary.
One way to do this would be to create a zip archive and give it a custom extension other then .zip. Then it appears as a filetype and if needed you can unpack and access the content, but for normal use keep it hidden.
I can't seem to find a convenient way to do this. Boost and zlib can do the compression but don't work with archives. I found libzip but I have a hard time understanding how to use it and to me it seems that it only reads/writes zip archives without doing the actual compression.
Is there a more convenient way to tackle this?
Can you call system functions for creating an archive on OSX from c++ / Carbon?
Is there another way to make a folder appear as a single file?
In OSX, you can create Document Packages (similar to application bundles) which are treated as a single file in the Finder, but are really just directories with some internal structure.
Apple does not zip these packages, but they do provide the functionality you describe and they can be created and accessed through CoreFoundation by using CFBundleRef .
From the documentation:
... The important thing to remember about creating a document package is that it is just a directory. As long as the type of the document package is registered (as described in “Registering Your Document Type”), all you have to do is create a directory with the appropriate filename extension. (The Finder uses the filename extension as its cue to treat the directory as a package.) You can create the directory (and create any files you want to put inside that directory) using the standard BSD file system routines ...
As 1st step, simple rename the folder and add the extension .bundle, e.g. Myappdir.bundle
That's will show the whole folder as one file with a lego-like bundle icon.
The next step is you must create one Info.plist file inside.

Resources