Closed q4a closed 1 year ago
Thanks for the changes!
But why do you restore the backup in the get() function? If that would be done in set() instead (which also sounds like the more appropriate place), this symlink stuff in get() could also be simplified to just if (WasEnabled && ln && (!reg || !file_exists())
But why do you restore the backup in the get() function?
This will not work (at least with current changes). Here is example:
d3d9-nine.bac
renamed to d3d9.dll
in set() function. Also WasEnabled
is true.reg = nine_registry_enabled(); // false
ln = is_symlink(buf); // true
ret = reg && ln;
if (!reg && ln) // true
{
/* Sanity: Remove symlink if any */
if (WasEnabled) // true
{
ERR("removing obsolete symlink\n");
remove_file(buf); // remove d3d9.dll which already is symlink to proton.
}
ret = FALSE;
}
Your if (WasEnabled && ln && (!reg || !file_exists())
looks strange.
You 100% need to check if file_exists("d3d9-nine.bac")
and then you can rename only if it's true.
General problem: if WINEPREFIX already has d3d9.dll and you installing Nine, then old d3d9.dll will be deleted. After this change it will be stored as d3d9-nine.bac.
I hope, that it will be enough to close https://github.com/iXit/wine-nine-standalone/issues/136