emanzione / PATCH

The PATCH repository for issues tracking, wiki and shared material.
https://assetstore.unity.com/packages/tools/utilities/p-a-t-c-h-ultimate-patching-system-41417
MIT License
47 stars 7 forks source link

Launcher Update failure after updating the asset #26

Closed MiTschMR closed 4 years ago

MiTschMR commented 4 years ago

Hello

After updating the asset (INDIE version) to the current version 2.3, a launcher on backend Mono made with version 2.2 of the asset can not update to a launcher made on same backend with version 2.3. Logs:

2020-07-29 21:28:53.132 +02:00 [INF] Update context initializing...
2020-07-29 21:28:53.132 +02:00 [INF] Update context points to https://mitschmr-studios.io/games/defnite/
2020-07-29 21:28:53.189 +02:00 [INF] Retrieved current version: 0.2.3
2020-07-29 21:28:53.196 +02:00 [INF] Workspace cleaned. Removed 0 files
2020-07-29 21:28:53.380 +02:00 [INF] Collected 323 local files.
2020-07-29 21:28:53.462 +02:00 [WRN] Cannot retrieve the build definition for 0.2.3
2020-07-29 21:28:53.463 +02:00 [INF] Found 0 applicable updates.
2020-07-29 21:28:53.463 +02:00 [INF] Update context completed initialization.
2020-07-29 21:28:53.464 +02:00 [INF] Launcher update started. The update contains 161 operations.
2020-07-29 21:28:53.472 +02:00 [ERR] ===> [Launcher updating] process FAILED! <===

If I have a launcher made with 2.3, change a few things and deploy a new version with 2.3, it updates without problems.

emanzione commented 4 years ago

Ok, so it is a bug relative to the old 2.2. I need more information. The Unity Player logs would be useful.

MiTschMR commented 4 years ago

Here are the logs, there is nothing more related to an error:

3896>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.EnsureDefinition (MHLab.Patch.Core.UpdaterDefinitionEntry entry) [0x0002e] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.HandleAddedFile (MHLab.Patch.Core.UpdaterDefinitionEntry entry) [0x00097] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.Update () [0x000c5] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.Runners.UpdateRunner.Update () [0x00016] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.UpdatingContext.Update () [0x00006] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Launcher.Scripts.LauncherBase.CheckForUpdates () [0x00006] in <34b2e671d2ef4609866c67b5d4f49d21>:0  

When I then try to start the game (launcher won't start because of version mismatch etc due to failed update), these logs appear:

System.IO.FileNotFoundException: Could not find file "C:\<Path>\Launcher\Defnite.Launcher_Data/resources.resource"
File name: 'C:\<Path>\Launcher\Defnite.Launcher_Data/resources.resource'
  at System.IO.File.SetAttributes (System.String path, System.IO.FileAttributes fileAttributes) [0x00018] in <fb001e01371b4adca20013e0ac763896>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.EnsureDefinition (MHLab.Patch.Core.UpdaterDefinitionEntry entry) [0x0002e] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.HandleAddedFile (MHLab.Patch.Core.UpdaterDefinitionEntry entry) [0x00097] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.PatcherUpdater.Update () [0x000c5] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.Runners.UpdateRunner.Update () [0x00016] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Core.Client.UpdatingContext.Update () [0x00006] in <079ac49fd7f64611b1d5138055d1c37d>:0 
  at MHLab.Patch.Launcher.Scripts.LauncherBase.CheckForUpdates () [0x00006] in <34b2e671d2ef4609866c67b5d4f49d21>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

The file resources.resource seems to be new (additional) in the newer version of my updater. Maybe it fails because this file is new?

emanzione commented 4 years ago

It seems like an old bug that existed in the 2.2.x version. It has been fixed in 2.3.0 release.

MiTschMR commented 4 years ago

Okay, I get that. But I still can’t update the launcher (that was made with 2.2) to a launcher made with 2.3. Is the only way to update the old launcher to distribute the new launcher as zip-file and replace the old files instead of updating through the launcher?

emanzione commented 4 years ago

Let's try this:

  1. open your updater_index.json
  2. locate the file (resources.resource in this case)
  3. you should see the Operation key set to 4
  4. set it to 2 instead
  5. upload your modified updater_index.json
  6. try to run the updating process

Repeat the steps for every file that could give you issues.

If this does not work, yeah: you need to zip files and replace the old one, I am sorry for the inconvenience.

MiTschMR commented 4 years ago

That’s an interesting approach, will definitely try this. What is the difference of these Operations numbers, what does each one do?

emanzione commented 4 years ago

They regulate the operation type needed for that specific file: the Launcher takes a different code path based on the operation. 0 = Unchanged, 1 = Deleted, 2 = Updated, 3 = ChangedAttributes, 4 = Added

MiTschMR commented 4 years ago

Well, it was worth a try. Didn't work out though, so I have the users to replace the files manually or download the new launcher. I close the issue. Thank you for the assistance.

emanzione commented 4 years ago

I'm sorry for the inconvenience! I hope this will not happen again!