.rfcmp CLI tooling

Discussion in 'Component and Mod Packaging' started by BigBl4ckW0lf, Oct 9, 2020.

  1. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    With the newest GT3 cars and some still existing issues with the skin syncing process I am facing a problem for our league.

    We want to create "a" league mod to eliminate possible issues and make skins "preloadable" via the workshop.
    For our league it means that we have to click through the single component for each single car update S397 releases.

    If there would be a filled IMSA league this could mean 1 LMP, 5 GTE, 13 GT3 == 19 Times clicking through the process.

    Since I am a software engineer myself and the GUI for the .rfcmp creation is not much more than text inputs, I would like to see a tool which is controllable via a CLI. The "ModMgr.exe" can only modify MAS files as far as I can tell and it would be nice to ease the process of a league mod creation.

    My idea is to do it somewhat the same way as the rfmod creation works: load a ".dat" (or however you want to call it) with the informations and then create the rfcmp file.

    As far as I can tell the informations to give would be:
    • Package name
    • Version
    • Ugrade from
    • Minimum Build
    • a list of MAS files
    It would be nice to get feedback from any developer and if such a tool is not going to be created I would like to know why.


    EDIT: Since I am now trying to get the icons for the new UI working I am also facing the issue that with it activated I am unable to package, install and uninstall the rfcmp file with the "Create Single Component" GUI.|

    EDIT2(IMPORTANT NOTE): The cmppack.exe is NOT working for official car skinpacks since it cannot handle the "BaseVersion" (in the MAS Utility GUI it is called "Update from")
     
    Last edited: Oct 16, 2020
    Audere est facere likes this.
  2. dazzer

    dazzer Registered

    Joined:
    Feb 3, 2018
    Messages:
    477
    Likes Received:
    1,395
    MAS2 also creates the rfcmp
    aaaaaaaa.jpg
     
  3. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    That's the MAS Utility not the ModMgr and this is the exact problem.

    The problem is that the current workflow needs you to manually click and type through the process. Which would be necessary every time any car which receives a patch or a skin is updated.
    If there is a BOP update the worst case would be to go through this process 13 Times (every GT3).

    That's the reason I want to be able to run a script to generate the updated .rfcmp file.
     
  4. Mangoletsi

    Mangoletsi Registered

    Joined:
    Feb 2, 2012
    Messages:
    462
    Likes Received:
    118
    dazzer likes this.
  5. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    To find the `ModMgr.exe` which is not helping and a broken link to the tool I want?

    More importantly it would be nice to have official tooling.
    Mostly to ensure that there is an instant update if the rfcmp format ever changes.

    IMPORTANT NOTE: The cmppack.exe is NOT working for official car skinpacks since it cannot handle a "BaseVersion" (in the MAS Utility GUI it is called "Update from")
     
    Last edited: Oct 16, 2020
  6. dazzer

    dazzer Registered

    Joined:
    Feb 3, 2018
    Messages:
    477
    Likes Received:
    1,395
    I'm sorry but nobody will answer this, unfortunately it is not necessary, we all use the current system and nobody complains, so I doubt that they will receive the answer they want.
     
  7. TheMenace

    TheMenace Registered

    Joined:
    Dec 27, 2019
    Messages:
    17
    Likes Received:
    26
    Here's the output from a call to "ModMgr.exe -h":
    [​IMG]
    The "-b" option lets you build a rfcmp from a .dat file. A .dat file can have multiple entries, that is sections starting with " [Package]" or "[Component]", and thats what the "index" is for. You might have a file called "pkginfo.dat" in your "%appdata%" directory which can be used as reference, an easy way to access that directory is to type "explorer %appdata%" at the command line.

    For some reason the "-b" option has been left out in the documentation("Support/CLI.txt").

    Welcome to rFracture 2!
     
    Last edited: Oct 16, 2020
  8. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    I have seen this option but it did not seem to work.

    My created .dat file is:
    Code:
    [Component]
    Name=Ferrari_488_GT3_2020
    Type=2
    Version=1.21_DAR_0.2
    BaseVersion=61d0f9965a3db062a07a92196aa94704bdea2d78ad5ae73953981e2378389e6f
    MinVersion=
    Author=Mod Team
    Date=132245047195920000
    ID=AAA9999
    URL=www.YourModSite.com
    Desc=Your new mod.
    Category=3
    Origin=0
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\ModMgrTest\Ferrari_488_GT3_2020_1.21_DAR_0.2.rfcmp
    NumMASFiles=1
    MASFile=C:\ModMgrTest\F488_TEAMS.mas
    rFmFile=
    IconFile=
    SmallIconFile=
    
    
    I am running it with:
    Code:
    Bin32/ModMgr.exe -b"C:\ModMgrTest\pkginfo.dat" 0
    It is creating the rfcmp but it is not setting the "BaseSignature" in the .mft file which makes it not suitable for official cars.
    It does not matter if I set the BaseVersion to the version number or the resulting BaseSignature.

    When trying to edit in the BaseSignature manually by modifying the rfcmp with an hex editor, the resulting .mft file after an extraction is cut off (only showing "MASFile=F48").

    EDIT: I tried to add a placeholder mas file to the rfcmp and then replacing it with spaces and not having anything useful cut off.

    The extract worked and the .mft is good but the launcher gives a verification error on installing the component.
    If I just add the BaseSignature without any other workarounds it causes the rF2 Launcher to crash immediately.
     
    Last edited: Oct 17, 2020
  9. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    833
    Likes Received:
    241
    A few days ago i saw your thread. I already had managed to do the .mas packing progress with a batch file. Now inspired by your thread i tried to pack the .rfcmp files via a batch and it worked like a charm, also with the S397 cars and the update function for league skins. I don't know where your problem is. This is my cmpinfo.dat

    Code:
    [Component]
    Name=AstonMartin_Vantage_GT3_2019
    Type=2
    Version=rFLN201
    BaseVersion=1.74
    MinVersion=
    Author=
    Date=0
    ID=
    URL=
    Desc=
    Category=0
    Origin=0
    Flags=1
    CurLocation=0
    NumLocations=1
    Location=F:\.....\.....\rFLN Saison III\Workshop\Content\rF2LN_K1_AstonMartin_Vantage_GT3_2019_Teams.rfcmp
    NumMASFiles=1
    MASFile=F:\.....\.....\rFLN Saison III\Workshop\Mas Files\rF2LN_K1_AstonMartin_Vantage_GT3_2019\rF2LN_K1_AstonMartin_Vantage_GT3_2019_Teams.mas
    rFmFile=
    IconFile=
    SmallIconFile=
     
    BigBl4ckW0lf likes this.
  10. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    Ok ..
    Code:
    Flags=1
    fixed it.
     
    McFlex likes this.
  11. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    833
    Likes Received:
    241
    Happy i could help and happy that you inspired me to test the batch packing. Saves at least some time :)
     
  12. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    45
    Likes Received:
    24
    I'm currently stuck with the message "Error creating package file.", even with your mentioned example dat contents. Did you add something except the mentioned commandline? Thanks!
     
  13. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    833
    Likes Received:
    241
    Can you show us your command line and pkg file?
     
  14. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    45
    Likes Received:
    24
    I've just your example and commandline, just with different paths and another MAS file, of course.

    Short context:

    The .dat files I've used before for testing are part of my orchestration toolkit, but I have to invoke the package/ mod building currently using the GUI of MAS2, which is flaky and not robust. But if not interrupted, this process works. Thats confusing me a bit, help would be greatly appreciated. This would improve that build process a lot, I guess.
     
    Last edited: Oct 29, 2020
  15. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    833
    Likes Received:
    241
    Ok i just asked because i had a similar issue. I tried to execute the batch from another directory than the root and that gave me this error message too. This is how i call the modmgr.exe

    Code:
    pushd D:\Steam\steamapps\common\rFactor 2 DX11
    
    Bin32\ModMgr.exe -b"D:\Steam\steamapps\common\rFactor 2 DX11\ModDev\cmpinfo.dat" 0
    
    pause
     
    guenther likes this.
  16. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    45
    Likes Received:
    24
    For the protocol - pushd did the trick :) Thank you
     
    McFlex likes this.
  17. Sachmo

    Sachmo Registered

    Joined:
    Apr 30, 2016
    Messages:
    17
    Likes Received:
    3
    This is partially working for me. It works for me for [Components] but if I go to build a [Package] it fails with the same message - "Error creating package file."

    Has anyone got this working with Packages?

    I change the directory to the rFactor 2 directory, and run the below command, but get the above error. Any help is appreciated, cheers!

    Bin64\ModMgr.exe -b"D:\pkginfo.dat"

    My pkginfo.dat is a direct copy and paste of a package I created through MAS Utility (GUI), which had the desired tracks and cars in it. Straight after I copied the pkginfo.dat, uninstalled the Mod and deleted it using ModMgr, and attempted to recreate from the command line. But the error occurs.
     
  18. BigBl4ckW0lf

    BigBl4ckW0lf Registered

    Joined:
    Sep 30, 2020
    Messages:
    9
    Likes Received:
    8
    Does it work if you execute it with an additional "0" at the end of the command?
    Code:
    Bin64\ModMgr.exe -b"D:\pkginfo.dat" 0
     
  19. guenther

    guenther Registered

    Joined:
    Oct 5, 2018
    Messages:
    45
    Likes Received:
    24
    for my tests, I always had do overwrite the current working directory aswell. Use -c"path" as first flag.

    in case you are using paid content, make sure your server keys are present.
     
  20. Sachmo

    Sachmo Registered

    Joined:
    Apr 30, 2016
    Messages:
    17
    Likes Received:
    3
    Oh, big apologies, I have indeed been running it with a 0 at the end. Sorry for misrepresenting my code earlier. Eagle-eyed pickup there, but yes I have been doing that, sorry... Bin64\ModMgr.exe -b"D:\pkginfo.dat" 0

    In relation to the -c"path", I'll give it a go. I have been in the practice of setting the command line directory (CD C:\etc....) as a separate upfront line in the batch file, which I assumed was doing the same thing. But never assume! I will try as you suggested and advise. Thank you.
     

Share This Page