The online racing simulator
Installer test with new install folder logic
Due to LFS uninstaller problems I had to make adjustments to the LFS installer.

The installer now has new installation folder logic. That means that the installer will do additional checks during setup to make sure that LFS is installed into a safe location.

The logic is as follows :

When you select an install location, it will check and see if LFS is installed at that location. A confirmation box will appear asking you if you are sure you want to overwrite that LFS install. If so, the installer continues. If not, you can select another folder.

If the install location does not contain an LFS install then :

If the install location does not exist, accept it and continue.
If the install location does exist but is empty, accept it and continue.
Otherwise append "LFS" to the install location, but check if that folder does not already exist. Keep trying until we find a non existent folder name (appending sequential numbers, LFS, LFS2, LFS3, etc).

I have attached a dummy installer that you can test with if you want. It _does_ install some files, but only a few simply to keep the filesize down.
It's no biggie if you overwrite an existing folder with this, but I guess you don't really have to for the test. You can safely install into a new folder and later uninstall it. Your current, real LFS install won't be affected.
The main test here is to make sure LFS is always installed to a safe folder and cannot be installed directly into a folder like Program Files or Windows.

Additionally the uninstaller that this test installer copies, also has a folder removal safety that checks for folders like Program Files and Windows and will refuse to remove those if LFS is installed directly into them (and not into a subfolder).

EDIT - uploaded new test installer with the following changes :
-includes the files that the installer uses to determine if a folder contains an LFS install
-checks if any of the parent folders of the selected install location contains an LFS install. It will warn about nesting and ask for your confirmation if so.
Attached files
LFS_S2_6B_setup.zip - 1.5 MB - 572 views
- Installing to Program Files (x86), installed to ~\LFS. Uninstalled correctly.
- Installing to Program Files (x86)\LFS, installed correctly. Uninstalled correctly.
- Installing to Program Files (x86) twice, installed to ~\LFS and ~\LFS2. Both uninstalled correctly.

However, there is one annoying issue with this. Installing to any protected folder requires admin rights, and installation fails by default. Similarly uninstalling from a protected folder fails, but it fails silently: Success is reported, menu items are removed, but folders and files remain without notification. I don't ever have to manually select run as admin when un/installing other software to Program Files, so this to me is not expected behaviour.

Solution: Please make the un/installer automatically ask for elevated rights.
as a test tried a few things for the installation part of things

-Attempted to install directly to C:\ - Does not allow to continue. Good

-Attempted to install to C:\Program files & C:\Program Files (x86), Creates new folder called LFS for install, Good

