Page 1 of 1

Upgrade Process?

PostPosted: 29 Mar 2014, 21:36
by Lodici
Can we clarify what are the steps for upgrading an older version of Magarena to a newer version. If it is a case of installing a new version to a new folder and importing the images from the older version then we will also need to think about copying across user generated data such as custom decks, player profiles, stats, etc. The simplest way is to overwrite the existing installation but then you might end up with duplicate/similar script files with different names (see viewtopic.php?f=82&t=3735&p=149388#p149388), etc.

Re: Upgrade Process?

PostPosted: 29 Mar 2014, 23:32
by ShawnieBoy
I've always had to install a new version, using the image import, then go over and find all my decks to copy over.

If I was to extract the zip into my existing folder, 'things' would go wrong. Not been able to pick out exactly what it is, but I normally end up with errors.

Having an import for decks and now the player profiles would be really handy. Better still, a simpler way of updating.

Re: Upgrade Process?

PostPosted: 29 Mar 2014, 23:48
by frank
one word on importing images (and the corresponding descriptions):

I had for quite some time foreign descriptions to english texted card images - some 20-30, take or give. I was about to report them when I installed magarena on a different computer. There I did a fresh image download and no more foreign description. Pure chance.

Don't know how long I was carrying them over and over again, but a fresh image download from time to time should be advised...

Re: Upgrade Process?

PostPosted: 30 Mar 2014, 01:45
by Huggybaby
If Magarena uses MTGImage for pics now, then you could have lots of pics left from previous sources too. I'm just guessing, but it is something to look at.

Re: Upgrade Process?

PostPosted: 30 Mar 2014, 05:27
by hong yie
another thing to be considered is:
sometime there're custom files such as token creature picture that a user wants to keep. i have one of these custom token that i really like, away from the default one. so far i handle this manually. :)

Re: Upgrade Process?

PostPosted: 30 Mar 2014, 07:11
by Lodici
Thanks for the feedback. Being lazy, my preference is to upgrade Magarena by extracting the new zip into the existing directory. From an end user point of view I think this is the simplest and most intuitive approach while we use the zip file method of distribution. With a few small tweaks to the CI build process and startup code we should also be able to keep development effort to a minimum as well since we will not have to consider migrating user data. Here is what I suggest...

During the CI build process and just prior to packaging everything into the zip file, any data directories that need to be upgraded should be renamed by appending a ".new" postfix. This rename will prevent overwriting the existing directory when the zip file is initially extracted.

When Magarena next starts it checks for the ".new" postfix and if found triggers the upgrade code for the specific directory. For example, if the "scripts" directory is renamed to "scripts.new" then when Magarena next starts it will simply delete the existing "scripts" directory and rename "scripts.new" to "scripts". This way we can be sure that the scripts directory matches exactly with the latest release.

We can use the same convention with any other data directories which may require some sort of upgrade process.

Re: Upgrade Process?

PostPosted: 02 Apr 2014, 04:08
by hong yie
Lodici wrote:Thanks for the feedback. Being lazy, my preference is to upgrade Magarena by extracting the new zip into the existing directory. From an end user point of view I think this is the simplest and most intuitive approach while we use the zip file method of distribution. With a few small tweaks to the CI build process and startup code we should also be able to keep development effort to a minimum as well since we will not have to consider migrating user data. Here is what I suggest...

During the CI build process and just prior to packaging everything into the zip file, any data directories that need to be upgraded should be renamed by appending a ".new" postfix. This rename will prevent overwriting the existing directory when the zip file is initially extracted.

When Magarena next starts it checks for the ".new" postfix and if found triggers the upgrade code for the specific directory. For example, if the "scripts" directory is renamed to "scripts.new" then when Magarena next starts it will simply delete the existing "scripts" directory and rename "scripts.new" to "scripts". This way we can be sure that the scripts directory matches exactly with the latest release.

We can use the same convention with any other data directories which may require some sort of upgrade process.
i like this solution. but... as i remember, Magarena always extracted to a new folder followed by version number. it doesn't integrate with the old folder. That's why i still keep my magarena folder from last year. i just drag all of the files from the zip and overwrite them to my old Magarena folder. is it better to move all necessary old file to a new folder instead? :)

Re: Upgrade Process?

PostPosted: 04 Apr 2014, 11:35
by Lodici
hong yie wrote:i like this solution. but... as i remember, Magarena always extracted to a new folder followed by version number. it doesn't integrate with the old folder.
You are right in that it seems to be structured in such a way as to discourage you from overwriting the existing folder. I use Windows 7 and 7-zip. To unzip files I usually right click the file and select the "Uncompress here..." option. With the Magarena zip file this extracts the contents to a new folder, "Magarena-1.x". To overwrite the existing folder, I have to actually open the zip file, open the "Magarena-1.x" folder inside the zip, select the contents and drag into the existing installation - a right pain. :(

So now I will go with the flow and extract to a new folder each time (which means I have to update the shortcut each time as well! :( ) but it does mean that we will have to consider more than just importing existing images, especially now that player profiles have been implemented.

Here is what I would do to manually upgrade to version 1.49 -
  • download Magarena-1.49.zip
  • extract zip contents, which should create a new Magarena-1.49 folder.
  • copy ..\Magarena-1.48\Magarena\players to ..\Magarena-1.49\Magarena\players.
  • copy ..\Magarena-1.48\Magarena\duels to ..\Magarena-1.49\Magarena\duels.
  • copy any other stuff you might have added yourself.
  • create a new shortcut to ..\Magarena-1.49\Magarena.exe.
  • run Magarena-1.49 and import the images from ..\Magarena-1.48\Magarena.
  • delete the Magarena-1.48 folder.
Personally, I think this might deter your casual games player from upgrading or even using Magarena which I think is a shame but finding a way to do it automatically is easier said than done. For the next release, I will probably look at adding the the "players" and "duels" directories to the import images process at the very least.

hong yie wrote:is it better to move all necessary old file to a new folder instead? :)
If you mean overwriting a new installation then I would not recommend doing that. The script and groovy files are constantly being updated so you could easily overwrite a newer version with an older version.

Re: Upgrade Process?

PostPosted: 08 Apr 2014, 08:20
by melvin
I did some research on auto upgrade for Java apps previously and one of the projects I found to be promising for use in Magarena is https://github.com/UrsKR/updates-r-simple

https://code.google.com/p/magarena/issues/detail?id=39 is about adding auto upgrade.