Skip to content

Commit 83b7b3e

Browse files
committed
Bug in Linux nextcreator
1 parent 64549cc commit 83b7b3e

2 files changed

Lines changed: 44 additions & 9 deletions

File tree

ZXBStudio/BuildSystem/ZXProjectBuilder.cs

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,27 @@ private static bool BuildNexFile(byte[] binary, ZXBuildSettings settings, ZXProj
200200

201201
outputLogWritter.WriteLine("Building .nex file...");
202202
Process process = new Process();
203-
process.StartInfo.FileName = "python.exe";
204-
process.StartInfo.Arguments = string.Format("{0} nex.cfg {1}",
205-
Path.Combine(Path.GetDirectoryName(ZXOptions.Current.ZxbcPath), "tools", "nextcreator.py"),
206-
Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex");
207-
process.StartInfo.WorkingDirectory = project.ProjectPath;
208-
process.StartInfo.UseShellExecute = false;
209-
process.StartInfo.CreateNoWindow = true;
210-
process.StartInfo.RedirectStandardOutput = true;
203+
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
204+
{
205+
process.StartInfo.FileName = "python";
206+
process.StartInfo.Arguments = string.Format("{0} nex.cfg {1}",
207+
Path.Combine(Path.GetDirectoryName(ZXOptions.Current.ZxbcPath), "tools", "nextcreator.py"),
208+
Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex");
209+
process.StartInfo.WorkingDirectory = project.ProjectPath;
210+
process.StartInfo.UseShellExecute = false;
211+
process.StartInfo.CreateNoWindow = true;
212+
process.StartInfo.RedirectStandardOutput = true;
213+
}
214+
else
215+
{
216+
process.StartInfo.FileName = Path.Combine(Path.GetDirectoryName(ZXOptions.Current.ZxbcPath), "tools", "nextcreator.py");
217+
process.StartInfo.Arguments = "nex.cfg " + Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex";
218+
process.StartInfo.WorkingDirectory = project.ProjectPath;
219+
process.StartInfo.UseShellExecute = false;
220+
process.StartInfo.CreateNoWindow = true;
221+
process.StartInfo.RedirectStandardOutput = true;
222+
}
211223
process.Start();
212-
213224
process.WaitForExit();
214225

215226
if (!File.Exists(nexFile))

ZXBStudio/MainWindow.axaml.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,30 @@ private async void BuildAndRun(object? sender, Avalonia.Interactivity.RoutedEven
14271427
}
14281428
else
14291429
{
1430+
// Cleaning...
1431+
{
1432+
var file = Path.Combine(project.ProjectPath, Path.GetFileNameWithoutExtension(settings.MainFile) + ".bin");
1433+
if (File.Exists(file))
1434+
{
1435+
File.Delete(file);
1436+
}
1437+
file = Path.Combine(project.ProjectPath, "nex.cfg");
1438+
if (File.Exists(file))
1439+
{
1440+
File.Delete(file);
1441+
}
1442+
file = Path.Combine(project.ProjectPath, "sysvars.inc");
1443+
if (File.Exists(file))
1444+
{
1445+
File.Delete(file);
1446+
}
1447+
file = Path.Combine(project.ProjectPath, Path.GetFileNameWithoutExtension(settings.MainFile) + ".nex");
1448+
if (File.Exists(file))
1449+
{
1450+
File.Delete(file);
1451+
}
1452+
}
1453+
14301454
try
14311455
{
14321456
var emulatorName = Path.GetFileName(emulatorPath);

0 commit comments

Comments
 (0)