AMP icon indicating copy to clipboard operation
AMP copied to clipboard

Create ExtractArchive Update Stage

Open IceOfWraith opened this issue 2 years ago • 10 comments

Feature Request

Feature Information:

As we discussed in Discord, Portal Knights requires a zip file to be extracted in place that is already included with the SteamCMD download of the game. There's no need to extract it to anywhere else, but it may be useful for other games/apps if we can specify the output directory. (Not required for this game)

I confirm:

  • [x] that I have searched for an existing feature request matching the description.

IceOfWraith avatar May 07 '22 23:05 IceOfWraith

Added, specify UpdateSourceArgs for the archive to extract and optionally UpdateSourceTarget to extract it somewhere else.

PhonicUK avatar May 09 '22 11:05 PhonicUK

Awesome. Thank you! Ill try it today.

IceOfWraith avatar May 09 '22 13:05 IceOfWraith

It doesn't seem to be working unless I'm missing some syntax. Here's the log output from the config below:

[23:02:57] [System:admin Info]    : Extracting '' to E:\AMPDatastore\Instances\PortalKnights07\portal-knights\374040\

{"UpdateStageName":"Extract Server Files","UpdateSourcePlatform":31,"UpdateSource":32768,"UpdateSourceData":null,"UpdateSourceArgs":"dedicated_server.zip","UpdateSourceVersion":null,"UpdateSourceTarget":"{{$FullBaseDir}}","UnzipUpdateSource":false,"OverwriteExistingFiles":false,"ForceDownloadPlatform":0,"UpdateSourceConditionSetting":null,"UpdateSourceConditionValue":null,"DeleteAfterExtract":false}

When I put {{$FullBaseDir}} in front of the dedicated_server.zip it shows it's extracting the base directory location, but still excludes the text I typed after.

[22:58:44] [System:admin Info]    : Extracting 'E:\AMPDatastore\Instances\PortalKnights07\portal-knights\374040' to E:\AMPDatastore\Instances\PortalKnights07\portal-knights\374040\

{"UpdateStageName":"Extract Server Files","UpdateSourcePlatform":31,"UpdateSource":32768,"UpdateSourceData":null,"UpdateSourceArgs":"{{$FullBaseDir}}dedicated_server.zip","UpdateSourceVersion":null,"UpdateSourceTarget":"{{$FullBaseDir}}","UnzipUpdateSource":false,"OverwriteExistingFiles":false,"ForceDownloadPlatform":0,"UpdateSourceConditionSetting":null,"UpdateSourceConditionValue":null,"DeleteAfterExtract":false}

IceOfWraith avatar May 15 '22 04:05 IceOfWraith

Should be fixed in CI. So for the ExtractArchive stage, UpdateSourceArgs is the archive to extract, and UpdateSourceTarget is the directory to extract into. It'll log now what it thinks these are to aid debugging.

PhonicUK avatar Jun 06 '22 13:06 PhonicUK

Did the build fail again?

Running update stage Server Files Extract (None)

IceOfWraith avatar Jun 10 '22 00:06 IceOfWraith

Here's what the latest update gives. You can see I put {{$FullBaseDir}} in both yet it only shows the file name rather than directory + file name.

[21:48:10] [Generic:admin Debug]  : Running update stage Server Extract (ExtractArchive) [21:48:10] [Generic:admin Info]   : Extracting dedicated_server.zip to C:\AMPDatastore\Instances\PortalKnights01\portal-knights\374040\...

{"UpdateStageName":"Server Extract","UpdateSourcePlatform":31,"UpdateSource":32768,"UpdateSourceData":null,"UpdateSourceArgs":"{{$FullBaseDir}}dedicated_server.zip","UpdateSourceVersion":null,"UpdateSourceTarget":"{{$FullBaseDir}}","UnzipUpdateSource":false,"OverwriteExistingFiles":false,"ForceDownloadPlatform":0,"UpdateSourceConditionSetting":null,"UpdateSourceConditionValue":null,"DeleteAfterExtract":false}

IceOfWraith avatar Jun 17 '22 04:06 IceOfWraith

Noting this for when you get back. It looks like no matter what I put it tries to extract from the same location. It goes for the right file name, but I've put {{$FullRootDir}}dedicated_server.zip, {{$FullBaseDir}}dedicated_server.zip and 374040/dedicated_server.zip but get this output every time. [18:26:30] [System:admin Info]    : Extracting C:\AMPDatastore\Instances\PortalKnights01\dedicated_server.zip to C:\AMPDatastore\Instances\PortalKnights01\portal-knights\...

IceOfWraith avatar Jun 23 '22 01:06 IceOfWraith

Yeah, it assumes that the zip is in the instance dir, and doesn't accept any other path

Greelan avatar Jul 14 '22 12:07 Greelan

Fixed in 2.4

PhonicUK avatar Sep 07 '22 12:09 PhonicUK

Still seems to be an issue in 2.4.0.6 Nightly, although the logging has been slimmed down so I don't see as much as before. Here's what I have in the log:

[23:44:34] [Generic:IceOfWraith Debug] : Running update stage Server Extract (ExtractArchive)
[23:44:34] [System:IceOfWraith Error] : Error performing update stage Server Extract
[23:44:34] [Generic:IceOfWraith Error] : NullReferenceException
[23:44:34] [Generic:IceOfWraith Error] : [0] (NullReferenceException) : Object reference not set to an instance of an object.
[23:44:34] [Generic:IceOfWraith Error] :    at GenericModule.GenericApp.<ExtractArchive>()
   at GenericModule.GenericApp.<PerformUpdateStage>()
   at GenericModule.GenericApp.<>c__DisplayClass87_0.<<Update>b__0>d.MoveNext()

And what I'm trying to run: {"UpdateStageName": "Server Extract","UpdateSourcePlatform": "All", "UpdateSource": "ExtractArchive", "UpdateSourceArgs": "{{$FullBaseDir}}dedicated_server.zip", "UpdateSourceTarget": "{{$FullBaseDir}}"}

IceOfWraith avatar Sep 15 '22 23:09 IceOfWraith