PDA

View Full Version : Zipping your Extensions



ragnarol
May 14th, 2020, 20:03
I didn't know if this was for the Support forum, the Armoury in general, or specific to the Extensions sub forum.

Basically I have problem when I compress the extension I am working on with Powershell:



Compress-Archive ./src/* $fileName -Update


If I do this way Fantasy Grounds is unable to load any of my referenced files.

However, if I zip it using the windows context menu "Send to Compressed folder" the extension works perfectly fine.

I have tried to open a working and a non working zip file with 7zip to see if I see anything different, but they look the same, only difference is that offset 0 on the working file is for the "extension.xml" while in the non working extension offset 0 is for the lua script.

Attached are the workign and non working versions of the same extension...

What I am doing wrong? I am just trying to automate the packaging of the extension...

LordEntrails
May 14th, 2020, 20:18
FG can only use zip compression. Other methods, such as the default 7zip method will not work. Also, you can not zip the containing folder, you must only zip the contents of the folder.

ragnarol
May 14th, 2020, 20:27
Thanks! It is just Zip as far as I know, howdo people zip theirs? I am pretty sure there would be different ways.

Just for clarity, none of the extensions is compressed using 7zip. Both are compressed using built in windows zip compressions. One is the context menu in Windows Explorer and the other one is the PowerShell command let "Compress-Archive" which I would have expected to be doing the same thing as the context menu...

Trenloe
May 14th, 2020, 20:37
I can load the SW Trait Roll Details_v0.5-dont work.ext file in a SavageWorlds campaign. I haven't tested any functionality though.

What issue were you having with it?

ragnarol
May 14th, 2020, 20:41
I can load the SW Trait Roll Details_v0.5-dont work.ext file in a SavageWorlds campaign. I haven't tested any functionality though.

What issue were you having with it?

Can you try reloading with the console open? I get a couple of errors saying it cannot load "main.lua", and it is right, the code don't load and run.

(It is just a minor tweak on the savage worlds trait detail extension shared in the SW subforum)

Thanks!

Trenloe
May 14th, 2020, 21:05
Ah, OK, so it raises a couple of warnings. Errors would cause the console window to pop up.

Looking at the raw data in Notepad++ (see the attached two images).

The one that works has the LUA file with a forward slash (lua/main.lua), the one that doesn't work has it with a backslash (lua\main.lua). This might be the reason that FG can't find the file, but I don't know how to fix it in PowerShell.

ragnarol
May 14th, 2020, 21:09
Ah, OK, so it raises a couple of warnings. Errors would cause the console window to pop up.

Looking at the raw data in Notepad++ (see the attached two images).

The one that works has the LUA file with a forward slash (lua/main.lua), the one that doesn't work has it with a backslash (lua\main.lua). This might be the reason that FG can't find the file, but I don't know how to fix it in PowerShell.

Oh, thanks! That's definitively a lead!

I guess PS is NOT using the *nix approach for paths. I will investigate how to deal with that.

I guess I will need to move to a different approach.

It's there anyone automating their zipping? I am using VSCode for the extension editing, and i was just trying to get a build task to pack it and deploy it in my extensions folder.

ragnarol
May 14th, 2020, 21:11
Bingo!

https://superuser.com/questions/1369344/zip-file-made-in-powershell-cant-be-used-in-linux

ragnarol
May 15th, 2020, 07:57
Ok, I am zipping them with 7zip CLI and that works like a charm. Annoying the bug in the powershell commandlet.



&"C:\Program Files\7-Zip\7z.exe" a $fileName ./src/*

Ampersandrew
June 5th, 2020, 22:55
I'm running Debian in WSL on Windows 10. I have a bash script in the root of the game mode.



#!/bin/bash

rm -v ../DeadlandsClassic.pak

zip -r ../DeadlandsClassic.pak * -x $0 t/ t/* misc/ misc/*


I have a folder for stuff I want to keep about but don't want in the final pak file. That's the misc. The t folder contains tests for the lua code.

Of course, I tend to run this too, or I get lots of editor back up files in there that I don't want.


#!/bin/bash

find . -iname ".*~" -o -iname "*~" | xargs rm -vf -

ragnarol
June 5th, 2020, 23:09
I'm running Debian in WSL on Windows 10. I have a bash script in the root of the game mode.



#!/bin/bash

rm -v ../DeadlandsClassic.pak

zip -r ../DeadlandsClassic.pak * -x $0 t/ t/* misc/ misc/*


I have a folder for stuff I want to keep about but don't want in the final pak file. That's the misc. The t folder contains tests for the lua code.

Of course, I tend to run this too, or I get lots of editor back up files in there that I don't want.


#!/bin/bash

find . -iname ".*~" -o -iname "*~" | xargs rm -vf -

Neat. 7z is working fine but thanks for the script!

tcrossbar
August 24th, 2020, 06:09
I only really use one extension, GM Wintermute's Background theme maker (I turn the map of my campaign into the background image for FGU). It stopped working after the most recent update, throwing errors that it can't find the files. It's not changed since I started the campaign back in april, so I'm assuming it must be related to all of this.

Anyway, thought I'd just add in my experience.

https://www.fantasygrounds.com/forums/showthread.php?47787-Utility-Background-Theme-Maker-for-FG-(All-Rulesets)

tcrossbar
August 24th, 2020, 06:15
I only really use one extension, GM Wintermute's Background theme maker (I turn the map of my campaign into the background image for FGU). It stopped working after the most recent update, throwing errors that it can't find the files. It's not changed since I started the campaign back in april, so I'm assuming it must be related to all of this.

Anyway, thought I'd just add in my experience.

https://www.fantasygrounds.com/forums/showthread.php?47787-Utility-Background-Theme-Maker-for-FG-(All-Rulesets)

I extracted the package that this theme maker thing made, deleted the extension, re-zipped it with windows and changed the .zip to .ext and now the extension works fine again. Weird.

tcrossbar
September 4th, 2020, 02:13
I extracted the package that this theme maker thing made, deleted the extension, re-zipped it with windows and changed the .zip to .ext and now the extension works fine again. Weird.

I lied. It works fine again for me, but none of my players can see the background image I set up, anymore. Even when I log into my game as a player on my own machine it works fine, but it just throws an error and shows up as a blank white background for all of my players. =(
Any advice?

Trenloe
September 4th, 2020, 08:03
I lied. It works fine again for me, but none of my players can see the background image I set up, anymore. Even when I log into my game as a player on my own machine it works fine, but it just throws an error and shows up as a blank white background for all of my players. =(
Any advice?
What’s the error?

tcrossbar
September 5th, 2020, 04:12
What’s the error?

"Could not find icon (fgthememaker)
Could not find icon (gmwintermute)"
were the relevant bits? It is exactly the same error message I started getting randomly after an update to FGU. I found a thread in the FGU forums where someone reported having the exact same problems with an extension and it seemed like it turned out to be a problem with how FGU was handling the compression (which must have been changed because it worked the day before, sort of thing?) but that guy got super aggro and inflammatory in the thread so it was closed and now I can't find it again.

Like I said, I was having the exact same error messages and issues so I unzipped the entire extension into a folder, deleted the extension, re-zipped it up with just regular winzip, and bam it started working for me great again. So I assumed it was working fine, but just the other day I was looking over my wife's shoulder while she was working on her character sheet and I noticed no background. I texted everyone else in my group and they were all like "Yeah, it's not worked in a while but we just assumed it was something you took down for some reason."
I know it's definitely not any sort of critical or needed thing, but I really loved having their campaign map (centered on where they were in the world at the time) be what greeted them when they launched Fantasy Grounds, and it's just not doing the thing anymore for my players (but like I said, works fine for me on my machine) and I've no idea why.

Mysteria_Sdrassa
September 6th, 2020, 15:41
I get the same errors near the end of the log, plus an earlier one that says can not locate extension