Shipping build

Is there any way to change Saved\ folder for shipping builds from appdata\local to in game folder like in developments builds? Or it’s deeply hardcorded (where?). I need it for custom launcher. Thanks.

Is it a path issue? perhaps use


%localappdata%

instead?

Not only, i need to include default ini confs MyGame\Saved with shipping build, if to stay with localappdata, game will create confs from scratch, launcher won’t be able to find default confs at first launch and creating new one’s totaly from zero with it is very ugly way… faking/creating ue confs from scratch with launcher will be not easy, better stay with prepared confs i think and just modify it.

Okey… so i was able to find probably deeply hardcoded function in WindowsPlatformProcess.cpp of the engine, tho not sure if it’s reasonable to touch it. And y know, ue4 compiles for quite a long time)). Maybe somebody can give a clue how to make it proper or hacky way?


const TCHAR* FWindowsPlatformProcess::UserSettingsDir()
{
    static FString WindowsUserSettingsDir;
    if (!WindowsUserSettingsDir.Len())
    {
        TCHAR* UserPath;

        // get the local AppData directory
        HRESULT Ret = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &UserPath);
        if (SUCCEEDED(Ret))
        {
            // make the base user dir path
            WindowsUserSettingsDir = FString(UserPath).Replace(TEXT("\\"), TEXT("/")) + TEXT("/");
            CoTaskMemFree(UserPath);
        }
    }
    return *WindowsUserSettingsDir;
}

In FPaths::CustomUserDirArgument(), is this…

// Check for a -userdir arg. If set this overrides the platform preference for using the UserDir and
// the default. The caller is responsible for ensuring that this is a valid path for the current platform!

You can use “-UserDir=<path>” on the commandline when running the game to specify a specific user directory.

Nice one, ye i saw it too, tho wasn’t sure that it’s what i wanted. But what to do with situations if user will launch game .exe, not a launcher without any arguments? Also specific user directory should have absolute path i guess and here probably needs relative one.

Game released, topic can be closed, basicly i created second launcher (replacing ue one default) in game folder and with first used UserDir with relative path to user directory.

Hi, sorry to revive this but @botman99, could you please explain the flag method in detail?
Our project is Blueprint only and I would like to know if there is any way of changing the Saved folder without using C++.

Thanks everyone!