Jump to content

Dual 0ad installation on Windows


guerringuerrin
 Share

Recommended Posts

Those who play on Windows cannot have two versions of the game installed, as the installation program detects old installations and does not allow installing without removing the previous one. Now that the new version is close and we need to test it, I thought it would be a good idea to share this with you.
To avoid this, all you need to do is change the name of the folder where the game is installed before installing the desired new version.

Here's a step by step guide:

1) locate and rename your current 0ad folder. In my case, it is installed in a custom path. The default path is probably something like C:\Program Files\0ad alpha<version>\

from this:
image.png.77fc397fd394da9103495d63fe3d8552.png

to this:

image.png.58412c795bdf5e54a6d22f6ac0ec2ef1.png

 

2) Run the new 0ad installation file. It will ask you to remove the older version. You just click Ok/Accept
image.png.8be7ff86f1379e3aa183a9bfff37a5f3.png

 

3) The installation wizard will attempt to install the new version at the previous folder. You might want to change this to the new version number.

image.png.3eed9504ec287f7ba7173875e8a633b1.png

 

4) When the installation is complete, you can rename the old folder back to its original name.

from this:
image.png.bbd14e741f4f4fce29566404074eb78e.png

to this:
image.png.b56e8cda4003cce08460946fcc92af40.png

 

5) You will now have the shortcut to the new version you installed in your start menu by default. If you want, you can create a shortcut of the old version to the location you want to access it more quickly.
Assuming you named the old folder "0 A.D. alpha 26", the executable will be located in the following path:
\0 A.D. alpha 26\binaries\system\

image.png.1b6e2138f9c56625dc8aca01692f9716.png

example of my two desktop's shortcuts

image.png.08f3736790a951a2cc5721fe3d1bf96a.png

 

 

Now when we start a27 it will probably send us to the Mods section and ask us to disable the mods that are not compatible. By just disabling them, we can play our new version without any problems.

image.thumb.png.f76de26bd77cd94f7b6b2da98ece75ee.png

 

 

5) Additional step (not necessary)

@Norse_Harold Shared with me this trick to avoid having to enable and disable mods every time we start a different version.
This step is not necessary, but it makes things a little easier and requires some kind of knowledge to not mess things up. If you don't feel comfortable with this, just don't do it. You'll just have to enable and disable your mods whenever you want to open another version. But it does make things easier if you're switching between versions repeatedly.

0ad saves all our custom settings in the following paths:
C:\Users\<YOUR USERNAME>\Documents\My Games\0ad
C:\Users\<YOUR USERNAME>\AppData\Roaming\0ad
C:\Users\<YOUR USERNAME>\AppData\Local\0ad


So what we can do is rename the 0ad folders according to the version of 0ad that we have previously installed, and then create new empty folders that we will name according to the new version that we install. In the example the previous version we had was 26 and the new one was 27 so we will rename the original folder to "0ad26" and create a new empty folder called "0ad27"
Here is the screenshot of the first path, but you need to do the same for the other two paths (Roaming and Local):


image.png.4269896ec45aa7fb463de5d8f61fb77d.png

As you can see, I have two folders called 0ad26 and 0ad27, each corresponding to its version. And additionally, I have a symlink called "0ad" created by the batch files I'm sharing. Note that you cannot make a symlink from the Windows Explorer as shortcuts. You have to do it from the command line. Therefore, it is very convenient to use a batch file that reproduces the commands so you avoid having to rewrite them every time you want to perform this operation.

This symlinks takes you to one of the two folders, depending on which version of 0ad we want to open.

You may need to edit the batch files and change some paths defined in the variables of both files, depending on your Windows configuration. These files need administrator permissions to work properly. So you will need to right-click run as administrator

Again, this last step is not necessary and you can avoid it.

Batch26.bat Batch27.bat

image.png

Edited by guerringuerrin
  • Like 4
  • Thanks 2
Link to comment
Share on other sites

Thanks much for writing this up as a step-by-step guide with screenshots and downloads. I consider it quite important to be able to use both versions of the game when a new version is being seriously tested.