-Attempted to install to other hard drive route folders (EG: D:\, E:\ F:\ G:\ etc) and all would not allow to continue without an additional directory being selected, Good (if i chose a directory of my own name for any HDD that does not contain LFS Items it installs correctly to that selected folder.

-Attempted to install in to one of the test installs and did not prompt for overwrite, simply created LFS folder inside, (and then LFS2 when i tried again).

-Copied entire contents of my real install to the test install and attempted to install to test install again, Was prompted for overwrite.

-Attempted install on real install, Was prompted for overwrite

Seems to work as it should for the most part, Although it seems the test install is missing whatever files it checks for, Before i copied my entire directory i did try just copying some of the Data Folder (skins, setups, anything user created) and cfg.txt, card_cfg.txt, deb.log, installLFS.info, Interface_cfg files and they did not get the prompt. Strangely though after i copied everything over it prompted, So i tested, and if you have all following folders present(did not check content of, just removed folders but i assume it is the content inside that prompts action):

wld
move
hmn

Then the installer will prompt for overwrite, But if you do not have any single 1 of the above 3 files, the installer does not promt and will install in a new directory (/LFS2, 3 , 4 etc) The other folders in the Data directory are irrelevent to the installer.

Now the problem i can see with this is that if you are missing one of the 3 files above, You may well be trying to correct a problem with your own LFS (because for instance one of the above files is missing), But if it is missing then you are not repairing your own LFS Install with an overwrite but instead making a new one (which you then have to copy eveything over again and would now be in a sub directory).

so in summary it all seems to hinge on the files in the 3 folders above, i think the biggest problem is that it only takes one of the 3 to be missing for it to not prompt and instead create a new install folder

Otherwise it seems to work well and the idiot proofing works like a charm.

All tests conducted on multiple HDD's and directories on Windows 7 Ultimate 64Bit. had no admin issues as i do not use UAC

Hope that helps Victor.
I tested it only briefly, but I came across a little issue. If I install LFS to "\somewhere\LFS", then install it again to "\somewhere\LFS\LFS" and then uninstall the "root" LFS, the nested LFS installation is deleted too. Is this behavior intentional? My point is that it doesn't make much sense to allow these nested installations if they all can be nuked at once.

Quote from NotAnIllusion :
However, there is one annoying issue with this. Installing to any protected folder requires admin rights, and installation fails by default. Similarly uninstalling from a protected folder fails, but it fails silently: Success is reported, menu items are removed, but folders and files remain without notification. I don't ever have to manually select run as admin when un/installing other software to Program Files, so this to me is not expected behaviour.

Solution: Please make the un/installer automatically ask for elevated rights.

I don't use UAC so I'm not entirely sure how it works now, but AFAIK LFS uses the pre-Vista assumption that "Program Files" doesn't need elevated privileges for writing. If this is the case, wouldn't installing LFS into "Program Files" lead to malfunctioning installation anyway unless LFS was run with admin rights?
Quote from MadCatX :If this is the case, wouldn't installing LFS into "Program Files" lead to malfunctioning installation anyway unless LFS was run with admin rights?

IIRC, that's correct and is the reason why LFS defaults to a non-protected location.
Quote from Degats :IIRC, that's correct and is the reason why LFS defaults to a non-protected location.

Sure, I only brought this up because NotAnIllusion suggested that the installer asked for elevated privileges. Although this would allow it to install LFS to protected locations, LFS itself wouldn't work.
This is actually a more complicated matter because the installer should take in account UAC and different user privileges. I guess that the easiest solution is to gracefully fail when the installer doesn't have write access to the selected folder and let the user deal with the consequences of running the installer as admin.
A while back when I needed to replace my computer, I downloaded the LFS installer, extracted it with 7z and then copy pasted the LFS-proper from it to Program Files (x86). That prompted for elevation, but since then there have been no issues. LFS doesn't run as elevated, it unlocked fine, saves setups and downloads skins no problem.

Also, what is the logic in not being able to run LFS properly from Program Files anyway, LFS is a program after all.. Ideally, the static components should reside in PF and the rest under a user's profile folder.
Thanks for the tests.

I've uploaded a new test installer with the following changes :
-includes the files that the installer uses to determine if a folder contains an LFS install.
-checks if any of the parent folders of the selected install location contains an LFS install. It will ask for your confirmation if so.

Regarding UAC, as long as LFS keeps all its files in one folder and doesn't follow the prescribed file location instructions, I will keep UAC off. It's not recommended to install LFS into Program Files. Which is why the default install location is not Program Files.

EDIT - for translators : I've added one extra line to the installer translation
I would like the option repair an LFS install, by installing to the same location as a current install of LFS.
Quote from Dygear :I would like the option repair an LFS install, by installing to the same location as a current install of LFS.

Huge + from me!

Also when you choose to repair, the installer should let you decide whether it overwrites the layout, setup, skins and dds folders or not.
Quote from Sobis :Huge + from me!

Also when you choose to repair, the installer should let you decide whether it overwrites the layout, setup, skins and dds folders or not.

I already suggested this But if you REPAIR LFS I don't see why would it overwrite setups, skins, layouts... more like tracks, cars files...

FGED GREDG RDFGDR GSFDG