Tip/Trick: Recovering 'lost' assets created before running as admin

shaneturner12

Tutorial Creator
This advice applies to Windows Vista and 7 (and later versions) users. Be aware that this does not apply to users who have disabled User Account Control.

If you are trying to get the game to run as administrator (to fix not being able to save issues) see http://trainz.shaneturner.co.uk/tutorials/index.php?page=running-as-administrator.

The scenario

Imagine that you installed Trainz as normal, and downloaded some assets for it and/or created a route, but you forgot or didn't know that Trainz has to be run as administrator in Windows Vista or 7. You then re-load the game to find that the assets you downloaded or created have disappeared. Even after turning on the option to run as administrator, you still find that things you created whilst it was not running as administrator are not there.

The Symptoms

Content Manager reports that the content installed sucssfully and/or Surveyor reports that the route you created was saved sucessfully, but when you re-launch the game, you find that the content is not there.

The Solution
Once you have turned on the option to run as administrator (see my tutorial site for the info on this), do not do any further work on routes that you created whilst the game was not running as admin.

Instead, press Windows and Run.

Enter the following command:
%userprofile%\AppData\Local\VirtualStore

Then press Enter or click OK.

Inside this folder is effectively a mirror image of your hard drive, but it only contains files and folders created by non-admin processes.

Browse for your Trainz install folder in here - this time though, it's the full Trainz install path minus the drive letter.

Once you have found this:

Users of TRS2004 and earlier:

Double-click the World folder and copy the Custom and Dispatcher folders to the desktop.

Users of TS2009 SP3 and earlier (down to TRS2006):

Right-click the Local folder, and click Copy to Folder... - select the Desktop as the destination.

Users of TS2009 SP4, TS2010 and TS12:

Double-click the UserData folder, then follow the instruction given for TS2009 SP3 and earlier. If it's Download Station assets that are involved, you may want to do the same with the Original folder as well.

Once this is done

For TS2004 and earlier users, copy the World and Dispatcher folders to the matching places in the 'real' Trainz folder, then delete World_Cache_Dispatcher.chump (which is in either the Settings or Cache folders)

For TRS2006 and later users, open Content Manager, and click the Import Content feature in the File menu. When prompted, select the copied folder(s). (Note: If there is more than one folder involved, install the ones from Original first, followed by Local). If asked whether you want to overwrite files, only click Overwrite if you know you haven't made any edits since turning on the run as administrator option.

Hopefully this makes sense. If not, leave a comment and I will explain any parts that are confusing.

Shane





 
Now that is strange! I run Windows 7 and TRS2009 SP2/3/4, none of which are Admin controlled. Don't ask why all these versions, it's just me. I even have a Trainz set-up just for the Darjeeling route, again no Admin. No assets to date have gone missing unless I remove them. Perhaps, it may be that I'm not using the original installations, rather complete copies that don't need Admin to run them. Having Terrabyte drives helps as well with space.
 
stationmistress;bt365 said:
Now that is strange! I run Windows 7 and TRS2009 SP2/3/4, none of which are Admin controlled. Don't ask why all these versions, it's just me. I even have a Trainz set-up just for the Darjeeling route, again no Admin. No assets to date have gone missing unless I remove them. Perhaps, it may be that I'm not using the original installations, rather complete copies that don't need Admin to run them. Having Terrabyte drives helps as well with space.

The run-Trainz-as-an-administrator stuff is primarily important when Trainz is installed in the Program Files folder, which has security restrictions where programs can not write to it without having administrator privileges. If you have Trainz installed in a different, non-protected location (such as in a subfolder of the root folder of your hard drive), then Trainz does not need administrator privileges to write to its installation folder, and thus it is unlikely that you will have these problems.

This is another nice post, Shane. Thanks for posting it. :)

It is possible to remove the security restrictions from a folder in the Program Files folder. I have done this to my Auran folder (affecting all my Trainz installations), though I still run Trainz as an administrator, even though it thus may no longer be as important to do so. If you want, Shane, then I could post instructions on how to remove the security restrictions from a folder in the Program Files folder.

Regards,

Zachary.
 
stationmistress - some versions of Windows 7 do not require the run as admin (usually versions higher than Home Premium). It may be that you have Ultimate or similar installed.

Retro00064: Coincidentally, I've had the issue detailed above if it's installed anywhere but within C:/Users/<username>. It is worth posting the instructions on how to remove the security restrictions, but do make a note that this will lower the security of the folder.

Thankyou to both of you for your comments.

Shane
 
shaneturner12;bt369 said:
<snip>

Retro00064: Coincidentally, I've had the issue detailed above if it's installed anywhere but within C:/Users/<username>. It is worth posting the instructions on how to remove the security restrictions, but do make a note that this will lower the security of the folder.

Thankyou to both of you for your comments.

Shane

Interesting. Folders in the root C: drive have acted like unprotected folders for me. I checked the permissions for folders in my root C: drive, and the "Users" group has no write permissions, just like with folders in the Program Files folder. However, there is an "Authenticated Users" group listed, (which was not listed in the security settings for folders in the Program Files folder) which has write access. My user account is an administrator account, so perhaps administrator accounts are included in the "Authenticated Users" group.

Regards,

Zachary.
 
I concur with Stationmistress. I find all this talk about Admin privileges puzzling. My TS12 is installed in the C:\Program Files (x86)\N3V Games folder on a Win7 Home Premium SP1 computer and I have yet to come across any problems with respect to privileges. No missing assets or anything. Incidentally, "Editing" & "Writing" of folder "UserData" is allowed for everybody/all. Don't know how that happened, though. New improved installer?

-Nickie
 
I'm suprised with that. Normally, with Windows 7 Home Premium, programs have to be run as administrator.

Perhaps you've read Retro's Right of Way blog.

Shane
 
shaneturner12;bt822 said:
I'm suprised with that. Normally, with Windows 7 Home Premium, programs have to be run as administrator.

Perhaps you've read Retro's Right of Way blog.

Shane
No, I didn't read that blog. But, now that I think of it, I did once have the problem, that I had to run text editors as administrator to edit .txt files in C:\Program Files (x86) and subfolders, and now I don't. :confused: If only I could remember what I did - if I did anything at all :eek:

Cheers, Nickie
 
I just figured out why I can edit .txt files from C:\Program Files (x86) and subfolders. It's because I double click them - and thus start the editor - from within xplorer², which in turn does run with admin privileges. ;) But, of course, that doesn't explain how TS12/UserData got its extended permissions. I still tend to attribute this to the installer. Unless it's because I copied its content folders - and possibly assets.tdx - over from my Steam installation to the N3V installation. The Steam installation did have extended permissions. But, I didn't think a parent folder could inherit its child folders' permissions :confused:

-Nickie
 
Retro00064;bt368 said:
If you have Trainz installed in a different, non-protected location (such as in a subfolder of the root folder of your hard drive), then Trainz does not need administrator privileges to write to its installation folder, and thus it is unlikely that you will have these problems.


If Trainz is installed in a different location then the installation folder will not be listed in %userprofile%\AppData\Local and there will be no cached data to copy out.

So I guess it's fortunate that installing to a different location is unlikely to lead to the original problem:)
 
Last edited:
Back
Top