Use Path.DirectorySeparatorChar
parent
74d8790ee2
commit
7b625b2f60
|
@ -67,7 +67,7 @@ namespace LANCommander.SDK
|
||||||
bool inInstallDir = savePath.Path.StartsWith("{InstallDir}");
|
bool inInstallDir = savePath.Path.StartsWith("{InstallDir}");
|
||||||
string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString());
|
string tempSavePath = Path.Combine(tempLocation, savePath.Id.ToString());
|
||||||
|
|
||||||
var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}\\", ""));
|
var tempSavePathFile = Path.Combine(tempSavePath, savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}" + Path.DirectorySeparatorChar, ""));
|
||||||
|
|
||||||
destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory));
|
destination = Environment.ExpandEnvironmentVariables(savePath.Path.Replace('/', Path.DirectorySeparatorChar).Replace("{InstallDir}", installDirectory));
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ namespace LANCommander.SDK
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Specified path is probably an absolute path, maybe with environment variables.
|
// Specified path is probably an absolute path, maybe with environment variables.
|
||||||
destination = Environment.ExpandEnvironmentVariables(file.Replace(tempSavePathFile, savePath.Path.Replace('/', '\\')));
|
destination = Environment.ExpandEnvironmentVariables(file.Replace(tempSavePathFile, savePath.Path.Replace('/', Path.DirectorySeparatorChar)));
|
||||||
|
|
||||||
if (File.Exists(destination))
|
if (File.Exists(destination))
|
||||||
File.Delete(destination);
|
File.Delete(destination);
|
||||||
|
|
Loading…
Reference in New Issue