Skip to content

Commit 6a4e352

Browse files
committed
symlink creation will now overwrite an existing reshade .dll file
1 parent 0714bab commit 6a4e352

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Form1.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ private void installwin32_Click(object sender, EventArgs e)
272272

273273
if (Prompt.ShowRadioButtons(new string[] { "Official", "Modified" }, @"Select Official or Modified ReShade.", 250, 140, @"Modified ReShade files are self provided. Place ReShade64.dll and ReShade32.dll in the reshade-files-mod folder to use.").Text == "Official")
274274
{
275-
string temp = Path.GetDirectoryName(gameDialog.FileName) + @"\ReShade64.dll";
276-
string temp2 = dlls + @"\ReShade64.dll";
275+
if(File.Exists(Path.GetDirectoryName(gameDialog.FileName) + gamedll)) //placed here and duplicated in Else{} just in case the user closes the application when prompted
276+
{
277+
File.Delete(Path.GetDirectoryName(gameDialog.FileName) + gamedll);
278+
}
277279
if (GetMachineType(gameDialog.FileName) == MachineType.x64)
278280
{
279281
SymbolicLink.CreateSymbolicLink(Path.GetDirectoryName(gameDialog.FileName) + gamedll, workingDLLPath + @"\ReShade64.dll", 0);
@@ -285,6 +287,10 @@ private void installwin32_Click(object sender, EventArgs e)
285287
}
286288
else
287289
{
290+
if (File.Exists(Path.GetDirectoryName(gameDialog.FileName) + gamedll))
291+
{
292+
File.Delete(Path.GetDirectoryName(gameDialog.FileName) + gamedll);
293+
}
288294
workingDLLPath = mdlls;
289295
if (GetMachineType(gameDialog.FileName) == MachineType.x64)
290296
{

0 commit comments

Comments
 (0)