.rfcmp CLI tooling

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

  1. Samoht

    Samoht Registered

    Joined:
    Mar 7, 2023
    Messages:
    13
    Likes Received:
    17
    Hello,

    Coming back on this interesting topic. I am trying to generate a rfmod file using the bellow command without sucess:

    Code:
    .\Bin64\ModMgr.exe -bC:\Users\user\OneDrive\Bureau\rfactor2-server\rfactor2-dedicated\Bin64\package.dat 0
    
    The content of my package file is the following:
    Code:
    [Package]
    Name=Test Series
    Type=0
    Version=1.0
    BaseVersion=
    MinVersion=
    Author=Mod Team
    Date=132570058370670000
    ID=AAA9999
    URL=website.com
    Desc=Your new mod.
    Category=0
    Origin=0
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\Users\user\OneDrive\Bureau\Test_Series_v1.0.rfmod
    CurRFM=0
    NumRFM=1
    RFM=C:\Users\user\OneDrive\Bureau\rfactor2-server\rfactor2-dedicated\Bin64\testrace.mas
    NumTrackFiles=1
    Track="LochDrummond_2013 1.23,0" "Loch Drummond -- Short Layout,1" "Loch Drummond -- Long Layout,0"
    NumVehicleFiles=2
    Vehicle="Porsche_Cup_GT4_2020 2.01,0" "Porsche 718 GT4 Cup #99,1" "Porsche 718 GT4 Cup #1,0" "Porsche 718 GT4 Cup #4,0" "Porsche 718 GT4 Cup #5C,0" "Porsche 718 GT4 Cup #2,0" "Porsche 718 GT4 Cup #5,0" "Porsche 718 GT4 Cup #5B,0" "Porsche 718 GT4 Cup #145,0" "Porsche 718 GT4 Cup #7,0" "Porsche 718 GT4 Cup #66,0" "Porsche 718 GT4 Cup #9,0" "Porsche 718 GT4 Cup #13,0" "Porsche 718 GT4 Cup #15,0" "Porsche 718 GT4 Cup #85,0" "Porsche 718 GT4 Cup #19,0" "Porsche 718 GT4 Cup #21,0" "Porsche 718 GT4 Cup #22,0" "Porsche 718 GT4 Cup #22B,0" "Porsche 718 GT4 Cup #23,0" "Porsche 718 GT4 Cup #32,0" "Porsche 718 GT4 Cup #33,0" "Porsche 718 GT4 Cup #35,0" "Porsche 718 GT4 Cup #37,0" "Porsche 718 GT4 Cup #44,0" "Porsche 718 GT4 Cup #51,0" "Porsche 718 GT4 Cup #88,0" "Porsche 718 GT4 Cup #66B,0" "Porsche 718 GT4 Cup #77C,0" "Porsche 718 GT4 Cup #67,0" "Porsche 718 GT4 Cup #88B,0" "Porsche 718 GT4 Cup #68,0" "Porsche 718 GT4 Cup #71,0" "Porsche 718 GT4 Cup #99B,0" "Porsche 718 GT4 Cup #77,0" "Porsche 718 GT4 Cup #77B,0" "Porsche 718 GT4 Cup #132,0" "Porsche 718 GT4 Cup #168,0" "Porsche 718 GT4 Cup #287,0" "Porsche 718 GT4 Cup #306,0" "Porsche 718 GT4 Cup #718,0" "Porsche 718 GT4 Cup #962,0" "Porsche 718 GT4 Cup #992,0"
    NumOtherFiles=0
    
    Any help would be appreciated.

    Thanks!
     
  2. As I am also using pkginfo.dat files this is what I have done for a simple mod package (srjfcup.dat named):

    Code:
    [Package]
    Name=SRJF-992CUP
    Type=0
    Version=3.7
    BaseVersion=
    MinVersion=
    Author=Mod Team
    Date=133226665286210000
    ID=AAA9999
    URL=www.YourModSite.com
    Desc=Your new mod.
    Category=0
    Origin=0
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\Packages\SRJF-992CUP.rfmod
    CurRFM=0
    NumRFM=1
    RFM=E:\devel\build mod package\SRJF-992CUP.mas
    NumTrackFiles=1
    Track="Nurburgring_2018 v2.43,0" "Nurburgring -- 24h,0" "Nurburgring -- 24h Support,0" "Nurburgring -- Combined,0" "Nurburgring -- Endurance Series,0" "Nurburgring -- Grand Prix,0" "Nurburgring -- Grand Prix No Chicane,1" "Nurburgring -- Nordschleife,0" "Nurburgring -- Sprint,0" "Nurburgring -- Sprint No Chicane,0"
    NumVehicleFiles=1
    Vehicle="Porsche_992_GT3_Cup_2022 v1.05,0" "Porsche 992 Cup #0,1" "Porsche 992 Cup #10,1" "Porsche 992 Cup #14,1" "Porsche 992 Cup #25,1" "Porsche 992 Cup #26,1" "Porsche 992 Cup #27,1" "Porsche 992 Cup #28,1" "Porsche 992 Cup #3,1" "Porsche 992 Cup #5,1" "Porsche 992 Cup #57,1" "Porsche 992 Cup #6,1" "Porsche 992 Cup #7,1" "Porsche 992 Cup #8,1" "Porsche 992 Cup #9,1"
    NumOtherFiles=0
    rFmFile=E:\devel\build mod package\default.rfm
    IconFile=E:\devel\build mod package\icon.dds
    SmallIconFile=E:\devel\build mod package\smicon.dds
    
    CurPackage=0
    
    In order to be prepared a default.rfm and icon.dds files need to be copied in place ofc - you will find them in any mas file in mastemp folder in appdata\roaming of your users folder.

    Command I am using

    Code:
    "C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\bin64\ModMgr.exe" -c"C:\Program Files (x86)\Steam\steamapps\common\rFactor 2" -b"E:\devel\build mod package\srjfcup.dat" 0
    
    I think the CurPackage=0 line is not needed because it is the only package definition within the file and only the mas utility needs it, but I am using it anyway.

    Hope this helps.

    edit: I think "-c" option is mandatory in this process for modmgr
     
  3. Samoht

    Samoht Registered

    Joined:
    Mar 7, 2023
    Messages:
    13
    Likes Received:
    17
    Hey @StoneRacing !

    Thank you again to take time to answer.

    Bellow is my latest .dat file that I am using:
    Code:
    [Package]
    Name=FlatOut TestRace
    Type=0
    Version=1.0
    BaseVersion=
    MinVersion=
    Author=FlatOut Mod Team
    Date=
    ID=
    URL=flatout.com
    Desc=Your new mod.
    Category=0
    Origin=0
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\rfactor_flow\output\FlatOut TestRace.rfmod
    CurRFM=0
    NumRFM=1
    RFM=C:\rfactor_flow\default.rfm
    NumTrackFiles=1
    Track="Nurburgring_2018 2.43,0" "Nurburgring -- Nordschleife,1" "Nurburgring -- 24h,0" "Nurburgring -- Combined,0" "Nurburgring -- Grand Prix,0" "Nurburgring -- Grand Prix No Chicane,0" "Nurburgring -- Endurance Series,0" "Nurburgring -- Sprint,0" "Nurburgring -- Sprint No Chicane,0" "Nurburgring -- 24h Support,0"
    NumVehicleFiles=1
    Vehicle="Porsche_911_GT3_R_2018 3.57,0" "Porsche 911 GT3R #37,1" "Porsche 911 GT3R #177,0" "Porsche 911 GT3R #55,0" "Porsche 911 GT3R #01,0"
    NumOtherFiles=0
    rFmFile=C:\rfactor_flow\default.rfm
    IconFile=C:\rfactor_flow\icon.dds
    SmallIconFile=C:\rfactor_flow\smicon.dds
    
    I strongly suspect that the issue is coming from my .mas file and especially my .rfm file inside.

    Would it be possible for you to send me your .mas file that you use in your .dat file, I would like to compare with mine.

    Code:
    RFM=E:\devel\build mod package\SRJF-992CUP.mas
    
    Thank you!
     
  4. I have attached the mas file - but I think there is nothing special in it ;-) I will go through your info.dat later on and come back ...
     

    Attached Files:

  5. Samoht

    Samoht Registered

    Joined:
    Mar 7, 2023
    Messages:
    13
    Likes Received:
    17
    Problem solved!

    Some discrepencies into my .dat file (car's names) + forgot the "v" to prefix the version of both Track and Vehicle.

    Also the .mas file must be pre-generated using the default.rfm the icon.dds and the smicon.dds and then to be fed to the command that generate the .rfmod through the RFM= variable.

    Thank you all for the help!
     
  6. Sounds good.

    Yes, the rfm and icon files must be existing in order to generate the rfm mas file.

    Currently I am working on several things - one task on my to do list is to have the track names and team names extracted from the mas files, too, in order to setup an info.dat file automatically or to use it in a WebUI.

    But the generation of rfmod packages by cli helps a lot e.g. like yesterdays update of the GT3 from 3.55 to 3.57 :)
     
  7. I know it is a little older, but ...

    Does anybody know what options modmgr has to be given in order to install a rfcmp package from e.g. packages folder? And if so would you be so kind to share it?
     
  8. Samoht

    Samoht Registered

    Joined:
    Mar 7, 2023
    Messages:
    13
    Likes Received:
    17
    Hello @StoneRacing,

    It seems the doc does not include installation of .rfcmp by using command line. It seems we can only install .rfmod file in command line using the following command:

    ModMgr.exe -p PACKAGE_FOLDER_LOCATION -i my_mod.rfmod
     
  9. @Samoht

    Thanks for your reply.

    Yes, I am installing rfmod files with the modmgr by CLI already (add -c DIRECTORY to the options if using start-process of PS ;-) ), but was asking myself about rfcmps.

    As they are kind of archive files I am not sure if it is allowed to unpack and install them with third party tools or not ...
     
  10. Felipe Granado

    Felipe Granado Registered

    Joined:
    Aug 29, 2013
    Messages:
    52
    Likes Received:
    8
    @StoneRacing the command to install .rfcmp is the same to install .rfmod.

    Try this:

    Code:
    cd [rf2root folder]
    
    ModMgr.exe -i"AstonMartin_Vantage_GT3_2019_v3.60.rfcmp" -p"[packages folder]" -d"[rf2root folder]"
    The .rfcmp file must be in the Packages folder. To the installation have a success, the CMD must be defined to rf2 root folder, because after the installation, the ModMgr will verify the .mas file created in installed\vehicles folder (in this case, Aston Martin...\3.60\car.mas)

    Tell me if you have a success!

    PS . I don't translated this text and I'm not English sorry for this!
     
    Last edited: Oct 13, 2023
    Deleted member 58016 likes this.
  11. Thanks a lot.

    I am a dumb one ... I used the full path to the rfcmp with option -i ... using just the rfcmp filename makes it working :)
     
  12. Felipe Granado

    Felipe Granado Registered

    Joined:
    Aug 29, 2013
    Messages:
    52
    Likes Received:
    8
    I made the PowerShell file wich automate the download and installation of any content, just put the content ID separated by comma. The script ask if you want delete .rfcmp file after installation (to save disk). After installation all contents, the script will be remove all other files in the content ID folder (generally .PSD files).

    Is anyone want, I can post here!

    Ps. Now, I will try automate the rfmod creation and open up the Dedicated (+one-click)
     
    Deleted member 58016 likes this.
  13. Sounds similar to the scripts I wrote and to the newer ones I am currently working on ... but to be honest: I am asking myself why I am working on them and for what reason.

    The modmgr can be executed for example with
    Code:
    cd <rfactor 2 base>
    bin64\modmgr.exe -i"corvette_c8r_gte_2020_v.314.rfcmp" -p"C:\Program Files (x86)\Steam\steamapps\workshop\content\365960\2331284105" -d"<rfactor 2 base>"
    We need to keep in mind that a serverunlock.bin is needed in userdata folder in order to extract DLC content ...
     
    Felipe Granado likes this.
  14. gagipro

    gagipro Registered

    Joined:
    Feb 26, 2013
    Messages:
    473
    Likes Received:
    7
    Hello,

    I tried to fork the mascompiler project available on this forum and with open sources available on gitlab to use modmgr instead of cmppack and mas2.exe.

    It do work with modmgr and creates a rfcmp package from a generated pkginfo.dat, however, I didn't manage to create an update package from a baseversion.

    Did someone managed to create an update rfcmp package from a baseversion with the pkginfo.dat method and "modmgr -b" command line, allowing update from a baseversion package in modmgr tool?

    I'm available to share the mascompiler fork and try to improve it.

    Thanks
     
  15. Code:
    [Package]
    Name=SRJF-MCLASS
    Type=0
    Version=1203
    BaseVersion=
    MinVersion=
    Author=SRJF Server Mgmt
    '

    I would say that are the important entries in pkginfo.dat - have not tried it myself, but in my experience _Version_ is a numeric value which can be chosen very general (like I do ... it is month followed by day without dot notation) - so _BaseVersion_ might be the indicator for an update package.

    Let's assume

    Version=1.1
    BaseVersion=1.0
    MinVersion=1.0

    So we are building a package of version 1.1 which requires a minversion 1.0 and is based on / an update to baseversion 1.0?

    I would say it is the default modmgr command to build the package by using pkginfo.dat.

    As said - need to try it, but ... and installing with modmgr should be equivalent to installing a _base_ package.

    edit: I guess name of the package / mod needs to be identical to the base one
     
  16. Code:
    [Package]
    Name=Base2UpdateMod
    Type=0
    Version=1.0
    BaseVersion=
    MinVersion=
    Author=Mod Team
    Date=133464319700640000
    ID=AAA9999
    URL=www.YourModSite.com
    Desc=Your new mod.
    Category=0
    Origin=0
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\Packages\Base2UpdateMod.rfmod
    CurRFM=0
    NumRFM=1
    RFM=C:\Users\Stone\AppData\Roaming\~MASTEMP\\Base2UpdateMod.mas
    NumTrackFiles=1
    Track="BrandsHatch_2021 v1.07,0" "Brands Hatch GP,1" "Brands Hatch Indy,0"
    NumVehicleFiles=1
    Vehicle="AstonMartin_Vantage_GTE_2019 v3.17,0" "Aston Martin Vantage GTE #05,1" "Aston Martin Vantage GTE #07,0" "Aston Martin Vantage GTE #11,0" "Aston Martin Vantage GTE #28,0" "Aston Martin Vantage GTE #29,0" "Aston Martin Vantage GTE #54,0" "Aston Martin Vantage GTE #55,0" "Aston Martin Vantage GTE #67,0" "Aston Martin Vantage GTE #777,0" "Aston Martin Vantage GTE #84,0" "Aston Martin Vantage GTE #95,0" "Aston Martin Vantage GTE #97,0" "Aston Martin Vantage GTE #98,0"
    NumOtherFiles=0
    rFmFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\default.rfm
    IconFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\icon.dds
    SmallIconFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\smicon.dds
    
    [Package]
    Name=Base2UpdateMod
    Type=0
    Version=1.1
    BaseVersion=1.0
    MinVersion=
    Author=Mod Team
    Date=133464320179670000
    ID=AAA9999
    URL=www.YourModSite.com
    Desc=Your new mod.
    Category=0
    Origin=0
    Flags=1
    CurLocation=0
    NumLocations=1
    Location=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\Packages\Base2UpdateMod.rfmod
    CurRFM=0
    NumRFM=1
    RFM=C:\Users\Stone\AppData\Roaming\~MASTEMP\\Base2UpdateMod.mas
    NumTrackFiles=1
    Track="BrandsHatch_2021 v1.07,0" "Brands Hatch GP,0" "Brands Hatch Indy,1"
    NumVehicleFiles=1
    Vehicle="AstonMartin_Vantage_GTE_2019 v3.17,0" "Aston Martin Vantage GTE #05,0" "Aston Martin Vantage GTE #07,0" "Aston Martin Vantage GTE #11,0" "Aston Martin Vantage GTE #28,0" "Aston Martin Vantage GTE #29,0" "Aston Martin Vantage GTE #54,1" "Aston Martin Vantage GTE #55,0" "Aston Martin Vantage GTE #67,0" "Aston Martin Vantage GTE #777,0" "Aston Martin Vantage GTE #84,0" "Aston Martin Vantage GTE #95,0" "Aston Martin Vantage GTE #97,0" "Aston Martin Vantage GTE #98,0"
    NumOtherFiles=0
    rFmFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\default.rfm
    IconFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\icon.dds
    SmallIconFile=C:\Users\Stone\AppData\Roaming\~MASTEMP\smicon.dds
    
    CurPackage=1
    
    Done a simple one - if I understand you in the right way.

    I would it will not work as expected (adding Indy layout to already existing GP layout, but replacing it ...), but BaseVersion and Version seem to be the parameters which need to be set.

    BaseMod must be installed prior to creating / installing update mod.
     
  17. gagipro

    gagipro Registered

    Joined:
    Feb 26, 2013
    Messages:
    473
    Likes Received:
    7
    tried it like this :
    [Component]
    Name=Ledenontest
    Type=1
    Version=0.01
    BaseVersion=
    MinVersion=
    Author=Gagi Pro
    Date=133464603960810410
    ID=AAA19781
    URL=
    Desc=Ledenontest 0.01
    Category=55
    Origin=1
    Flags=0
    CurLocation=0
    NumLocations=1
    Location=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\Ledenontest_v0.01.rfcmp
    NumMASFiles=5
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtest.mas
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestgmts.mas
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestmaps.mas
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestmats.mas
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestmain.mas
    rFmFile=
    IconFile=
    SmallIconFile=

    CurComponent=0

    [Component]
    Name=Ledenontest
    Type=1
    Version=0.02
    BaseVersion=0.01
    MinVersion=
    Author=Gagi Pro
    Date=133464604922871728
    ID=AAA19781
    URL=
    Desc=Ledenontest 0.02
    Category=55
    Origin=1
    Flags=1
    CurLocation=0
    NumLocations=1
    Location=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\Ledenontest_v0.02.rfcmp
    NumMASFiles=2
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestv002.mas
    MASFile=C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\bin\ledtestmainv002.mas
    rFmFile=
    IconFile=
    SmallIconFile=

    CurComponent=1


    calling modmgr -b"pkg.dat" 0 create the 0.01 version
    never I'm able to create the 2nd component even after installing the 1st one

    the command should be calling modmgr -b"pkg.dat" 1 ?

    the only way to manage to create both rfcmp is with mascompiler which creates ever directly rfcmp or a pkg.dat, not matter what I do if I manage to pack them, they appear like two different packages and 0.02 isn't an upgrade to 0.01 but a different version installed in //, but they appear both in same installed folder.

    C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\Bin64>ModMgr.exe -b"c:\Program Files (x86)\Steam\steamapps\common\rFactor 2\ModDev\test.cmpinfo" 1

    C:\Program Files (x86)\Steam\steamapps\common\rFactor 2\Bin64>

    Getting mod inventory ...
    Reading package config file c:\program files (x86)\steam\steamapps\common\rfactor 2\moddev\test.cmpinfo
    Unable to locate specified config in .dat file.

    I'm lost
     
    Last edited: Dec 7, 2023
  18. Code:
    -c"$RFACTORDIR" -o"$RFACTORDIR\Packages" -b"$RFACTORDIR\bmp\$DATFILE" 0
    Those are the arguments I pass to modmgr when building a mod package - I am using absolute path all the time because of encountering various errors and failures without using.

    I am passing value 0 to modmgr because I am always using a templated pkginfo.dat containing only one definition and I am using type=0 instead of type=1 - not sure, but type=1 is mandatory if a e.g. car package is built.

    I never had any need for building an update package, sorry; my last guess without trying myself is to use absolute path and full amount of options.
     
  19. gagipro

    gagipro Registered

    Joined:
    Feb 26, 2013
    Messages:
    473
    Likes Received:
    7
    Hello,

    the idea was to create a base package, then only create new mas files were updated, create an update component.
    result is 1GB for base component, and 20MB for update component.
    it do work with MAS2, when I do it all in gui.

    I noticed the mft created during the MAS packing contains :
    Flags=0
    RefCount=1
    Signature=362e65d3bb3a48b08454f391079931719732918f40d4fab87db14b1ba520c5d4
    MASFile=ledtestgmts.mas d382e3add68043e3b6814521f49c184a770eec90b75ac3c79814bc627282dc7f

    and the update one :
    Flags=32769
    RefCount=1
    Signature=362e65d3bb3a48b08454f391079931719732918f40d4fab87db14b1ba520c5d4
    BaseSignature=8022249d5a10b9703f438f7a7078e253f4658762e0cdc7206cbb77fcffd0b865
    MASFile=ledtestgmts.mas d382e3add68043e3b6814521f49c184a770eec90b75ac3c79814bc627282dc7f

    In modmgr, it allows to install the 0.01 and update it with the 0.02.

    I think here we just miss the syntax to do the same with modmgr.

    benefits is to only create a small update instead of downloading each time a new version of 1GB.

    doesn't rally matter because we can always create a new version, just thought the right way to such things is like s397 do it for example brands hatch were there is a huge base component track then a small update.

    don't think I will continue searching evenings for a badly documented tool.
     
    Deleted member 58016 likes this.
  20. I already got your intention I think :)

    If we refer to e.g. skins of cars it is a real good proposal to just pack the skins as an update to the cars mas files itself in order to save some download bandwidth or just to keep the update rather small.


    Sad but true. I think it is not documented clearly enough, missing examples and the overall documentation seems to be somewhat outdated ...

    Just an impression, but I have the feeling I am right.

    I am not sure about the mft file and if we can create it on our in advance (I don't think so). We could - I would say - if we know how to create signatures (not sure if there is an option to modmgr for it).

    Just a simple approach: do we need to say it is an update? E.g. if we keep the name and we are just increasing version won't it be stored in the same directory? (while writing this it comes to mind that base versions are not kept if there is a newer one ... compare it to car upgrades)

    I was working on a rF2 Server Manager (powershell based) and it is hard to implement a certain logic, especially how to handle content and how to set up e.g. mod files (pkginfo.dat ones) for creating mods.

    So I stopped ...
     
    gagipro likes this.

Share This Page