Skip to content

Commit 843f9af

Browse files
author
Juan Segura
committed
v1.0.0-beta3
- Bug in lauch .sh file on Linux and Mac
1 parent a76c7df commit 843f9af

3 files changed

Lines changed: 32 additions & 14 deletions

File tree

ZXBSInstaller.Log/ServiceLayer.cs

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,11 @@ public static void DownloadAndInstallTool(ExternalTool tool, ExternalTools_Versi
974974
string step = "";
975975
try
976976
{
977+
if(tool==null || version == null)
978+
{
979+
return;
980+
}
981+
977982
ShowStatusPanel($"Downloading {tool.Name} version {version.Version}...");
978983

979984
// Download path
@@ -1106,22 +1111,34 @@ exit 1
11061111
bash = bash.Replace("{tempFile}", tempFile).Replace("{installationPath}", installationPath);
11071112
File.WriteAllText(bashFile, bash);
11081113

1109-
// Set execute attr in Linux/Mac
11101114
if (CurrentOperatingSystem != OperatingSystems.Windows)
11111115
{
1112-
var process = new Process();
1113-
process.StartInfo.FileName = "chmod";
1114-
process.StartInfo.ArgumentList.Add("+x");
1115-
process.StartInfo.ArgumentList.Add(bashFile);
1116-
process.StartInfo.RedirectStandardOutput = true;
1117-
process.StartInfo.RedirectStandardError = true;
1118-
process.StartInfo.UseShellExecute = false;
1119-
process.Start();
1120-
process.WaitForExit();
1116+
// Set execute attr in Linux/Mac
1117+
{
1118+
var process = new Process();
1119+
process.StartInfo.FileName = "chmod";
1120+
process.StartInfo.ArgumentList.Add("+x");
1121+
process.StartInfo.ArgumentList.Add(bashFile);
1122+
process.StartInfo.RedirectStandardOutput = true;
1123+
process.StartInfo.RedirectStandardError = true;
1124+
process.StartInfo.UseShellExecute = false;
1125+
process.Start();
1126+
process.WaitForExit();
1127+
}
1128+
// Launch .sh file
1129+
ProcessStartInfo psi = new ProcessStartInfo
1130+
{
1131+
FileName = "bash",
1132+
Arguments = bashFile,
1133+
WorkingDirectory = Path.Combine(GeneralConfig.BasePath, "downloads"),
1134+
UseShellExecute = true,
1135+
};
1136+
var p = new Process { StartInfo = psi };
1137+
p.Start();
11211138
}
1122-
1123-
// Run batch/bash file
1139+
else
11241140
{
1141+
// Launch .bat file
11251142
ProcessStartInfo psi = new ProcessStartInfo
11261143
{
11271144
FileName = bashFile,
@@ -1132,6 +1149,7 @@ exit 1
11321149
p.Start();
11331150
}
11341151

1152+
11351153
// Exit app
11361154
ExitApp();
11371155
}

ZXBSInstaller/Controls/MainControl.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<Label x:Name="lblBasePath">Installation path</Label>
3434
<TextBox x:Name="txtBasePath" Grid.Row="1" Margin="0,4,4,0"></TextBox>
3535
<Button x:Name="btnSelectPath" Grid.Column="2" Grid.Row="1" Click="btnSelectPath_Click">...</Button>
36-
<CheckBox x:Name="chkOnlyStableVersions" Grid.Row="2" Margin="0,4,0,0" Content="Show only stable versions (no beta)"/>
36+
<CheckBox x:Name="chkOnlyStableVersions" Grid.Row="2" Margin="0,4,0,0" Content="Show only stable versions (no beta if possible)"/>
3737
<CheckBox x:Name="chkSetZXBSOptions" Grid.Row="3" Margin="0,4,0,0" Content="Update ZX Basic Studio Options"/>
3838
</Grid>
3939
</Grid>

ZXBSInstaller/ZXBSInstaller.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
88
<ApplicationIcon>zxbs.ico</ApplicationIcon>
9-
<Version>1.0.0.2</Version>
9+
<Version>1.0.0.3</Version>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<None Remove="Assets\install.svg" />

0 commit comments

Comments
 (0)