Making an auto directory detecting installer.

I know this is not really a lua project per say, but I was trying to figure out how to pack GMOD files into an installer that will automatically detect the gmod folder that way people can just hit next on the damned thing and it will install all the files correctly.

It’s a fairly simple process.

First, look for the registry key “Software\Valve\Steam” and get the value “SteamPath”. This is the folder where steam is installed to - so add the sub folder of steamapps to the path.

For each folder in this folder that isn’t common, see if it has a garrysmod folder. This will pick up the beta in sourcemods, as well as all accounts that own garrysmod on this computer.

If there is only one result, good - use that as their assumed install path. If there is more than one, present the user with a list of accounts ( and the beta if it is there ) and ask them to pick which account they want the installer to use. If there are no results, allow them to browse for the folder.

That will give you the path to their garrysmod folder, so you want to go one folder deeper into the next garrysmod folder to get to where the actual content will be installed.

Could anyone actually write a guide on how to do each of these steps? Like I have said I have very limited programming experience.

Never mind I finally found a guide that looks like it will teach me to do it. Thank you for your help.