6

Steam has a couple of scripts that are executed after the installation of a Game or Program. They say what else needs to be installed or what registry keys need to be created. Some examples:

  • Just Dance 2017 installs Uplay, declared in "steamapps\common\Just Dance 2017\Support\Installerscript.vdf"
  • GTA IV creates "HKEY_LOCAL_MACHINE\SOFTWARE\Rockstar Games\Grand Theft Auto IV", declared in "steamapps\common\Grand Theft Auto IV\GTAIV\installscript.vdf"

Is there a way to force Steam to run the post installation scripts again?

4 Answers 4

2

From Steamworks Docs about Common Redistributables (e.g. DirectX, VC++, other common DLLs):

... can also force Steam to reinstall common redistributables by deleting the following registry key:

  • 32-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam\Apps\CommonRedist
  • 64-bit Windows: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Valve\Steam\Apps\CommonRedist

A subkey is created in [the given key] for each common redistributable which has been installed, so you can delete individual subkeys to test various partially-installed states as well.


Along with Common Redist, games can still include an InstallScript. For example, Fallout: New Vegas includes the below InstallScript.vdf, where 22380 is the appid for FNV on Steam and so the hasrunkey is unique to FNV itself. On Mac/Linux the registry entries are stored in a file called registry.vdf.

Note the use of tabs instead of spaces in between a key (first string in a line) and a value, as Steam can be sensitive and throw away as little as a key/value (KV) or as much as a whole file if it's considered "corrupted". Then it would grab a new copy from the cloud (if it's a synched file, which not all are) or recreate the file or KV from a default version (which can cause data loss).

There may still be edge cases where a synched file can be replaced with a default version if "corrupted", but it's been years since I screwed around with Steam so IDK which files have this bug/feature any more, and hopefully it has been fixed.

"installscript"
{
    "registry"
    {
        "hkey_local_machine\\software\\bethesda softworks\\falloutnv"
        {
            "string"
            {
                "installed path"        "%INSTALLDIR%\\"
            }
        }
    }
    "run process"
    {
        "visualcredist"
        {
            "hasrunkey"     "HKEY_LOCAL_MACHINE\\Software\\Valve\\Steam\\Apps\\22380"
            "process 1"     "%INSTALLDIR%\\Redists\\vcredist_x86.exe"
            "command 1"     "/q"
            "nocleanup"     "1"
        }
        "directx"
        {
            "hasrunkey"     "HKEY_LOCAL_MACHINE\\Software\\Valve\\Steam\\Apps\\22380"
            "process 1"     "%INSTALLDIR%\\Redists\\directx\\DXSETUP.exe"
            "command 1"     "/silent"
            "nocleanup"     "1"
        }
    }
}
"kvsignatures"
{
    "installscript"     "8cc46324207e245aaa34edcfcbd725ed3bd35ad46575630c1fcd0fdfc9b15edd4208e10c80ba000c3fdd43a89caafacfed7caa7e01ec7255e488f4172666bb6fe335e6e5ebf187510c2615bafe0ed7210c2b91e47969658544f7f0acdb5016628f7855ae24c4191ce2c2330ff81b6c711cd513e7255ad1d41a10c975c1789465"
}
1

From https://partner.steamgames.com/doc/sdk/installscripts :

The install script is marked in the depot manifest. You can see this in the generated manifest.txt file as a 100 in the Flags field.

When a Steam user is starting a game, Steam will scan all of the mounted depots for that game for any file with the install script flag and run them.

From what I understand, you need to find that manifest.txt file for specific game and update this Flags field back to initial value (100).

This answer suggests that for each dependency Steam may actually create a registry entry, which means it may be required to clean the registry before trying to relaunch install scripts.

And it also works only for Windows:

NOTE: Install script functionality described below is primarily for Windows operating systems. MacOS support is limited to file permissions and symlinks. There is no Linux/SteamOS install script functionality at this time.

Unfortunately, I don't have Windows machine right now and cannot validate this.

1
  • 2
    This information is outdated by years (why Valve). Steam no longer uses manifest.txt for game information, being replaced by appmanifest_APPID.acf (for example, appmanifest_550.acf for Left 4 Dead 2).
    – Lemon
    Commented Apr 21, 2020 at 19:14
0

In Steam, going into Game Properties -> Local Files -> Verify Game Files.

Note that as well as checking the integrity of all installed files, this action also causes Steam to re-execute any application-defined one-time installscript actions.

2
  • As the other answer says, this only verifies the integrity of the files, it does not runs the executables.
    – Lemon
    Commented May 11 at 3:24
  • 1
    Except the other answer was just you assuming that it was a waste of time and not trying it. Steamworks API docs confirm that selecting Verify Game Files does force the Steam client to remove the registry keys as well as execute the Run Process On Uninstall part of the installscript (see partner.steamgames.com/doc/sdk/installscripts). The next time you attempt to run the game after triggering a verify, Steam will re-execute all the install instructions as well. I have verified this exact behaviour today, as I am currently debugging another installscript issue for my own game.
    – Paradice
    Commented May 12 at 19:28
-2

I don't think so, maybe go to the game's properties (on Steam) and go to the local files tab and click on the verify Game files. It'll basically see if any files are missing and u can choose if you would like to reinstall them.

1
  • I already have the complete game, checking the integrity of them will just be a waste of time. Running the files manually is not possible for some games (for example, installing Easy Anti Cheat for Sword Art Online Fatal Bullet).
    – Lemon
    Commented Apr 21, 2020 at 18:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .