Fantasy Grounds Fridays Pre
Page 1 of 2 12 Last
  1. #1

    Join Date
    May 2019
    Location
    Dorking, United Kingdom
    Posts
    24

    Zipping your Extensions

    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:

    Code:
    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...
    Attached Files Attached Files

  2. #2
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    11,087
    Blog Entries
    9
    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.

  3. #3

    Join Date
    May 2019
    Location
    Dorking, United Kingdom
    Posts
    24
    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...

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,484
    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?
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5

    Join Date
    May 2019
    Location
    Dorking, United Kingdom
    Posts
    24
    Quote Originally Posted by Trenloe View Post
    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!

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    26,484
    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.
    Attached Images Attached Images
    FG Con 16 Fantasy Grounds Online RPG Convention - Postponed New date To Be Confirmed.
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  7. #7

    Join Date
    May 2019
    Location
    Dorking, United Kingdom
    Posts
    24
    Quote Originally Posted by Trenloe View Post
    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.
    Last edited by ragnarol; May 14th, 2020 at 21:12.

  8. #8

  9. #9

    Join Date
    May 2019
    Location
    Dorking, United Kingdom
    Posts
    24
    Ok, I am zipping them with 7zip CLI and that works like a charm. Annoying the bug in the powershell commandlet.

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

  10. #10
    Ampersandrew's Avatar
    Join Date
    Nov 2017
    Location
    Belfast, Northern Ireland
    Posts
    225
    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 -
    Last edited by Ampersandrew; June 5th, 2020 at 23:03.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in