The "shortcut" created by the batch script is actually a symbolic link (also known as symlink). This is necessary because a simple shortcut would not tell the game to look at the destination folder for storing its files.

Note that the batch files make symlinks for all three folders, not just the config folder. You might want to add instructions and screenshots in the guide for users to, before running any batch scripts, rename 0ad to 0ad26 in each of the 0ad user data folders. This will preserve their data for the current version of 0ad. If they don't do this then the batch script won't work correctly, since the RD commands (abbreviations of RMDIR) won't work unless the directories are symlinks or empty.

Sometimes there are problems caused by copying the user data files from one version of 0ad to a newer version. An example is a black or very distorted user interface. Another example is old configuration entries causing the game to malfunction in a very significant way, such as no audio or a strange screen resolution. In that case, I advise starting with empty user data folders for alpha 27 and configuring 0ad from scratch through the game interface.

It might be necessary to right-click on a batch script and click "Run as administrator" in order for symlink creation to work correctly. Anyone who wants to use these scripts should read and understand what they do before running them. It's all plaintext, and each command has documentation here. If anyone wants me to explain how the scripts work line-by-line then talk to me via Element.

guerringuerrin, would you mind crediting me in the guide for sharing the ideas of installing to a separate folder and using batch scripts that make symlinks in order to give each version of the game separate config folders? I think that I told you about this before alpha 26 was released and sent example batch scripts. Either that, or I shared them with someone else and they shared them with you. I see that the scripts were modified in good ways to make them more organized.

Again, thanks for writing this up and sharing the information and scripts. This is quite helpful for the user base.

Edited by Norse_Harold
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Sure, @Norse_Harold, sorry for that!. It's true that you shared with me this idea.

1 hour ago, Norse_Harold said:

I think that I told you about this before alpha 26 was released and sent example batch scripts. Either that, or I shared them with someone else and they shared them with you. I see that the scripts were modified in good ways to make them more organized.

Those batch files were made by myself =)

Thanks

  • Like 1
Link to comment
Share on other sites

13 hours ago, guerringuerrin said:

Sure, @Norse_Harold, sorry for that!. It's true that you shared with me this idea.

Thanks for editing the guide with the improvements and credit for the idea. I should have talked to you about it privately instead of making it seem like you did something wrong. You didn't do anything wrong, and my asking for credit is kind of petty. I was responding hastily since it was just before I was going to sleep. And, my impulse to ask for credit might be the influence of corporate culture. Sorry.

13 hours ago, guerringuerrin said:

Those batch files were made by myself =)

Okay, my bad. Good job on that.

Edited by Norse_Harold
Link to comment
Share on other sites

1 hour ago, Stan` said:

Any reason not to use the -writableRoot param ?

I prefer to avoid using that feature. I don't want the game's executable files and vanilla content to be writable in case there is a flaw in the game that causes any of those files to be incorrectly overwritten.

Also, my personal security policy says that I should not allow a non-administrator user account to have simultaneous write and execute permissions on any files. This is inspired by the NX-bit security feature on CPUs that prevents executable memory from being written.

Another reason to avoid using -writeableRoot, in my opinion, is to test the most common code path that others are using. This makes it quicker to reproduce symptoms that others may observe.

As a result, I keep the game installed in C:\Program Files (x86), or the equivalent path on Linux, and I run the game as a non-administrative user.

 

Edited by Norse_Harold
Link to comment
Share on other sites

I see, thanks for the explanation.

8 hours ago, Norse_Harold said:

in case there is a flaw in the game that causes any of those files to be incorrectly overwritten.

On Windows this is less likely to happen since the game keeps an exclusive access to the files it uses. E.g. you would not be able to override the public mod while the game is running. If bad things like this does happen though it might be nice to have an issue tracking that.

8 hours ago, Norse_Harold said:

C:\Program Files (x86), o

The reason we do not install it there but rather in %LocalAppData% which resolves to C:\Users\yourname\AppData\Local is not all users have admin rights and are able to put it in program files.

Also I imagine the game might have some issues with the space in the folder name

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...