It is currently 25 Apr 2024, 23:05
   
Text Size

Upgrade Process?

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Upgrade Process?

Postby Lodici » 29 Mar 2014, 21:36

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.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Upgrade Process?

Postby ShawnieBoy » 29 Mar 2014, 23:32

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.
User avatar
ShawnieBoy
Programmer
 
Posts: 601
Joined: 02 Apr 2012, 22:42
Location: UK
Has thanked: 80 times
Been thanked: 50 times

Re: Upgrade Process?

Postby frank » 29 Mar 2014, 23:48

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...
frank
 
Posts: 46
Joined: 24 Mar 2014, 00:59
Has thanked: 8 times
Been thanked: 2 times

Re: Upgrade Process?

Postby Huggybaby » 30 Mar 2014, 01:45

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.
User avatar
Huggybaby
Administrator
 
Posts: 3207
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 701 times
Been thanked: 594 times

Re: Upgrade Process?

Postby hong yie » 30 Mar 2014, 05:27

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. :)
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Upgrade Process?

Postby Lodici » 30 Mar 2014, 07:11

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.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Upgrade Process?

Postby hong yie » 02 Apr 2014, 04:08

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? :)
User avatar
hong yie
Programmer
 
Posts: 216
Joined: 10 Mar 2013, 06:44
Location: Jakarta
Has thanked: 75 times
Been thanked: 9 times

Re: Upgrade Process?

Postby Lodici » 04 Apr 2014, 11:35

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.
User avatar
Lodici
Programmer
 
Posts: 399
Joined: 13 Oct 2013, 09:44
Has thanked: 29 times
Been thanked: 71 times

Re: Upgrade Process?

Postby melvin » 08 Apr 2014, 08:20

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.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 41 guests


Who is online

In total there are 41 users online :: 0 registered, 0 hidden and 41 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 41 guests

Login Form